/* Camada final de organização visual do Essência Chat. */
:root {
  --sidebar: 248px;
  --overview-navy: #153e70;
  --overview-cyan: #00bfe6;
  --overview-bg: #f4f7fa;
  --overview-line: #e2e9ef;
  --overview-shadow: 0 8px 28px rgba(25, 53, 82, .07);
}

body { background: var(--overview-bg); }
.main-area { min-width: 0; background: var(--overview-bg); }

/* Navegação com hierarquia mais clara e menos ruído. */
.sidebar { padding: 18px 14px 14px; }
.brand { padding: 0 8px 16px; }
.brand-mark { width: 40px; height: 40px; font-size: 19px; }
.brand strong { font-size: 14px; letter-spacing: .055em; }
.brand span { margin-top: 2px; font-size: 11px; }
.workspace-switcher { min-height: 54px; margin: 0 0 9px; padding: 9px 10px; }
.workspace-avatar { width: 32px; height: 32px; }
.workspace-switcher strong { font-size: 13px; }
.workspace-switcher span { font-size: 10px; }
.main-nav { gap: 2px; padding-right: 2px; }
.nav-section-label { padding: 11px 10px 4px; font-size: 9px; letter-spacing: .13em; }
.nav-section-label:first-child { padding-top: 2px; }
.nav-item { min-height: 40px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.nav-item > span { width: 22px; font-size: 17px; }
.nav-item b { min-width: 22px; height: 20px; font-size: 10px; }
.profile { border-top: 1px solid #20262b; padding-top: 12px; }
.logout-button { margin-top: 3px; }

/* Cabeçalho mais leve: título, contexto e uma ação principal. */
.topbar { min-height: 76px; padding: 12px 28px; }
.topbar h1 { font-size: 25px; }
.eyebrow { margin-top: 2px; font-size: 12px; }
.topbar-actions { gap: 9px; }
.topbar-actions > .icon-button:not(.mobile-menu) { display: none; }
.channel-health { height: 40px; padding: 0 13px; font-size: 12px; }
.topbar .primary-button { min-height: 40px; }
.demo-bar {
  min-height: 40px;
  padding: 6px 28px;
  border-bottom: 1px solid #dce8ee;
  background: #edf6f9;
  color: #527080;
  font-size: 11px;
}
.demo-bar label { gap: 7px; }
.demo-bar select { min-height: 28px; padding: 3px 28px 3px 8px; border-color: #cbdde6; background: #fff; font-size: 11px; }

/* Visão geral: orientada a decisões, sem gráficos decorativos. */
.overview-view { width: 100%; max-width: 1500px; margin: 0 auto; padding: 30px 32px 48px; }
.overview-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.overview-kicker { display: block; margin-bottom: 7px; color: #1782a0; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.overview-welcome h2 { margin: 0; color: #142a43; font-family: Inter, "DM Sans", sans-serif; font-size: clamp(24px, 2.5vw, 32px); letter-spacing: -.035em; }
.overview-welcome p { margin: 7px 0 0; color: #667789; font-size: 14px; }
.overview-main-action {
  min-width: 226px;
  min-height: 62px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 1px 11px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--overview-navy);
  color: #fff;
  text-align: left;
  box-shadow: 0 8px 20px rgba(21, 62, 112, .18);
  cursor: pointer;
}
.overview-main-action > span { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.11); color: #7feaff; font-size: 19px; }
.overview-main-action b { align-self: end; font-size: 14px; }
.overview-main-action small { align-self: start; color: #c2d2e4; font-size: 11px; }
.overview-main-action:hover { background: #11345f; transform: translateY(-1px); }

.overview-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.summary-card {
  min-width: 0;
  min-height: 118px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--overview-line);
  border-radius: 14px;
  background: #fff;
  color: #172b43;
  text-align: left;
  box-shadow: 0 2px 8px rgba(25, 53, 82, .035);
}
button.summary-card { width: 100%; font: inherit; cursor: pointer; }
.summary-card.attention { border-color: #f2d1a6; background: #fffaf3; }
.summary-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #fff0dc; color: #b85f00; font-size: 18px; font-weight: 800; }
.summary-icon.blue { background: #e8f7fb; color: #087c9a; }
.summary-icon.green { background: #eaf8f2; color: #0b8060; }
.summary-icon.violet { background: #f0ecff; color: #6550b8; }
.summary-card > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.summary-card small { color: #7b8997; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.summary-card strong { margin-top: 8px; color: #172b43; font-family: Inter, "DM Sans", sans-serif; font-size: 21px; line-height: 1.1; }
.summary-card em { margin-top: 6px; overflow: hidden; color: #6d7c8b; font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.summary-card > b { align-self: center; color: #af6a19; font-size: 18px; }
button.summary-card:hover { border-color: #e2b878; box-shadow: var(--overview-shadow); transform: translateY(-1px); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr); gap: 16px; margin-bottom: 16px; }
.overview-card { overflow: hidden; border: 1px solid var(--overview-line); border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(25, 53, 82, .035); }
.overview-card > header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid #ebf0f4; }
.overview-card header span { color: #7d8996; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.overview-card header h3 { margin: 4px 0 0; color: #172b43; font-family: Inter, "DM Sans", sans-serif; font-size: 17px; }
.overview-card header > small { color: #84909c; font-size: 10px; }

.priority-list { padding: 4px 20px 10px; }
.priority-item { width: 100%; min-height: 70px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border: 0; border-bottom: 1px solid #edf1f4; background: transparent; color: #172b43; text-align: left; cursor: pointer; }
.priority-item:last-child { border-bottom: 0; }
.priority-item:hover { padding-left: 8px; padding-right: 8px; border-radius: 9px; background: #f7fafc; }
.priority-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #fff1df; color: #b85f00; font-size: 16px; font-weight: 800; }
.priority-mark.chat { background: #e8f7fb; color: #087c9a; }
.priority-mark.budget { background: #eaf8f2; color: #0b8060; font-size: 11px; }
.priority-item > span:nth-child(2) { min-width: 0; }
.priority-item strong { display: block; font-size: 13px; }
.priority-item small { display: block; margin-top: 4px; overflow: hidden; color: #6d7c8b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.priority-item em { color: #8a96a1; font-size: 10px; font-style: normal; }
.priority-item > b { min-width: 68px; color: var(--overview-navy); font-size: 11px; text-align: right; }
.priority-item.critical > b { color: #a95700; }

.funnel-steps { display: grid; gap: 17px; padding: 20px; }
.funnel-steps > div > span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.funnel-steps b { color: #526477; font-size: 11px; font-weight: 600; }
.funnel-steps em { color: #172b43; font-size: 12px; font-style: normal; font-weight: 800; }
.funnel-steps i { height: 7px; display: block; overflow: hidden; border-radius: 999px; background: #edf2f5; }
.funnel-steps i::after { content: ""; width: var(--value); height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--overview-navy), var(--overview-cyan)); }
.funnel-card > footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid #ebf0f4; background: #f8fafc; color: #647487; font-size: 10px; }
.funnel-card footer b { color: #172b43; font-size: 13px; }
.funnel-card .positive { color: #087858; font-weight: 700; }

.units-card { margin-bottom: 16px; }
.unit-period { display: flex; align-items: center; gap: 9px; }
.unit-period > span { color: #7d8996; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.unit-period select { min-height: 36px; padding: 5px 32px 5px 10px; border: 1px solid #d6e1e9; border-radius: 9px; background: #fff; color: #25374c; font: inherit; font-size: 12px; font-weight: 650; }
.unit-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.unit-card { min-width: 0; min-height: 106px; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-content: center; gap: 4px 11px; padding: 16px 18px; border: 0; border-right: 1px solid #ebf0f4; background: #fff; color: #172b43; text-align: left; cursor: pointer; }
.unit-card:last-child { border-right: 0; }
.unit-card:hover { background: #f7fafc; }
.unit-card.active { background: #eef7fb; box-shadow: inset 0 -3px #00a9d1; }
.unit-pin { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #e9f5fa; color: #087c9a; font-size: 13px; font-weight: 850; }
.unit-card > span:nth-child(2) { min-width: 0; }
.unit-card small { display: block; color: #81909d; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.unit-card strong { display: block; margin-top: 3px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.unit-card em { display: block; margin-top: 5px; color: #6d7c8b; font-size: 10px; font-style: normal; }
.unit-card > b { grid-column: 2; color: #48657c; font-size: 10px; }
.unit-card.active > b { color: #087c9a; }

.quick-card > header { min-height: 66px; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); }
.quick-actions button { min-width: 0; min-height: 86px; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-content: center; gap: 2px 10px; padding: 15px 18px; border: 0; border-right: 1px solid #ebf0f4; background: #fff; color: #172b43; text-align: left; cursor: pointer; }
.quick-actions button:last-child { border-right: 0; }
.quick-actions button:hover { background: #f6fafc; }
.quick-actions button > span { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #edf6fa; color: #087c9a; font-size: 17px; }
.quick-actions b { align-self: end; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.quick-actions small { align-self: start; overflow: hidden; color: #7a8794; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1240px) {
  :root { --sidebar: 226px; }
  .overview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .unit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-card:nth-child(2) { border-right: 0; }
  .unit-card:nth-child(-n+2) { border-bottom: 1px solid #ebf0f4; }
}

@media (max-width: 1000px) {
  .sidebar { width: 272px; }
  .overview-view { padding: 24px 22px 40px; }
}

@media (max-width: 720px) {
  .topbar { min-height: 68px; padding: 9px 14px; }
  .topbar h1 { font-size: 21px; }
  .eyebrow { max-width: 54vw; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .channel-health { display: none; }
  .topbar .primary-button { min-height: 38px; padding: 0 11px; font-size: 12px; }
  .demo-bar { padding: 5px 14px; }
  .demo-bar > span:first-child { display: none; }
  .overview-view { padding: 20px 14px 34px; }
  .overview-welcome { align-items: stretch; flex-direction: column; }
  .overview-main-action { width: 100%; min-width: 0; }
  .overview-summary { grid-template-columns: 1fr; }
  .summary-card { min-height: 98px; }
  .overview-card > header { padding: 15px; }
  .overview-card header > small { display: none; }
  .unit-period > span { display: none; }
  .priority-list { padding-left: 15px; padding-right: 15px; }
  .priority-item { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .priority-item em { display: none; }
  .priority-item > b { min-width: auto; }
  .funnel-steps { padding: 17px 15px; }
  .funnel-card > footer { padding: 12px 15px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .quick-actions button { border-bottom: 1px solid #ebf0f4; }
  .quick-actions button:nth-child(2) { border-right: 0; }
  .quick-actions button:nth-child(n+3) { border-bottom: 0; }
}

@media (max-width: 430px) {
  .demo-bar #saveState { display: none; }
  .summary-card em { white-space: normal; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-actions button { border-right: 0; border-bottom: 1px solid #ebf0f4 !important; }
  .quick-actions button:last-child { border-bottom: 0 !important; }
  .unit-list { grid-template-columns: 1fr; }
  .unit-card { border-right: 0; border-bottom: 1px solid #ebf0f4; }
  .unit-card:nth-child(-n+2) { border-bottom: 1px solid #ebf0f4; }
  .unit-card:last-child { border-bottom: 0; }
}
