/* =============================================================
   GESTAO DE CONTRATOS — Design System (Corporate Redesign)
   Sober, dense, professional. Single accent. Print-ready reports.
   Preserves all existing class hooks used by the templates.
   ============================================================= */

:root {
  /* Neutrals */
  --bg:           #f4f6fa;
  --surface:      #ffffff;
  --surface-soft: #f8fafc;
  --surface-2:    #f1f4f9;
  --surface-muted:#eef2f7;

  /* Ink */
  --ink:          #0b1220;
  --text:         #1f2937;
  --muted:        #64748b;
  --muted-2:      #94a3b8;

  /* Lines */
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;

  /* Brand: navy + single steel-blue accent */
  --primary:      #1e3a8a;       /* navy 800 */
  --primary-dark: #172a63;
  --primary-soft: #eef2ff;
  --accent:       #2563eb;       /* used sparingly */
  --accent-soft:  #e0e9ff;

  /* Semantic */
  --success:      #047857;
  --success-soft: #ecfdf5;
  --warning:      #b45309;
  --warning-soft: #fff7ed;
  --danger:       #b91c1c;
  --danger-soft:  #fef2f2;
  --info:         #0e7490;
  --info-soft:    #ecfeff;

  /* Sidebar (deep slate) */
  --sidebar:      #0f172a;
  --sidebar-2:    #0b1324;
  --sidebar-text: #e2e8f0;
  --sidebar-muted:#7f8ea8;
  --sidebar-hover:#1f2a44;
  --sidebar-active-bar:#60a5fa;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 10px -2px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 40px -16px rgba(15, 23, 42, .18);

  /* Geometry */
  --radius-xs: 4px;
  --radius:    6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  --sidebar-w: 260px;
  --topbar-h:  60px;
}

/* Fluxo de Documentos V17 — seleções pesquisáveis e ações compactas. */
.app-search-select { position: relative; width: 100%; }
.app-search-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.app-search-select-control {
  position: relative;
  width: 100%;
  min-height: 38px;
  padding: .45rem 2.2rem .45rem .75rem;
  overflow: hidden;
  color: var(--text);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.app-search-select-control::after {
  content: "";
  position: absolute;
  top: 50%;
  right: .85rem;
  width: .5rem;
  height: .5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
}
.app-search-select-control.is-placeholder { color: var(--muted); }
.app-search-select-control:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); outline: 0; }
.app-search-select-control:disabled { color: var(--muted); background: var(--surface-muted); cursor: not-allowed; }
.app-search-select-panel {
  position: absolute;
  z-index: 1080;
  top: calc(100% + .3rem);
  left: 0;
  display: none;
  width: 100%;
  min-width: 260px;
  padding: .5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.app-search-select.is-open .app-search-select-panel { display: block; }
.app-search-select-options { max-height: 260px; margin-top: .4rem; overflow-y: auto; }
.app-search-select-option {
  display: block;
  width: 100%;
  padding: .55rem .65rem;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
}
.app-search-select-option:hover, .app-search-select-option:focus { color: var(--primary); background: var(--primary-soft); outline: 0; }
.app-search-select-option.is-selected { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.app-search-select-empty { padding: .8rem; color: var(--muted); text-align: center; font-size: .85rem; }
.fluxo-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
.fluxo-action-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
  transition: transform .16s ease, box-shadow .16s ease;
}
.fluxo-action-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
@media (max-width: 575.98px) {
  .app-search-select-panel { position: fixed; top: auto; right: 1rem; bottom: 1rem; left: 1rem; width: auto; min-width: 0; }
  .app-search-select-options { max-height: 42vh; }
}

/* ============================================================
   ATAS — fluxo em três telas
   ============================================================ */
.ata-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.ata-step {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 72px;
  padding: .85rem 1rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.ata-step:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.ata-step-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 800;
}
.ata-step small,
.ata-step strong { display: block; }
.ata-step small { margin-bottom: .15rem; font-size: .65rem; font-weight: 800; letter-spacing: .08em; }
.ata-step strong { color: var(--text); font-size: .9rem; }
.ata-step.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(21, 87, 176, .12);
}
.ata-step.is-active .ata-step-number {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.ata-step.is-complete .ata-step-number {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(21, 87, 176, .35);
}
.ata-page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
  .ata-steps { grid-template-columns: 1fr; }
  .ata-step { min-height: 60px; }
  .ata-page-actions .btn { flex: 1 1 auto; }
}

.ata-lotes-lista {
  display: grid;
  gap: 1rem;
}
.ata-lote-card {
  overflow: hidden;
  border-color: var(--border-strong);
}
.ata-lote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border-left: 4px solid var(--primary);
}
.ata-lote-title-wrap {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
}
.ata-lote-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
}
.ata-lote-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .9rem;
  color: var(--muted);
  font-size: .73rem;
}
.ata-lote-meta span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: .9rem;
  vertical-align: middle;
  background: var(--muted-2);
  border-radius: 50%;
}
.ata-lote-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .4rem;
}
.ata-lote-content {
  border-top: 1px solid var(--border);
}
.ata-item-form-wrap {
  padding: 1rem 1.1rem 1.15rem;
  background: var(--primary-soft);
  border-bottom: 1px solid rgba(30, 58, 138, .18);
}
.ata-item-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .85rem;
}
.ata-lote-table-wrap {
  border: 0;
  border-radius: 0;
}
.ata-lote-table-wrap .table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .04em;
}
.ata-lote-resumo-row td {
  padding: .8rem 1rem !important;
  background: #eef6ff !important;
  border-top: 2px solid rgba(30, 58, 138, .28) !important;
}
.ata-lote-resumo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem 1.5rem;
  color: var(--primary-dark);
}
.ata-lote-resumo > strong {
  margin-right: auto;
}
.ata-resumo-geral {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(30, 58, 138, .28);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.ata-resumo-geral-title {
  display: flex;
  align-items: center;
  padding: .9rem 1.1rem;
  color: #fff;
  background: var(--primary);
}
.ata-resumo-geral-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.ata-resumo-geral-grid > div {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.25rem;
  border-right: 1px solid var(--border);
}
.ata-resumo-geral-grid > div:last-child { border-right: 0; }
.ata-resumo-geral-grid span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.ata-resumo-geral-grid strong {
  color: var(--ink);
  font-size: 1.35rem;
}
.ata-resumo-geral-grid .ata-resumo-geral-valor strong {
  color: var(--primary);
}
.ata-resumo-regra {
  padding: .65rem 1.1rem;
  color: var(--muted);
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  font-size: .7rem;
  text-align: right;
}
@media (max-width: 992px) {
  .ata-lote-header { align-items: flex-start; }
  .ata-lote-actions { width: 100%; justify-content: flex-start; padding-left: 3.3rem; }
}
@media (max-width: 768px) {
  .ata-lote-header { padding: .85rem; }
  .ata-lote-title-wrap { align-items: flex-start; }
  .ata-lote-actions { padding-left: 0; }
  .ata-lote-actions .btn { flex: 1 1 auto; }
  .ata-item-form-wrap { padding: .85rem; }
  .ata-lote-resumo { align-items: flex-start; flex-direction: column; }
  .ata-resumo-geral-grid { grid-template-columns: 1fr; }
  .ata-resumo-geral-grid > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .ata-resumo-geral-grid > div:last-child { border-bottom: 0; }
  .ata-resumo-regra { text-align: left; }
}

* { box-sizing: border-box; }
html { min-height: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: uppercase;     /* keep system-wide convention */
}
input, textarea, select { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); opacity: 1; }

::selection { background: var(--accent-soft); color: var(--primary-dark); }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.app-shell { min-height: 100vh; display: flex; }

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-brand {
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: .8rem; font-weight: 800; letter-spacing: .04em;
  text-decoration: none;
}
.brand-mark:hover { color: #fff; background: var(--primary-dark); }
.brand-text { min-width: 0; line-height: 1.15; }
.brand-text strong { display: block; color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
.brand-text span   { display: block; margin-top: 2px; color: var(--sidebar-muted); font-size: .62rem; font-weight: 600; letter-spacing: .08em; }

.sidebar-scroll { overflow-y: auto; padding: 10px 8px 16px; flex: 1; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 999px; }

.sidebar-nav { display: grid; gap: 1px; }
.sidebar-section { display: grid; gap: 1px; }

.sidebar-link {
  width: 100%;
  min-height: 34px;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .02em;
  text-align: left;
  transition: background .12s ease, color .12s ease;
  position: relative;
}
.sidebar-link i { width: 16px; color: var(--sidebar-muted); font-size: .95rem; text-align: center; }
.sidebar-link:hover,
.sidebar-link:focus { color: #fff; background: var(--sidebar-hover); outline: none; text-decoration: none; }
.sidebar-link:hover i { color: #cbd5e1; }
.sidebar-link.active {
  color: #fff;
  background: var(--sidebar-hover);
  font-weight: 700;
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-active-bar);
}
.sidebar-link.active i { color: var(--sidebar-active-bar); }
.sidebar-toggle .bi-chevron-down { transition: transform .15s ease; font-size: .75rem; opacity: .7; }
.sidebar-toggle[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }

.sidebar-subnav {
  margin: 2px 0 4px 22px;
  padding: 2px 0 2px 10px;
  display: grid;
  gap: 0;
  border-left: 1px solid rgba(255,255,255,.08);
}
.sidebar-subnav a {
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  color: #b6c2d6;
  font-weight: 500;
  font-size: .7rem;
  line-height: 1.25;
  text-decoration: none;
}
.sidebar-subnav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sidebar-subnav-grouped span {
  display: block;
  margin: 8px 0 2px;
  padding: 0 8px;
  color: var(--sidebar-muted);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar-subnav-grouped span:first-child { margin-top: 0; }
.sidebar-backdrop { display: none; }

/* ============================================================
   MAIN + TOPBAR
   ============================================================ */
.app-main {
  width: 100%; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}
.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  min-height: var(--topbar-h);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-left,
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-kicker { color: var(--muted-2); font-weight: 700; font-size: .6rem; letter-spacing: .12em; }
.topbar-title  { color: var(--ink);     font-weight: 700; font-size: .92rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-icon {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.btn-icon:hover { background: var(--surface-2); }
.sidebar-mobile-toggle { display: none; }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px 10px 4px 4px;
  box-shadow: none;
}
.user-chip:hover { background: var(--surface-2); }
.user-avatar {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff; font-weight: 700; font-size: .74rem;
}
.user-meta { text-align: left; line-height: 1.05; }
.user-meta b      { display: block; font-size: .72rem; color: var(--ink); font-weight: 700; }
.user-meta small  { display: block; color: var(--muted); font-size: .6rem; font-weight: 600; }

.app-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px clamp(16px, 1.6vw, 28px) 28px;
}

/* Page header (first .d-flex or heading in .app-content) */
.app-content > .d-flex:first-child,
.app-content > h2:first-child,
.app-content > h3:first-child {
  margin-bottom: 14px !important;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.app-content > .d-flex:first-child h1,
.app-content > .d-flex:first-child h2,
.app-content > .d-flex:first-child h3,
.app-content > .d-flex:first-child h4,
.app-content > h2:first-child,
.app-content > h3:first-child {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
}

.text-muted { color: var(--muted) !important; }

/* ============================================================
   CARDS
   ============================================================ */
.app-card,
.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-body { padding: 16px 18px; }
.card h3, .card h4, .card h5, .card h6 { color: var(--ink); font-weight: 700; }
.card .border.rounded-3.bg-light,
.card .bg-light { background: var(--surface-soft) !important; border-color: var(--border) !important; }

/* Alerts */
.alert {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .65rem .85rem;
  font-weight: 600;
  font-size: .78rem;
}
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(4,120,87,.18); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(180,83,9,.18); }
.alert-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(185,28,28,.18); }
.alert-info    { background: var(--info-soft);    color: var(--info);    border-color: rgba(14,116,144,.18); }
.alert-light, .alert-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.toast-area {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 18px;
  z-index: 2000;
  min-width: 280px;
  max-width: 460px;
}

/* Badges */
.badge {
  border-radius: 4px;
  padding: .32rem .5rem;
  font-weight: 700;
  font-size: .66rem;
  letter-spacing: .04em;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .015em;
  padding: .42rem .85rem;
  box-shadow: none !important;
  border-width: 1px;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn-sm { border-radius: var(--radius-xs); font-size: .72rem; padding: .32rem .65rem; }
.btn-lg { font-size: .85rem; padding: .55rem 1.1rem; }

.btn-primary  { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover,
.btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-success  { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #036046; border-color: #036046; color: #fff; }

.btn-warning  { background: #d97706; border-color: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; border-color: #b45309; color: #fff; }

.btn-danger   { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: #fff; }

.btn-info     { background: var(--info); border-color: var(--info); color: #fff; }
.btn-info:hover { background: #155e75; border-color: #155e75; color: #fff; }

.btn-light    { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-light:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--ink); }

.btn-outline-primary   { border-color: var(--border-strong); color: var(--primary); background: var(--surface); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-outline-secondary { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-outline-secondary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-outline-dark      { border-color: var(--border-strong); color: var(--ink); background: var(--surface); }
.btn-outline-dark:hover { background: var(--ink); color: #fff; }
.btn-outline-danger    { border-color: #fecaca; color: var(--danger); background: var(--surface); }
.btn-outline-danger:hover  { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-outline-success   { border-color: #bbf7d0; color: var(--success); background: var(--surface); }
.btn-outline-success:hover { background: var(--success); border-color: var(--success); color: #fff; }
.btn-outline-info      { border-color: #bae6fd; color: var(--info); background: var(--surface); }
.btn-outline-info:hover { background: var(--info); border-color: var(--info); color: #fff; }
.btn-outline-light     { border-color: rgba(255,255,255,.55); color: #fff; background: transparent; }
.btn-outline-light:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.form-control,
.form-select {
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: .82rem;
  padding: .38rem .65rem;
  box-shadow: none !important;
  text-transform: uppercase;
}
.form-control-sm, .form-select-sm { min-height: 32px; font-size: .76rem; padding: .3rem .55rem; }
.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}
.form-control::placeholder { color: var(--muted-2); }
textarea.form-control { min-height: 88px; }
input[type="email"], input[type="url"], input[type="password"] { text-transform: none; }
.form-text { color: var(--muted); font-weight: 500; font-size: .72rem; }
.form-check-input { border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-label { font-weight: 600; font-size: .78rem; }
form.row { align-items: end; }

.input-group-text {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  scrollbar-width: thin;
}
.table {
  margin-bottom: 0;
  color: var(--text);
  vertical-align: middle;
  font-size: .8rem;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  background: var(--surface-2) !important;
  color: var(--muted);
  border-bottom: 1px solid var(--border) !important;
  border-top: 0 !important;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .65rem .75rem;
}
.table td {
  border-color: var(--border) !important;
  padding: .55rem .75rem;
  font-weight: 500;
  color: var(--text);
}
.table thead th:first-child,
.table tbody td:first-child { padding-left: 1rem; }
.table thead th:last-child,
.table tbody td:last-child  { padding-right: 1rem; }
.table-hover tbody tr:hover { background-color: var(--surface-soft); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--surface-soft); }
.table .btn { margin: 1px; }
.table-warning > * { --bs-table-bg: #fff7ed; }
.table-danger  > * { --bs-table-bg: #fef2f2; }
.text-nowrap { white-space: nowrap !important; }

/* ============================================================
   METRIC CARDS / QUICK GRID (dashboard)
   ============================================================ */
.metric-card {
  position: relative;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.metric-card::after { content: none; }
.metric-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.metric-card .card-body { padding: 16px 18px; position: relative; }
.metric-card .card-body::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.metric-title { color: var(--muted); font-size: .68rem; min-height: 28px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.metric-value { font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -.015em; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.quick-grid a {
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: .76rem;
  text-align: center;
}
.quick-grid a:hover { background: var(--primary-soft); border-color: var(--accent); color: var(--primary-dark); text-decoration: none; }

/* ============================================================
   GRID HEADERS (used across listings)
   Unified into a single sober style — variants kept as hooks
   ============================================================ */
.grid-header {
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.grid-header h5, .grid-header h4 { color: var(--ink); margin: 0; font-weight: 700; font-size: .9rem; letter-spacing: .01em; }
.grid-header .text-white, .grid-header .text-white-50 { color: var(--muted) !important; }
.grid-header .btn { border-radius: var(--radius); }
.grid-header .btn-outline-light {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface);
}
.grid-header .btn-outline-light:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Optional accent strip for visual differentiation */
.grid-header-lotes,
.grid-header-vigente,
.grid-header-prorrogada,
.grid-header-adesao,
.grid-header-contratos,
.grid-header-import,
.grid-header-relatorios {
  background: var(--surface-2);
  border-top: 3px solid var(--accent);
}
.grid-header-lotes      { border-top-color: #0d9488; }
.grid-header-vigente    { border-top-color: #1d4ed8; }
.grid-header-prorrogada { border-top-color: #7c3aed; }
.grid-header-adesao     { border-top-color: #d97706; }
.grid-header-contratos  { border-top-color: #475569; }
.grid-header-import     { border-top-color: #0284c7; }
.grid-header-relatorios { border-top-color: #1d4ed8; }

/* ============================================================
   MODALS / DROPDOWNS
   ============================================================ */
.modal-content { border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.modal-header  { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 18px; }
.modal-header .modal-title { font-weight: 700; font-size: .95rem; color: var(--ink); }
.modal-body    { padding: 16px 18px; }
.modal-footer  { background: var(--surface-soft); border-top: 1px solid var(--border); padding: 12px 18px; }

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .35rem;
  box-shadow: var(--shadow-md);
}
.dropdown-item {
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: .76rem;
  padding: .42rem .65rem;
  color: var(--text);
}
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--primary); }
.dropdown-divider { border-color: var(--border); }
.dropdown-menu-relatorios { min-width: 290px; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-bg {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 20%, rgba(37,99,235,.18), transparent 28rem),
    linear-gradient(160deg, #0b1220 0%, #1e3a8a 100%);
}
.login-card {
  width: min(420px, 94vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.brand-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  margin: 0 auto 8px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .04em;
}
.login-form .input-group-text {
  border-color: var(--border-strong);
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}
.login-form .input-group .form-control { border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; }

/* ============================================================
   TIMELINE & MISC EXISTING COMPONENTS
   ============================================================ */
.timeline { display: grid; gap: 10px; }
.timeline-item {
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 12px 14px;
}
.cnd-checkbox-dropdown .dropdown-menu { max-height: 340px; overflow: hidden; min-width: 260px; }
.cnd-checkbox-list { max-height: 230px; overflow-y: auto; padding-right: 4px; }
.cnd-checkbox-dropdown .dropdown-toggle::after { margin-left: 10px; }
.cnd-checkbox-dropdown .cnd-dropdown-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(100% - 24px); }

/* ============================================================
   REPORTS — corporate, print-ready
   ============================================================ */
.brand-report {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.report-header {
  page-break-inside: avoid;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.report-header h3, .report-header h4 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; margin: 0; }
.report-header .text-muted, .report-header small { color: var(--muted) !important; }

.filtros-report {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: .78rem;
}
.filtros-report strong { color: var(--ink); font-weight: 700; }

.ata-report-title {
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.ata-report-title h5, .ata-report-title h6 { color: var(--ink); font-weight: 700; margin: 0; }

.lote-report-title {
  background: var(--ink);
  color: #fff;
  border: 0;
  padding: 8px 12px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .03em;
}

.report-section { page-break-inside: avoid; margin-bottom: 18px; }

.report-table {
  width: 100%;
  font-size: .78rem;
  border-collapse: collapse;
  background: var(--surface);
}
.report-table thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 8px;
  border: 1px solid var(--border);
}
.report-table tbody td {
  padding: 6px 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.report-table tbody tr:nth-child(even) td { background: var(--surface-soft); }
.report-table tfoot td, .report-table .total-row td {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--ink);
  border-top: 2px solid var(--ink) !important;
}

/* Compact report variant (adesão) */
.report-compact .card-body { padding: 14px 16px; }
.report-compact .report-header { margin-bottom: 10px !important; padding-bottom: 8px !important; }
.report-compact .brand-report { width: 32px; height: 32px; border-radius: var(--radius-xs); margin-bottom: 4px; font-size: .78rem; }
.report-compact h4 { font-size: 1rem; }
.report-compact h5 { font-size: .92rem; }
.report-compact h6 { font-size: .82rem; }
.report-compact .ata-report-title { padding: 7px 10px !important; margin-bottom: 8px !important; border-left-width: 3px; }
.report-compact .lote-report-title { padding: 6px 9px; font-size: .78rem; }
.report-compact .report-table { font-size: .74rem; margin-bottom: 6px; }
.report-compact .report-table th,
.report-compact .report-table td { padding: 4px 6px; vertical-align: middle; }
.report-compact .report-section { margin-bottom: 10px !important; page-break-inside: auto; }
.report-compact .filtros-report { margin-bottom: 8px !important; }

/* Legacy navbar compat */
.navbar-main { background: var(--sidebar) !important; }
.navbar-main .navbar-brand,
.navbar-main .nav-link { color: #fff !important; font-weight: 600 !important; text-transform: uppercase; letter-spacing: .02em; }
.navbar-main .navbar-brand { font-size: 1rem; white-space: nowrap; }
.navbar-main .main-menu { gap: .25rem; justify-content: center; align-items: center; }
.navbar-main .nav-link { padding: .35rem .7rem !important; border-radius: var(--radius); }
.navbar-main .nav-link:hover,
.navbar-main .nav-link:focus { background: rgba(255,255,255,.10); color: #fff !important; }
.navbar-main .dropdown-menu { background: var(--sidebar-2); border: 1px solid rgba(255,255,255,.10); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: .35rem; min-width: 240px; }
.navbar-main .dropdown-item { color: #e2e8f0; font-weight: 600; text-transform: uppercase; border-radius: var(--radius-xs); padding: .45rem .7rem; }
.navbar-main .dropdown-item:hover,
.navbar-main .dropdown-item:focus { background: var(--accent); color: #fff; }
.navbar-main .dropdown-item.text-danger { color: #fecaca !important; }
.navbar-main .dropdown-item.text-danger:hover { color: #fff !important; background: var(--danger); }
.navbar-main .dropdown-divider { border-color: rgba(255,255,255,.18); }
.navbar-main .dropdown-submenu { position: relative; }
.navbar-main .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-left: .15rem; margin-top: -.35rem; display: none; }
.navbar-main .dropdown-submenu:hover > .dropdown-menu,
.navbar-main .dropdown-submenu:focus-within > .dropdown-menu { display: block; }
.navbar-main .dropdown-submenu > .dropdown-toggle::after { float: right; margin-top: .45rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 1400px) {
  .app-content { padding-left: 28px; padding-right: 28px; }
  .table { font-size: .84rem; }
}
@media (max-width: 1199.98px) {
  :root { --sidebar-w: 240px; }
  .app-topbar { padding-inline: 16px; }
  .app-content { padding-inline: 16px; }
  .card-body { padding: 14px; }
}
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-104%); transition: transform .22s ease; }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 1035;
    background: rgba(15,23,42,.46);
    backdrop-filter: blur(2px);
  }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .app-main { margin-left: 0; }
  .sidebar-mobile-toggle { display: inline-grid; }
  .app-topbar { min-height: 56px; }
  .topbar-title { max-width: 50vw; }
  .app-content { padding-top: 14px; }
  .app-content > .d-flex:first-child { align-items: flex-start !important; }
  .table { font-size: .78rem; }
  .navbar-main .main-menu { align-items: stretch; }
  .navbar-main .dropdown-submenu > .dropdown-menu { position: static; display: block; margin: .25rem 0 .4rem .75rem; border-left: 3px solid rgba(255,255,255,.18); box-shadow: none; }
  .navbar-main .dropdown-submenu > .dropdown-toggle::after { transform: rotate(90deg); }
  .navbar-main .user-menu { margin-top: .75rem; }
}
@media (max-width: 767.98px) {
  body { font-size: 13px; }
  .topbar-actions .btn:not(.user-chip) { display: none !important; }
  .topbar-title { max-width: 42vw; font-size: .85rem; }
  .app-content { padding: 12px 12px 22px; }
  .app-content > .d-flex:first-child,
  .app-content > h3:first-child,
  .app-content > h2:first-child { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .table td, .table th { padding: .55rem .55rem; }
  .toast-area { left: 12px; right: 12px; min-width: 0; max-width: none; }
}

/* ============================================================
   SIDEBAR RESIZE / COMPACT
   ============================================================ */
.app-sidebar,
.app-main { transition: width .2s ease, margin-left .2s ease, transform .22s ease; }
.app-sidebar { min-width: 220px; max-width: 360px; position: fixed; }
.sidebar-close {
  width: 32px; height: 32px; min-width: 32px;
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff;
}
.sidebar-close:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-resizer {
  position: absolute; top: 0; right: -4px; width: 8px; height: 100%;
  cursor: col-resize; z-index: 5;
}
.sidebar-resizer::after {
  content: ""; position: absolute; top: 80px; right: 3px; width: 2px; height: 60px;
  border-radius: 999px; background: rgba(255,255,255,.22); opacity: 0;
  transition: opacity .18s ease, background .18s ease;
}
.sidebar-resizer:hover::after,
body.sidebar-resizing .sidebar-resizer::after { opacity: 1; background: var(--sidebar-active-bar); }
body.sidebar-resizing { cursor: col-resize; user-select: none; }
.sidebar-desktop-toggle { flex: 0 0 36px; }

body.sidebar-compact .app-sidebar { min-width: 72px; max-width: 72px; overflow-x: hidden; }
body.sidebar-compact .brand-text,
body.sidebar-compact .sidebar-link span,
body.sidebar-compact .sidebar-link .bi-chevron-down,
body.sidebar-compact .sidebar-subnav,
body.sidebar-compact .collapse,
body.sidebar-compact .sidebar-resizer { display: none !important; }
body.sidebar-compact .sidebar-brand { justify-content: center; padding-inline: 10px; }
body.sidebar-compact .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
body.sidebar-compact .sidebar-scroll { padding: 10px 8px 16px; }
body.sidebar-compact .sidebar-link { justify-content: center; min-height: 42px; padding: 10px 6px; }
body.sidebar-compact .sidebar-link i { width: auto; font-size: 1.05rem; color: var(--sidebar-text); }
body.sidebar-compact .sidebar-link.active::before { display: none; }
body.sidebar-compact .sidebar-link.active { box-shadow: inset 0 -2px 0 var(--sidebar-active-bar); }
body.sidebar-compact .sidebar-section { display: grid; place-items: center; }

/* Fullscreen grid screens */
.fullscreen-grid-page .app-content,
.app-content.fullscreen-grid-content { max-width: none; }
.fullscreen-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.filter-card .form-control,
.filter-card .form-select { min-height: 34px; }
.fullscreen-table-wrap {
  max-height: calc(100vh - 300px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.fullscreen-table-wrap .table { min-width: 1120px; }
.fullscreen-table-wrap .table th { top: 0; }
.grid-action-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-fullscreen-grid { border-radius: var(--radius); font-weight: 600; }

@media (max-width: 991.98px) {
  .app-sidebar {
    width: min(var(--sidebar-w), 86vw);
    min-width: 0;
    max-width: 86vw;
  }
  .sidebar-resizer { display: none; }
  body.sidebar-compact .app-sidebar {
    width: min(var(--sidebar-w), 86vw);
    min-width: 0;
    max-width: 86vw;
  }
  body.sidebar-compact .brand-text,
  body.sidebar-compact .sidebar-link span,
  body.sidebar-compact .sidebar-link .bi-chevron-down,
  body.sidebar-compact .collapse.show,
  body.sidebar-compact .sidebar-subnav { display: initial !important; }
  body.sidebar-compact .sidebar-subnav { display: grid !important; }
  body.sidebar-compact .sidebar-link { justify-content: flex-start; min-height: 36px; padding: 7px 10px; }
  body.sidebar-compact .sidebar-link i { width: 16px; font-size: .95rem; }
  body.sidebar-compact .sidebar-brand { justify-content: flex-start; padding: 12px 14px; }
  .fullscreen-table-wrap { max-height: none; }
}
body:has(.fullscreen-grid-page) .app-content { max-width: none; }

/* ============================================================
   CONTRATO — cabecalho + grids
   ============================================================ */
.contrato-cabecalho-detalhado {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.contrato-cabecalho-detalhado p { margin-bottom: 0 !important; }
.contrato-cabecalho-detalhado .contrato-info-inline { display: none !important; }
.contrato-info-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.contrato-info-inline span {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.15;
  white-space: nowrap;
}
.contrato-info-inline b { color: var(--ink); font-weight: 700; }
@media (max-width: 767.98px) {
  .contrato-info-inline span { width: 100%; white-space: normal; border-radius: var(--radius); }
}

.contrato-grids-stack { display: grid; gap: 10px; }
.contrato-grid-card .card-body { padding: 14px 16px; }
.contrato-grid-card form.mt-3 { margin-top: .75rem !important; }
.contrato-grid-card .table-responsive { margin-bottom: 0; }
.contrato-grid-card .d-flex.flex-wrap.gap-2.mt-3 { margin-top: .75rem !important; }

/* Dotações */
.contract-dotacao-panel {
  border-color: var(--border) !important;
  background: var(--surface-soft) !important;
}
.contract-dotacao-panel .form-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem;
}
.contract-dotacao-panel .form-select { min-height: 34px; font-size: .8rem; }

.dotacao-accordion .accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 8px;
  background: var(--surface);
}
.dotacao-accordion .accordion-button {
  min-height: 50px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
  gap: .5rem;
  font-size: .82rem;
}
.dotacao-accordion .accordion-button:not(.collapsed) {
  color: var(--primary);
  background: var(--primary-soft);
  border-bottom: 1px solid var(--border);
}
.dotacao-accordion .accordion-button::after { filter: grayscale(1) opacity(.6); }
.dotacao-accordion-title { display: inline-flex; align-items: center; min-width: 220px; letter-spacing: .01em; }
.dotacao-filter-card { border-radius: var(--radius-md); }
.dotacao-filter-card .form-label,
.dotacao-accordion .form-label { font-size: .68rem; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.dotacao-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.dotacao-table-wrap .table thead th {
  background: var(--surface-2); color: var(--muted);
  font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
}
@media (max-width: 768px) {
  .dotacao-accordion-title { min-width: auto; }
  .dotacao-accordion .accordion-button { align-items: flex-start; }
}

/* Bootstrap subtle utilities */
.bg-light, .bg-light-subtle { background: var(--surface-soft) !important; }
.bg-primary-subtle { background: var(--primary-soft) !important; color: var(--primary-dark) !important; }
.border { border-color: var(--border) !important; }

/* Pedido de adesão — cabeçalhos compactos e leitura responsiva */
.pedido-adesao-table { min-width: 1080px; font-size: .78rem; }
.pedido-adesao-table thead th {
  white-space: nowrap;
  padding-left: .45rem;
  padding-right: .45rem;
  font-size: .66rem;
  letter-spacing: .02em;
}
.pedido-adesao-table tbody td { padding-left: .45rem; padding-right: .45rem; }
.pedido-adesao-table .qtd-adesao { min-width: 82px; }
.pedido-adesao-table th:nth-child(n+5),
.pedido-adesao-table td:nth-child(n+5) { text-align: center; }
.pedido-adesao-table th:nth-child(n+11),
.pedido-adesao-table td:nth-child(n+11) { text-align: right; }

/* Empenho / Ordem de Serviço ou Compra */
.ordem-etapas {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}
.ordem-etapa {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 145px;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem;
}
.ordem-etapa span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--border); color: var(--text); }
.ordem-etapa.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.ordem-etapa.active span { background: var(--primary); color: #fff; }
.ordem-dotacoes-cards { display: grid; gap: .75rem; }
.ordem-dotacao-card { display: grid; grid-template-columns: 28px 1fr; gap: .65rem; align-items: start; border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; background: var(--surface); cursor: pointer; }
.ordem-dotacao-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent); }
.ordem-dotacao-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: .6rem 1rem; }
.ordem-dotacao-grid > span { font-size: .78rem; overflow-wrap: anywhere; }
.ordem-dotacao-grid small { display: block; color: var(--muted); font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.ordem-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
}
.ordem-section-header .small { color: var(--muted); }
.ordem-itens-table { min-width: 1050px; }
.ordem-itens-table .qtd-item-ordem { min-width: 105px; }
.ordem-dotacoes-table { min-width: 760px; }
.ordem-dotacoes-table .valor-dotacao-ordem { min-width: 145px; margin-left: auto; }
.ordem-lista-table { min-width: 1380px; font-size: .8rem; }
.ordem-dotacoes-resumo {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ordem-resumo {
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
}
.ordem-resumo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: .75rem;
}
.ordem-resumo-grid > div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: .8rem;
}
.ordem-resumo-grid span { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.ordem-resumo-grid strong { display: block; margin-top: .25rem; font-size: 1rem; }
.ordem-status { color: #fff; background: #64748b; white-space: nowrap; }
.ordem-status-ordem-de-serviço-compra { background: #2563eb; }
.ordem-status-empenhado { background: #d97706; }
.ordem-status-liquidado { background: #0891b2; }
.ordem-status-pago { background: #15803d; }
.ordem-status-cancelado { background: #b91c1c; }
@media (max-width: 992px) {
  .ordem-etapas { grid-template-columns: repeat(5, 150px); }
  .ordem-dotacao-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .ordem-resumo-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}
@media (max-width: 576px) {
  .ordem-dotacao-grid { grid-template-columns: 1fr; }
  .ordem-resumo-grid { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .ordem-section-header { align-items: flex-start; }
}

/* ============================================================
   PRINT — corporate report output
   ============================================================ */
@media print {
  :root { --topbar-h: 0px; }
  @page { size: A4 landscape; margin: 10mm 8mm; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt;
    text-transform: uppercase;
  }
  .navbar, .navbar-main, .app-sidebar, .app-topbar, .sidebar-backdrop, .no-print, .toast-area { display: none !important; }
  .app-main { margin-left: 0 !important; display: block !important; }
  .app-content, main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .app-content > .d-flex:first-child,
  .app-content > h2:first-child,
  .app-content > h3:first-child { border: 0 !important; box-shadow: none !important; padding: 0 0 8px !important; background: transparent !important; }

  .print-card, .app-card, .card {
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
  .card-body { padding: 0 !important; }

  /* Report header repeats on each printed page when used inside a table */
  .report-header {
    border-bottom: 1.5pt solid #000 !important;
    margin-bottom: 8pt !important;
    padding-bottom: 6pt !important;
  }
  .brand-report { background: #000 !important; color: #fff !important; }
  .filtros-report {
    background: #f4f4f4 !important;
    border: 1px solid #999 !important;
    border-left: 3px solid #000 !important;
  }
  .ata-report-title {
    background: #eee !important;
    border-left: 3px solid #000 !important;
    color: #000 !important;
  }
  .lote-report-title { background: #000 !important; color: #fff !important; }

  .table-responsive { overflow: visible !important; border: 0 !important; border-radius: 0 !important; }
  .table th { position: static !important; }

  .report-table, .table {
    width: 100% !important;
    font-size: 8.5pt !important;
    border-collapse: collapse !important;
  }
  .report-table thead { display: table-header-group; }   /* repeat header per page */
  .report-table tfoot { display: table-footer-group; }
  .report-table thead th {
    background: #e9e9e9 !important;
    color: #000 !important;
    border: 0.5pt solid #555 !important;
    font-weight: 700 !important;
    padding: 4pt 5pt !important;
  }
  .report-table tbody td {
    border: 0.5pt solid #888 !important;
    padding: 3pt 5pt !important;
    color: #000 !important;
  }
  .report-table tbody tr:nth-child(even) td { background: #f7f7f7 !important; }
  .report-table tfoot td, .report-table .total-row td {
    background: #e0e0e0 !important;
    border-top: 1pt solid #000 !important;
    font-weight: 700 !important;
  }

  .report-section { page-break-inside: avoid; margin-bottom: 10pt; }

  /* Compact variant */
  .report-compact .card-body { padding: 0 !important; }
  .report-compact .report-header { margin-bottom: 5pt !important; padding-bottom: 4pt !important; }
  .report-compact .ata-report-title { padding: 4pt 6pt !important; margin-bottom: 4pt !important; }
  .report-compact .lote-report-title { padding: 3pt 5pt !important; }
  .report-compact .report-table { font-size: 8pt !important; }
  .report-compact .report-table th,
  .report-compact .report-table td { padding: 2.5pt 3pt !important; }
  .report-compact .fs-5 { font-size: 11pt !important; }

  a { color: #000 !important; text-decoration: none !important; }
  .badge { border: 0.5pt solid #555 !important; color: #000 !important; background: #eee !important; }
}

/* ============================================================
   V52 — LAYOUT GLOBAL MODERNO SEM BARRA SUPERIOR
   O cabecalho de cada pagina assume o topo; conta do usuario vai
   para o rodape do menu lateral.
   ============================================================ */
:root {
  --primary: #1746a2;
  --primary-dark: #123778;
  --primary-soft: #eaf1ff;
  --accent: #2f6fed;
  --accent-soft: #e8f0ff;
  --sidebar: #0b1730;
  --sidebar-2: #071226;
  --sidebar-hover: #14284b;
  --sidebar-active-bar: #6ea2ff;
  --bg: #f3f6fb;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

body {
  background:
    radial-gradient(circle at 100% 0, rgba(47,111,237,.06), transparent 26rem),
    var(--bg);
}

.app-sidebar {
  background: linear-gradient(180deg, #0b1730 0%, #0d1b35 52%, #081426 100%);
  box-shadow: 8px 0 28px rgba(15, 23, 42, .08);
}
.sidebar-brand {
  min-height: 68px;
  padding: 14px 14px;
  border-bottom-color: rgba(255,255,255,.08);
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f6fed, #1d4ed8);
  box-shadow: 0 8px 18px rgba(37,99,235,.24);
}
.brand-text strong { font-size: .80rem; }
.brand-text span { color: #8fa3c7; }
.sidebar-scroll { padding-bottom: 10px; }
.sidebar-link {
  min-height: 38px;
  border-radius: 9px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.sidebar-link:hover { transform: translateX(1px); }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(47,111,237,.23), rgba(47,111,237,.08));
}
.sidebar-link.active::before { width: 4px; }

/* Perfil do usuario no rodape da sidebar */
.sidebar-user-footer {
  flex: 0 0 auto;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(3, 10, 24, .20);
}
.sidebar-user-button {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  color: #fff;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.sidebar-user-button:hover,
.sidebar-user-button:focus {
  color: #fff;
  background: rgba(255,255,255,.10);
  border-color: rgba(110,162,255,.35);
  outline: 0;
}
.sidebar-user-button::after { display: none; }
.sidebar-user-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2f6fed, #1d4ed8);
  box-shadow: 0 5px 14px rgba(37,99,235,.24);
}
.sidebar-user-meta {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.12;
}
.sidebar-user-meta b,
.sidebar-user-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-meta b { color: #fff; font-size: .69rem; font-weight: 800; }
.sidebar-user-meta small { margin-top: 3px; color: #91a4c5; font-size: .57rem; font-weight: 700; }
.sidebar-user-more { color: #91a4c5; font-size: .9rem; }
.sidebar-user-menu {
  min-width: 245px;
  margin-left: 4px !important;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sidebar-user-menu-head strong,
.sidebar-user-menu-head small { display: block; }
.sidebar-user-menu-head strong { color: var(--ink); font-size: .75rem; }
.sidebar-user-menu-head small { margin-top: 2px; color: var(--muted); font-size: .64rem; }
.sidebar-user-menu .dropdown-item { border-radius: 8px; font-weight: 700; font-size: .72rem; }

/* A barra superior antiga deixa de existir. */
.app-topbar { display: none !important; }
.app-main { min-height: 100vh; }
.app-content {
  padding-top: 16px;
  padding-bottom: 30px;
}

/* Botao de menu apenas em telas pequenas — nao recria uma barra superior. */
.mobile-nav-trigger {
  display: none;
  position: fixed;
  z-index: 1028;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #1746a2, #2f6fed);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(23,70,162,.28);
}
.mobile-nav-trigger i { font-size: 1.2rem; }

/* Cabecalho funcional de cada pagina: titulo + acoes. */
.app-content > .d-flex:first-child,
.app-content > h2:first-child,
.app-content > h3:first-child {
  position: relative;
  overflow: hidden;
  min-height: 68px;
  margin-bottom: 16px !important;
  padding: 16px 18px;
  background: linear-gradient(115deg, #123778 0%, #1746a2 58%, #2f6fed 100%);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(23,70,162,.16);
}
.app-content > .d-flex:first-child::after,
.app-content > h2:first-child::after,
.app-content > h3:first-child::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -72px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.app-content > .d-flex:first-child > *,
.app-content > h2:first-child,
.app-content > h3:first-child { position: relative; z-index: 1; }
.app-content > .d-flex:first-child h1,
.app-content > .d-flex:first-child h2,
.app-content > .d-flex:first-child h3,
.app-content > .d-flex:first-child h4,
.app-content > h2:first-child,
.app-content > h3:first-child {
  color: #fff !important;
  font-weight: 800;
  letter-spacing: -.015em;
}
.app-content > .d-flex:first-child .text-muted,
.app-content > .d-flex:first-child small,
.app-content > .d-flex:first-child p {
  color: rgba(255,255,255,.78) !important;
}
.app-content > .d-flex:first-child .btn-primary,
.app-content > .d-flex:first-child .btn-success {
  color: var(--primary-dark);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 5px 14px rgba(5,20,50,.14);
}
.app-content > .d-flex:first-child .btn-primary:hover,
.app-content > .d-flex:first-child .btn-success:hover {
  color: #fff;
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.5);
}
.app-content > .d-flex:first-child .btn-outline-primary,
.app-content > .d-flex:first-child .btn-outline-secondary,
.app-content > .d-flex:first-child .btn-outline-dark,
.app-content > .d-flex:first-child .btn-light {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.38);
}
.app-content > .d-flex:first-child .btn-outline-primary:hover,
.app-content > .d-flex:first-child .btn-outline-secondary:hover,
.app-content > .d-flex:first-child .btn-outline-dark:hover,
.app-content > .d-flex:first-child .btn-light:hover {
  color: var(--primary-dark);
  background: #fff;
  border-color: #fff;
}

/* Componentes mais modernos e leves */
.app-card, .card {
  border-color: #dfe7f2 !important;
  border-radius: 13px !important;
  box-shadow: 0 4px 16px rgba(15,23,42,.045);
}
.card:hover { border-color: #d3deec !important; }
.btn {
  border-radius: 9px;
  font-weight: 700;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { box-shadow: 0 5px 13px rgba(23,70,162,.15); }
.form-control, .form-select {
  border-radius: 9px;
  border-color: #ccd7e6;
}
.form-control:focus, .form-select:focus {
  border-color: #6d98ee;
  box-shadow: 0 0 0 .2rem rgba(47,111,237,.10);
}
.table thead th {
  background: #eef3fa;
  color: #536783;
  border-bottom-color: #dce5f0;
}
.table tbody tr:hover > * { background-color: #f8fbff; }
.badge { border-radius: 7px; letter-spacing: .015em; }

/* Compact mode: perfil vira apenas avatar. */
body.sidebar-compact .sidebar-user-footer { padding: 10px 8px 12px; }
body.sidebar-compact .sidebar-user-button { justify-content: center; padding: 7px; }
body.sidebar-compact .sidebar-user-meta,
body.sidebar-compact .sidebar-user-more { display: none !important; }
body.sidebar-compact .sidebar-user-avatar { flex-basis: 36px; width: 36px; height: 36px; }

@media (max-width: 991.98px) {
  .mobile-nav-trigger { display: grid; }
  .app-content { padding-top: 66px; }
  body.sidebar-open .mobile-nav-trigger { opacity: 0; pointer-events: none; }
  body.sidebar-compact .sidebar-user-meta,
  body.sidebar-compact .sidebar-user-more { display: block !important; }
  body.sidebar-compact .sidebar-user-button { justify-content: flex-start; padding: 8px 9px; }
}

@media (max-width: 767.98px) {
  .app-content { padding: 64px 10px 22px; }
  .app-content > .d-flex:first-child,
  .app-content > h2:first-child,
  .app-content > h3:first-child {
    min-height: 0;
    padding: 14px 15px;
    border-radius: 12px;
  }
  .app-content > .d-flex:first-child {
    align-items: flex-start !important;
    flex-direction: column;
  }
  .app-content > .d-flex:first-child > .d-flex,
  .app-content > .d-flex:first-child > a,
  .app-content > .d-flex:first-child > button { align-self: stretch; }
}

@media print {
  .mobile-nav-trigger, .sidebar-user-footer { display: none !important; }
}

/* ============================================================
   V53 — PADRAO VISUAL GLOBAL + CND EM MODAL
   Cabecalho consistente em todas as telas e paleta moderna.
   ============================================================ */
:root {
  --primary: #0b5cab;
  --primary-dark: #083f78;
  --primary-soft: #eaf4ff;
  --accent: #0f8fa7;
  --accent-soft: #e8f8fb;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #c46a0a;
  --warning-soft: #fff8e8;
  --danger: #c5333f;
  --danger-soft: #fff0f1;
  --info: #0f7c91;
  --info-soft: #eaf8fb;
  --bg: #f4f7fb;
  --surface-soft: #f8fafc;
  --border: #dbe5ef;
  --border-strong: #c8d5e2;
  --sidebar: #0b1e33;
  --sidebar-2: #071725;
  --sidebar-hover: #133451;
  --sidebar-active-bar: #38bdf8;
}

body {
  background:
    radial-gradient(circle at 94% 2%, rgba(15,143,167,.07), transparent 26rem),
    linear-gradient(180deg, #f7f9fc 0%, #f3f7fb 100%);
}

.app-sidebar {
  background: linear-gradient(180deg, #0b1e33 0%, #0a263f 55%, #071725 100%);
  box-shadow: 10px 0 30px rgba(2, 24, 45, .08);
}
.brand-mark,
.sidebar-user-avatar {
  background: linear-gradient(135deg, #0f8fa7 0%, #0b5cab 100%);
  box-shadow: 0 7px 18px rgba(15,143,167,.22);
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(15,143,167,.24), rgba(11,92,171,.08));
}
.sidebar-link:hover { background: rgba(255,255,255,.06); }

/* O JS aplica esta classe ao primeiro cabecalho real, mesmo quando ha <style> antes dele. */
.app-page-header {
  position: relative !important;
  overflow: hidden !important;
  min-height: 66px;
  margin-bottom: 16px !important;
  padding: 14px 18px !important;
  background: linear-gradient(112deg, #083f78 0%, #0b5cab 52%, #0f8fa7 100%) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 24px rgba(8,63,120,.14) !important;
  color: #fff !important;
}
.app-page-header::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -76px;
  width: 196px;
  height: 196px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.app-page-header > * { position: relative; z-index: 1; }
.app-page-header h1,
.app-page-header h2,
.app-page-header h3,
.app-page-header h4,
.app-page-header .h1,
.app-page-header .h2,
.app-page-header .h3,
.app-page-header .h4 {
  color: #fff !important;
  margin-bottom: 0 !important;
  font-weight: 800 !important;
  letter-spacing: -.018em;
}
.app-page-header .text-primary,
.app-page-header .text-muted,
.app-page-header small,
.app-page-header p { color: rgba(255,255,255,.82) !important; }
.app-page-header .btn-primary,
.app-page-header .btn-success {
  color: #083f78 !important;
  background: #fff !important;
  border-color: #fff !important;
  box-shadow: 0 5px 14px rgba(1,27,52,.15);
}
.app-page-header .btn-primary:hover,
.app-page-header .btn-success:hover {
  color: #fff !important;
  background: rgba(255,255,255,.15) !important;
  border-color: rgba(255,255,255,.55) !important;
}
.app-page-header .btn-outline-primary,
.app-page-header .btn-outline-secondary,
.app-page-header .btn-outline-dark,
.app-page-header .btn-outline-info,
.app-page-header .btn-light {
  color: #fff !important;
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.40) !important;
}
.app-page-header .btn-outline-primary:hover,
.app-page-header .btn-outline-secondary:hover,
.app-page-header .btn-outline-dark:hover,
.app-page-header .btn-outline-info:hover,
.app-page-header .btn-light:hover {
  color: #083f78 !important;
  background: #fff !important;
  border-color: #fff !important;
}

/* Cabecalho gerado para formularios que comecam diretamente por um card. */
.app-page-header-generated { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.app-page-title-source { display: none !important; }

/* Componentes mais leves e consistentes */
.app-card, .card {
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 14px rgba(17,39,62,.045) !important;
}
.card-header {
  border-bottom-color: var(--border) !important;
  background: linear-gradient(180deg,#fff,#fbfdff) !important;
}
.table thead th {
  background: #eef4f9 !important;
  color: #4f657b !important;
  border-bottom: 1px solid #d7e3ed !important;
  font-weight: 800;
  letter-spacing: .035em;
}
.table tbody tr:hover > * { background: #f7fbfd !important; }
.table > :not(caption) > * > * { border-bottom-color: #e5edf4; }

.btn { border-radius: 10px; }
.btn-primary {
  background: linear-gradient(135deg,#0b5cab,#0f8fa7);
  border-color: #0b5cab;
  box-shadow: 0 5px 12px rgba(11,92,171,.14);
}
.btn-primary:hover { background: linear-gradient(135deg,#084b8f,#0c7b90); border-color:#084b8f; }
.btn-outline-primary { color: #0b5cab; border-color: #9dbbda; }
.btn-outline-primary:hover { background:#0b5cab; border-color:#0b5cab; }
.btn-outline-success { color:#15803d; border-color:#9dd4ae; }
.btn-outline-danger { color:#c5333f; border-color:#efb0b5; }
.form-control, .form-select { border-color:#cbd8e4; background:#fff; }
.form-control:focus, .form-select:focus { border-color:#56a5b7; box-shadow:0 0 0 .2rem rgba(15,143,167,.11) !important; }

.badge.text-bg-primary { background:#0b5cab !important; }
.badge.text-bg-info { background:#0f7c91 !important; }
.badge.text-bg-success { background:#15803d !important; }
.badge.text-bg-warning { background:#c46a0a !important; color:#fff !important; }
.badge.text-bg-danger { background:#c5333f !important; }
.badge.text-bg-secondary { background:#6b7c8d !important; }

/* CND: expansao limpa, sem titulo redundante. */
.cnd-versoes-box { padding: 8px 12px 10px 34px !important; background: #f6f9fc !important; }
.cnd-versoes-table { border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(17,39,62,.035); }
.cnd-versoes-table thead th { background:#edf4f8 !important; }
.btn-ver-anexos[aria-expanded="true"] { background:#eaf4ff !important; border-color:#0b5cab !important; color:#0b5cab !important; }

/* Modal de documento: maior area util e acoes claras. */
#modalVisualizarCnd .modal-content { border:0; border-radius:16px; overflow:hidden; box-shadow:0 24px 60px rgba(2,24,45,.23); }
#modalVisualizarCnd .modal-header { background:linear-gradient(112deg,#083f78,#0b5cab 55%,#0f8fa7); color:#fff; border:0; }
#modalVisualizarCnd .modal-header .text-muted { color:rgba(255,255,255,.76) !important; }
#modalVisualizarCnd .modal-header .btn-close { filter:invert(1) grayscale(1) brightness(2); }
#modalVisualizarCnd .modal-footer { border-top:1px solid var(--border); background:#f8fbfd; }
#cndViewer { min-height: 560px; background:#eef3f7 !important; }

@media (max-width: 767.98px) {
  .app-page-header { min-height:0; padding:13px 14px !important; border-radius:13px !important; }
  .app-page-header.d-flex { align-items:flex-start !important; flex-direction:column; }
  .app-page-header > .d-flex,
  .app-page-header > a,
  .app-page-header > button { align-self:stretch; }
  .cnd-versoes-box { padding-left:10px !important; padding-right:10px !important; }
  #cndViewer { min-height: 430px; }
}

@media print {
  .app-page-header { color:#000 !important; background:transparent !important; box-shadow:none !important; border:0 !important; padding:0 0 8px !important; min-height:0; }
  .app-page-header h1,.app-page-header h2,.app-page-header h3,.app-page-header h4 { color:#000 !important; }
}

/* ============================================================
   V55 — Identidade visual oficial IG Contracts Manager
   ============================================================ */
.login-card {
  width: min(440px, 94vw);
  padding-top: 26px;
}
.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-brand-logo {
  display: block;
  width: min(100%, 345px);
  height: auto;
  object-fit: contain;
}

.sidebar-brand {
  min-height: 86px;
  padding: 10px 11px;
}
.sidebar-brand-logo-link {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
}
.sidebar-brand-logo {
  display: block;
  max-width: 100%;
  object-fit: contain;
}
.sidebar-brand-logo-full {
  width: 100%;
  height: auto;
  max-height: 68px;
}
.sidebar-brand-logo-icon {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 11px;
}
body.sidebar-compact .sidebar-brand-logo-full { display: none; }
body.sidebar-compact .sidebar-brand-logo-icon { display: block; }
body.sidebar-compact .sidebar-brand-logo-link { justify-content: center; }
body.sidebar-compact .sidebar-brand { min-height: 66px; padding: 10px; }

@media (max-width: 991.98px) {
  .sidebar-brand-logo-full { max-height: 64px; }
  body.sidebar-compact .sidebar-brand-logo-full { display: block; }
  body.sidebar-compact .sidebar-brand-logo-icon { display: none; }
  body.sidebar-compact .sidebar-brand-logo-link { justify-content: flex-start; }
}
