*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
  overflow-x: hidden;
}

/* —— Obsidian Ledger shell (referência: telas code - tela *.html) —— */
body.obs-body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1326;
  color: #dae2fd;
}

.obs-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
  background: #0b1326;
}

.obs-sidebar {
  flex: 0 0 260px;
  width: 260px;
  max-width: 100%;
  background: linear-gradient(180deg, #131b2e 0%, #0f1628 100%);
  border-right: 1px solid rgba(78, 222, 163, 0.12);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0.75rem 1rem;
  z-index: 20;
}

.obs-brand {
  padding: 0 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(60, 74, 66, 0.15);
  margin-bottom: 1rem;
}

.obs-brand-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #4edea3;
  line-height: 1.2;
  display: block;
}

.obs-brand-tag {
  margin: 0.25rem 0 0;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(187, 202, 191, 0.75);
}

.obs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-height: 0;
}

.obs-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  color: #bbcabf;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.obs-nav a:hover {
  background: rgba(23, 31, 51, 0.85);
  color: #f8fafc;
}

.obs-nav a.is-active {
  background: rgba(23, 31, 51, 0.95);
  color: #4edea3;
  border-left-color: #4edea3;
}

.obs-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.9;
}

.obs-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(60, 74, 66, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.obs-sidebar-footer a,
.obs-sidebar-footer button {
  width: 100%;
  margin: 0;
  text-align: left;
  justify-content: flex-start;
  font-size: 0.8125rem;
}

.obs-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(78, 222, 163, 0.08), transparent 55%),
    #0b1326;
}

.obs-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(78, 222, 163, 0.1);
  background: rgba(11, 19, 38, 0.75);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.obs-topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.obs-topbar .obs-topbar-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: rgba(187, 202, 191, 0.75);
}

.obs-page-title-block {
  min-width: 0;
}

.obs-body .app-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .obs-shell {
    flex-direction: column;
  }
  .obs-sidebar {
    flex: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(78, 222, 163, 0.1);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.75rem 1rem;
  }
  .obs-brand {
    border: none;
    margin: 0;
    padding: 0 0.5rem 0 0;
    flex: 1 1 auto;
    min-width: 140px;
  }
  .obs-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1 1 100%;
    gap: 0.35rem;
    margin-top: 0.5rem;
  }
  .obs-nav a {
    padding: 0.45rem 0.65rem;
    font-size: 0.8125rem;
  }
  .obs-sidebar-footer {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 0;
    padding-top: 0.5rem;
    border: none;
    width: 100%;
    justify-content: flex-end;
  }
  .obs-sidebar-footer a,
  .obs-sidebar-footer button {
    width: auto;
  }
}

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

.app-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  color: #f9fafb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .app-header {
    padding: 1rem 2rem;
  }
}

.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.env-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.3);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: #f9fafb;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.header-btn.secondary {
  background: rgba(15, 23, 42, 0.4);
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.month-select {
  width: auto;
  min-width: 160px;
  margin: 0;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #f9fafb;
  border-radius: 0.5rem;
}
/* Opções do select de data legíveis (alto contraste) */
.month-select option,
select.month-select option {
  background: #ffffff !important;
  color: #1a1a1a !important;
}
/* Fallback: select no dashboard com fundo claro ao abrir (Chrome) */
.dashboard-page .month-select {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}
.dashboard-page .month-select option {
  background: #fff !important;
  color: #111 !important;
}

.dashboard-header .dashboard-title { margin: 0; }
.dashboard-header .dashboard-title .subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.config-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
  flex: 1;
  min-height: 0;
  width: 100%;
  align-content: start;
}

.config-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.config-col-tabs {
  min-width: 0;
}

.config-content {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Tablet: 2 colunas */
@media (min-width: 640px) {
  main.config-main {
    grid-template-columns: repeat(2, 1fr);
  }
  main.config-main .config-col-tabs {
    grid-column: 1 / -1;
  }
}

/* Desktop: 3 colunas lado a lado */
@media (min-width: 900px) {
  main.config-main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
  }
  main.config-main .config-col-tabs {
    grid-column: auto;
  }
  main.config-main .config-content {
    min-height: 400px;
  }
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  flex: 1;
}
@media (min-width: 768px) {
  .app-main {
    display: grid;
    grid-template-columns: minmax(260px, 300px) 1fr;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
  }
}

.card {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.8);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

select,
input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

select:focus,
input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

button {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  margin-top: 0.25rem;
  background: linear-gradient(135deg, #1d4ed8, #22c55e);
  color: #f9fafb;
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease;
}

button:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.6);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.7);
}

.status-box {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  min-height: 1.2rem;
  color: #9ca3af;
}

.status-ok {
  color: #4ade80;
}

.status-error {
  color: #f97373;
}

.dashboard {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  width: 100%;
  max-width: 100%;
}

.tab-button {
  border-radius: 0.5rem;
  padding: 0.35rem 0.9rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0;
}

.tab-button.active {
  background: linear-gradient(135deg, #1d4ed8, #22c55e);
  color: #f9fafb;
}

.tab-panel {
  margin-top: 1rem;
  min-width: 0;
}
.tab-panel#tab-depara {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.depara-panel-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.depara-actions {
  margin-bottom: 0.75rem;
}
.depara-list-wrap {
  margin-bottom: 1rem;
  overflow: visible;
}
.depara-list-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}
.depara-list-header .depara-col-label { flex: 1; min-width: 0; }
.depara-list-header .depara-col-select { min-width: 180px; flex-shrink: 0; }
.depara-ver-link {
  display: none;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  color: #38bdf8;
  cursor: pointer;
  text-decoration: underline;
}
.depara-ver-link.visible { display: inline; }

.sync-status-card {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}
.sync-status-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #e5e7eb;
}
.sync-status-line {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: #cbd5e1;
}
.sync-status-line.sync-status-period { margin-bottom: 0; }
.sync-status-line.sync-status-interval {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
}
.sync-status-label {
  color: #94a3b8;
  margin-right: 0.35rem;
}

.sync-endpoints-detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}
.sync-endpoints-detail.hidden { display: none; }
.sync-endpoints-detail h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}
.sync-endpoints-detail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}
.sync-endpoints-detail li {
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sync-endpoints-detail li .endpoint-ok { color: #4ade80; }
.sync-endpoints-detail li .endpoint-fail { color: #f87171; }
.sync-endpoints-detail li .endpoint-name { color: #cbd5e1; min-width: 10rem; }

.help-text {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.depara-section {
  margin-top: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.depara-section:first-of-type { margin-top: 1.5rem; }
.depara-section h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.depara-list-wrap {
  margin-bottom: 1.25rem;
}
#deparaCategoriesList,
#deparaCostCentersList,
#deparaProductGroupsList {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.depara-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.375rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
}
.depara-row span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  color: #e2e8f0;
}
.depara-row select, .depara-row input[type="text"] {
  min-width: 200px;
  max-width: 240px;
  padding: 0.5rem 0.5rem;
  min-height: 2.25rem;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.9rem;
}
.depara-row select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

.hidden {
  display: none;
}

.config-gate-msg {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.5;
}

.charts-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.15), transparent),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.15), transparent);
  border-radius: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.chart-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
  color: #e5e7eb;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.admin-card .metric-number {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0.25rem 0 0;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.secondary-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.secondary-btn:hover {
  filter: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.6);
}

.simple-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.simple-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.simple-table thead {
  background: rgba(15, 23, 42, 0.9);
}

.simple-table th,
.simple-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

.simple-table th:first-child,
.simple-table td:first-child { width: 3rem; }

.simple-table th {
  text-align: left;
  color: #9ca3af;
  font-weight: 500;
}

.simple-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.8);
}

.simple-table .cell-actions {
  overflow: visible;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 0.5rem;
}

canvas {
  max-height: 260px;
}

/* Dashboard financeiro (layout SaaS) */
.dashboard-page .app-container {
  min-height: 100vh;
  height: auto;
  background: linear-gradient(165deg, #0b1220 0%, #0f172a 40%, #111c33 100%);
}
.dashboard-page .app-header {
  padding: 0.75rem 1.25rem;
  background: linear-gradient(120deg, #1e3a5f 0%, #0c4a6e 45%, #0369a1 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.dashboard-page main.dashboard-radar {
  flex: none;
  overflow: visible;
  padding: 0;
}
.dash-topbar .dashboard-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dash-shell {
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
}
.dash-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.dash-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dash-block-head {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.dash-block-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}
.dash-block-desc {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.45;
}
.dash-grid {
  display: grid;
  gap: 1rem;
  align-items: stretch;
}
.dash-grid--sales {
  grid-template-columns: repeat(3, 1fr);
}
.dash-grid--ded {
  grid-template-columns: minmax(200px, 280px) 1fr;
}
.dash-grid--cost {
  grid-template-columns: minmax(200px, 260px) 1fr;
}
.dash-grid--exp {
  grid-template-columns: minmax(200px, 260px) 1fr;
}
.dash-grid--cash {
  grid-template-columns: 1fr minmax(220px, 280px);
  grid-template-rows: auto auto;
  align-items: stretch;
}
@media (min-width: 769px) {
  .dash-cash-chart {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .dash-cash-saldo {
    grid-column: 2;
    grid-row: 1;
  }
  .dash-cash-debt {
    grid-column: 2;
    grid-row: 2;
  }
}
.dash-span-2 {
  grid-column: span 2;
}
@media (max-width: 1024px) {
  .dash-grid--sales {
    grid-template-columns: 1fr 1fr;
  }
  .dash-grid--sales .dash-card--hero {
    grid-column: 1 / -1;
  }
  .dash-grid--sales .dash-card--chart.dash-span-2 {
    grid-column: 1 / -1;
  }
}
@media (max-width: 768px) {
  .dash-grid--sales,
  .dash-grid--ded,
  .dash-grid--cost,
  .dash-grid--exp,
  .dash-grid--cash {
    grid-template-columns: 1fr;
  }
  .dash-span-2 {
    grid-column: 1;
  }
  .dash-cash-chart,
  .dash-cash-saldo,
  .dash-cash-debt {
    grid-column: 1;
    grid-row: auto;
  }
}
.dash-card {
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.dash-card-title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash-card--hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.12) 0%, rgba(30, 41, 59, 0.9) 55%);
  border-color: rgba(56, 189, 248, 0.25);
}
.dash-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7dd3fc;
  margin-bottom: 0.5rem;
}
.dash-hero-value {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.dash-hero-note {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}
.dash-card--stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}
.dash-stat-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}
.dash-card--stat-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}
.dash-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.dash-mini-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.dash-mini-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
}
.dash-pos {
  color: #4ade80 !important;
}
.dash-neg {
  color: #fb7185 !important;
}
.dash-stat-value--accent.dash-pos {
  color: #4ade80 !important;
}
.dash-stat-value--accent.dash-neg {
  color: #fb7185 !important;
}
.dash-card--chart .chart-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
}
.chart-wrap--tall {
  min-height: 260px;
}
.chart-wrap--medium {
  min-height: 220px;
}
.chart-wrap--pie {
  min-height: 280px;
  max-width: 420px;
  margin: 0 auto;
}
.dashboard-page .chart-wrap canvas {
  max-height: none;
}
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}
@media (max-width: 1100px) {
  .dash-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 520px) {
  .dash-kpi-row {
    grid-template-columns: 1fr 1fr;
  }
}
.dash-card--kpi {
  padding: 1rem;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-kpi-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  font-weight: 600;
}
.dash-kpi-value {
  margin: 0.4rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}
.dash-kpi-value.dash-pos {
  color: #4ade80;
}
.dash-kpi-value.dash-neg {
  color: #fb7185;
}
.dash-kpi-pct {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
}
.dash-kpi-pct.dash-pos {
  color: #4ade80;
}
.dash-kpi-pct.dash-neg {
  color: #fb7185;
}
.dash-kpi-sub {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: #64748b;
}
.bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bar-list--spaced {
  gap: 0.65rem;
}
.bar-row {
  display: grid;
  grid-template-columns: 1fr auto minmax(72px, 1.2fr);
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8125rem;
}
.bar-label {
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-value {
  color: #f1f5f9;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bar-track {
  height: 8px;
  background: rgba(15, 23, 42, 0.65);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #34d399);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.value-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}
.value-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.value-list li strong {
  margin-left: auto;
  color: #e2e8f0;
}
.value-list.with-check li input[type="checkbox"] {
  margin-right: 0.25rem;
}
.table-scroll {
  overflow-x: auto;
}
.radar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.radar-table th,
.radar-table td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.radar-table th {
  color: #94a3b8;
  font-weight: 500;
}
.radar-table tbody tr:hover {
  background: rgba(51, 65, 85, 0.4);
}
.no-client {
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
}
.no-client a { color: #38bdf8; }

@media (max-width: 639px) {
  .sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .app-main:not(.config-main) {
    grid-template-columns: 1fr;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .dashboard {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .dashboard {
    column-count: 1;
  }
}

.card-expand-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
}
.card-expand-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}
.card-expand-dialog {
  position: relative;
  z-index: 2;
  width: min(1020px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-expand-close {
  width: auto;
  margin: 0 0 0.5rem auto;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}
.card-expand-dialog h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #e2e8f0;
}
.card-expand-content {
  overflow: auto;
  padding-right: 0.4rem;
}
.card-expand-content .radar-card {
  margin-bottom: 0;
}

/* App header dentro do shell Obsidian (config / telas com obs-topbar) */
.obs-body .app-header.obs-topbar,
.obs-body header.obs-topbar {
  background: rgba(11, 19, 38, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(78, 222, 163, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  color: #dae2fd;
}

.obs-body .hub-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  width: 100%;
  min-height: 0;
}

/* Dashboard com sidebar Obsidian */
.dashboard-page.obs-body .app-container {
  background: transparent;
}

.dashboard-page.obs-body .app-header.dashboard-header.dash-topbar {
  background: rgba(11, 19, 38, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(78, 222, 163, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.dashboard-page.obs-body .dashboard-title h1 {
  color: #f8fafc;
}

.dashboard-page.obs-body .dashboard-title .subtitle {
  color: rgba(187, 202, 191, 0.85);
}

/* Validação: tabela e KPIs alinhados ao tema */
.obs-body .validation-table th,
.obs-body .validation-table td {
  border-bottom-color: rgba(78, 222, 163, 0.08);
}

.obs-body .validation-kpis .kpi {
  background: rgba(23, 31, 51, 0.65);
  border: 1px solid rgba(78, 222, 163, 0.12);
}

.obs-body .validation-kpis .kpi strong {
  color: #4edea3;
}

/* Validação: duas colunas (aside + conteúdo), sem herdar 3 colunas de .config-main */
main.config-main.val-main {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  main.config-main.val-main {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }
}
@media (min-width: 900px) {
  main.config-main.val-main {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }
}

.val-content {
  min-width: 0;
}

.obs-topbar .header-actions #clientSelect {
  width: auto;
  min-width: 180px;
  max-width: 300px;
  margin-bottom: 0;
}

.dashboard-page.obs-body .obs-main-wrap {
  background: linear-gradient(165deg, #0b1220 0%, #0f172a 40%, #111c33 100%);
}

