/* Organização visual 2.0 — hierarquia, respiro e consistência */
:root {
  --app-sidebar: 248px;
  --app-gutter: clamp(18px, 3vw, 40px);
  --app-radius: 16px;
  --app-surface: #151421;
  --app-surface-soft: #11101b;
  --app-border: #2b2840;
  --app-text: #f5f3fb;
  --app-muted: #aaa6bd;
}

body {
  min-width: 320px;
  background-color: #0c0b13;
  background-image:
    radial-gradient(circle at 82% -8%, rgba(123, 61, 255, .12), transparent 28%),
    radial-gradient(circle at 8% 88%, rgba(255, 77, 141, .07), transparent 24%);
}

.sidebar {
  width: var(--app-sidebar);
  padding: 24px 18px 18px;
  background: linear-gradient(180deg, #0c0b15 0%, #100e1c 100%);
  border-right: 1px solid var(--app-border);
  box-shadow: 8px 0 28px rgba(0, 0, 0, .18);
}

.brand {
  min-height: 64px;
  padding: 0 8px 22px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-logo-img { width: 44px; height: 44px; }
.brand strong { font-size: 21px !important; line-height: 1.1; }
.brand small { font-size: 10px !important; letter-spacing: 1.7px; }

.nav-label {
  margin: 20px 12px 8px;
  color: #77728c;
  font: 700 10px/1 "Montserrat", sans-serif;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.sidebar nav { display: grid; gap: 5px; }
.nav-item {
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #aaa5bd;
  font-size: 14px !important;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}

.nav-item span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #1a1827;
  font-size: 16px;
}

.nav-item:hover { transform: translateX(2px); border-color: #332e4d; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(123, 61, 255, .22), rgba(123, 61, 255, .05));
  border-color: rgba(143, 97, 255, .24);
  border-left: 3px solid #8f61ff;
  color: #fff;
}

.nav-item.active span { background: #7b3dff; color: #fff; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.sidebar-tip { margin: 0; padding: 12px 13px; border-radius: 12px; }
.sidebar-tip strong { font-size: 12px !important; }
.sidebar-tip p { font-size: 11px !important; line-height: 1.45; margin-top: 6px; }
.install-app { margin: 0; min-height: 42px; padding: 10px 12px; font-size: 12px; }
.profile { margin: 0; padding: 14px 4px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.profile > span { width: 38px; height: 38px; flex: 0 0 auto; }
.profile strong { font-size: 12px !important; }
.profile small { font-size: 10px !important; }

main {
  margin-left: var(--app-sidebar);
  padding: 0 var(--app-gutter) 64px;
}

.topbar {
  height: 82px;
  min-height: 82px;
  margin: 0 calc(var(--app-gutter) * -1) 20px;
  padding: 0 var(--app-gutter);
  background: rgba(12, 11, 19, .88);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  backdrop-filter: blur(18px);
}

.topbar > div { width: min(100%, 1600px); margin-inline: auto; }
.topbar h1 { margin-top: 2px; font-size: 25px; letter-spacing: -.35px; }
.topbar .eyebrow { font-size: 10px; color: #948da9; letter-spacing: 1.2px; }

.view { width: min(100%, 1600px); margin-inline: auto; }
.view.active { display: grid; gap: 18px; }
.view.active > .section-head,
.view.active > .toolbar,
.view.active > .calendar-tools,
.view.active > .metrics,
.view.active > .dashboard-grid,
.view.active > .panel,
.view.active > .smart-panel,
.view.active > .client-grid,
.view.active > .kanban,
.view.active > .calendar-view,
.view.active > .task-summary,
.view.active > .task-list,
.view.active > .calculator-layout { margin: 0; }

.section-head {
  min-height: 62px;
  align-items: flex-end;
  gap: 20px;
  padding: 0 2px 2px;
}

.section-head h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.5px; }
.section-head p { max-width: 650px; font-size: 13px; color: var(--app-muted); }
.section-actions { flex-wrap: wrap; justify-content: flex-end; }

.primary,
.secondary {
  min-height: 42px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  transition: transform .16s, filter .16s, border-color .16s;
}

.primary:hover,
.secondary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.secondary { background: #1c192a; border-color: #302b48; color: #d2c5f4; }

.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 28px;
  padding: 26px 28px;
  border-radius: var(--app-radius);
  background: linear-gradient(120deg, #171526 0%, #1b1530 55%, #201320 100%);
  border-color: #332d4b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.welcome::after { display: none; }
.welcome::before { opacity: .35; }
.welcome h2 { max-width: 720px; margin: 9px 0 7px; font-size: 30px; line-height: 1.2; }
.welcome p { font-size: 14px; }
.goal { width: 100%; align-self: center; padding: 16px; background: rgba(8, 7, 15, .48); border: 1px solid #342e4b; }

.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metrics article {
  min-height: 112px;
  padding: 17px;
  border-radius: var(--app-radius);
  background: var(--app-surface);
  border-color: var(--app-border);
  box-shadow: none;
}

.metrics article:hover { transform: none; border-color: #3c3657; box-shadow: none; }
.metric-icon { width: 42px; height: 42px; flex: 0 0 auto; }
.metrics small { font-size: 9px; letter-spacing: 1px; }
.metrics strong { font-size: 22px; }
.metrics p { font-size: 11px; }

.dashboard-grid { grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 14px; }
.panel,
.client-card,
.deal,
.task-item {
  border-radius: var(--app-radius);
  background: var(--app-surface);
  border-color: var(--app-border);
  box-shadow: none;
}

.panel { padding: 20px; }
.panel-head { gap: 16px; margin-bottom: 15px; }
.panel h3 { font-size: 17px; }
.panel-head p { font-size: 12px; }
.smart-panel { background: var(--app-surface); }
.smart-insights { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.insight { min-height: 92px; background: var(--app-surface-soft); border-color: var(--app-border); }

.toolbar,
.calendar-tools {
  position: sticky;
  top: 82px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: rgba(20, 19, 33, .94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
}

.toolbar input,
.toolbar select {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #0e0d17;
  border-color: #322e46;
  font-size: 13px;
}

.toolbar input:focus,
.toolbar select:focus { border-color: #7955c7; outline: none; box-shadow: 0 0 0 3px rgba(123, 61, 255, .12); }
.client-grid { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 13px; }
.client-card { padding: 18px; }
.client-card:hover { transform: translateY(-2px); border-color: #493b70; box-shadow: 0 10px 28px rgba(0, 0, 0, .16); }

.kanban { grid-auto-columns: minmax(300px, 340px); gap: 13px; padding: 2px 2px 16px; }
.kanban-col { min-width: 300px; border-radius: 14px; background: #11101b; }
.kanban-head { padding: 14px 15px; }
.deal { margin: 0 10px 10px; padding: 14px; }

.calendar-tools { justify-content: space-between; flex-wrap: wrap; }
.calendar-nav,
.period-tabs { flex: 0 0 auto; }
.notification-control { margin-left: auto; }
.calendar-view { padding: 16px; border-width: 1px; border-color: #3c3456; border-radius: var(--app-radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .2); }
.task-summary { border-radius: 14px; }
.task-list { display: grid; gap: 10px; }
.task-item { margin: 0; }

.calculator-layout { grid-template-columns: minmax(320px, 420px) minmax(300px, 1fr); gap: 14px; }
.calculator { border-radius: var(--app-radius); box-shadow: none; }

@media (max-height: 760px) and (min-width: 721px) {
  .sidebar-tip { display: none; }
}

@media (max-width: 1180px) {
  :root { --app-sidebar: 228px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-insights { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .welcome { grid-template-columns: 1fr; }
  .goal { max-width: none; }
  .calculator-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --app-gutter: 16px; }
  .sidebar { width: min(286px, 88vw); padding-top: 18px; }
  main { margin-left: 0; padding-bottom: 42px; }
  .topbar { height: 70px; min-height: 70px; margin-bottom: 16px; }
  .topbar > div { width: auto; margin: 0; }
  .topbar h1 { font-size: 21px; }
  .menu-toggle { display: block; flex: 0 0 auto; margin-right: 12px; background: #1a1827; color: #fff; border: 1px solid #302b47; }
  .view.active { gap: 14px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .section-head h2 { font-size: 25px; }
  .section-actions,
  .section-head > .primary,
  .section-head > .secondary { width: 100%; }
  .section-actions > * { flex: 1; }
  .section-head > .primary,
  .section-head > .secondary { display: block; }
  .welcome { padding: 22px 18px; gap: 20px; }
  .welcome h2 { font-size: 25px; }
  .metrics { grid-template-columns: 1fr; gap: 10px; }
  .metrics article { min-height: 94px; }
  .toolbar,
  .calendar-tools { position: static; display: grid; grid-template-columns: 1fr; padding: 10px; }
  .toolbar input,
  .toolbar select { width: 100%; }
  .calendar-nav,
  .period-tabs,
  .notification-control { width: 100%; margin-left: 0; }
  .calendar-nav button,
  .period-tabs button { flex: 1; }
  .notification-control { align-items: stretch; }
  .notification-devices { text-align: center; }
  .client-grid { grid-template-columns: 1fr; }
  .kanban { grid-auto-columns: minmax(270px, 86vw); }
  .panel { padding: 17px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .link { align-self: flex-start; }
  .smart-insights { grid-template-columns: 1fr; }
}

/* Painéis organizados: menu lateral e agenda */
.sidebar { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #41345f transparent; }
.sidebar nav { flex: 0 0 auto; }
.sidebar-bottom { padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-tip { border: 1px solid #372b54; background: linear-gradient(135deg, #19142a, #251331); }
.install-area {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid #33274d;
  border-radius: 12px;
  background: #12101e;
}
.install-app { width: 100%; border-radius: 9px; }
.install-app:disabled { cursor: not-allowed; opacity: .78; filter: saturate(.45); }
.install-app.installed { border-color: rgba(63, 211, 152, .38); color: #7ae2b5; background: rgba(27, 112, 78, .16); }
.install-status { display: block; padding: 0 3px 2px; color: #8e899f; font-size: 9px !important; line-height: 1.35; text-align: center; }
.install-status.success { color: #63d8a7; }
.profile { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.profile > div { min-width: 0; display: grid; gap: 2px; }
.profile strong { display: block; overflow-wrap: anywhere; line-height: 1.35; }
.profile small { display: block; overflow-wrap: anywhere; }
.logout-button { flex: 0 0 auto; }

#checklist { max-width: 1440px; }
.section-kicker {
  display: block;
  margin-bottom: 6px;
  color: #a68acb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
#checklist .section-head { padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
#checklist .calendar-tools {
  position: static;
  display: grid;
  grid-template-columns: auto minmax(310px, 1fr) auto;
  gap: 10px;
  padding: 10px;
  background: #12101d;
  box-shadow: none;
}
.calendar-control-group {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid #2c2840;
  border-radius: 11px;
  background: #0e0d17;
}
.calendar-control-group > small,
.task-toolbar label > span {
  color: #817b94;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 1.1px;
}
.calendar-control-group.period-control { justify-items: center; }
.calendar-control-group.notification-control { margin: 0; justify-items: end; }
.notification-control > div { display: flex; align-items: center; gap: 10px; }
.notification-devices { max-width: 150px; color: #9993aa; font-size: 10px !important; line-height: 1.35; }
.calendar-view { padding: 14px; background: #11101b; box-shadow: none; }
.calendar-title { min-height: 48px; padding: 9px 12px; border-radius: 10px; background: #171525; }
.week-grid { gap: 8px; }
.calendar-day { min-height: 176px; }
.calendar-day-head { padding-bottom: 9px; }
.task-toolbar {
  position: static;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 210px) minmax(170px, 220px);
  align-items: end;
  gap: 10px;
  box-shadow: none;
}
.task-toolbar label { min-width: 0; display: grid; gap: 7px; }
.task-toolbar input,
.task-toolbar select { width: 100%; }
.task-summary {
  min-height: 84px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(100deg, #151329, #2c1440);
  border: 1px solid #392a50;
}
.task-summary p { margin: 0; }
.period-label { align-self: center; }

@media (max-width: 1120px) {
  #checklist .calendar-tools { grid-template-columns: 1fr 1fr; }
  .calendar-control-group.notification-control { grid-column: 1 / -1; justify-items: start; }
}

@media (max-width: 720px) {
  .sidebar-bottom { margin-top: 18px; }
  #checklist .calendar-tools,
  .task-toolbar { grid-template-columns: 1fr; }
  .calendar-control-group.notification-control { grid-column: auto; justify-items: stretch; }
  .calendar-control-group.period-control { justify-items: stretch; }
  .notification-control > div { display: grid; }
  .notification-devices { max-width: none; text-align: left; }
  .task-summary { grid-template-columns: auto 1fr; }
  .period-label { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
  .calendar-view { overflow-x: auto; }
  .week-grid { min-width: 820px; }
}

/* Acessibilidade tipográfica 3.0 — leitura confortável em todas as telas */
:root { --app-sidebar: 276px; }
html { font-size: 18px; }
body { font-size: 18px !important; line-height: 1.6; }
button,
input,
select,
textarea { font-size: 16px !important; line-height: 1.35; }
p,
td,
.client-info,
.mini-task,
.funnel-row { font-size: 15px !important; }
small,
th,
.eyebrow,
.pill,
.live-badge,
.deal-type { font-size: 13px !important; line-height: 1.45; }

.brand strong { font-size: 25px !important; }
.brand small { font-size: 12px !important; letter-spacing: 1.8px; }
.nav-label { font-size: 12px; }
.nav-item { min-height: 52px; font-size: 16px !important; }
.nav-item span { font-size: 18px; }
.nav-item b { font-size: 13px; }
.sidebar-tip strong { font-size: 15px !important; }
.sidebar-tip p { font-size: 14px !important; }
.install-app { min-height: 46px; font-size: 15px !important; }
.install-status { font-size: 12px !important; }
.profile strong { font-size: 14px !important; }
.profile small,
.cloud-status { font-size: 12px !important; }
.logout-button { font-size: 13px !important; padding: 8px 10px; }

.topbar h1 { font-size: 30px; }
.topbar .eyebrow { font-size: 12px !important; }
.section-kicker { font-size: 12px; }
.section-head h2 { font-size: 32px; }
.section-head p { font-size: 16px !important; }
.welcome h2 { font-size: 34px; }
.welcome p { font-size: 16px !important; }
.goal,
.goal small,
.goal > div:first-child { font-size: 15px !important; }
.goal-controls button { font-size: 14px !important; }

.metrics small { font-size: 12px !important; }
.metrics strong { font-size: 27px; }
.metrics p { font-size: 14px !important; }
.panel h3 { font-size: 21px; }
.panel-head p { font-size: 15px !important; }
.link { font-size: 14px !important; }
.quick-add input { font-size: 16px !important; }
.status { font-size: 13px; }
.client-card h3 { font-size: 20px; }
.client-card small,
.client-note { font-size: 14px !important; }
.kanban-head { font-size: 16px; }
.deal h4 { font-size: 19px; }
.deal p { font-size: 14px !important; }
.deal strong { font-size: 18px; }
.deal select { font-size: 15px !important; }
.edit,
.delete { font-size: 13px !important; min-height: 36px; }

.calendar-control-group > small,
.task-toolbar label > span { font-size: 12px !important; }
.calendar-nav button,
.period-tabs button,
.notify-button { min-height: 48px; font-size: 15px !important; }
.notification-devices { max-width: 190px; font-size: 13px !important; }
.calendar-title strong { font-size: 20px; }
.calendar-title span { font-size: 14px; }
.calendar-day-head { font-size: 13px; }
.calendar-day-head b { font-size: 18px; }
.calendar-event { font-size: 14px; line-height: 1.45; padding: 8px; }
.calendar-event time { font-size: 13px; }
.month-weekday { font-size: 13px; }
.month-day { font-size: 16px; }
.year-month strong { font-size: 17px; }
.year-month p { font-size: 14px !important; }
.task-name { font-size: 16px; }
.task-date,
.priority,
.reminder { font-size: 13px; }
.task-summary strong { font-size: 17px; }
.task-summary small,
.period-label { font-size: 14px !important; }
.empty { font-size: 15px; }

.field label,
.action-input-wrap > span { font-size: 14px; }
.field input,
.field select,
.action-input-wrap input { font-size: 16px !important; }
.modal-head h2,
.action-dialog h2 { font-size: 26px; }
.action-dialog p,
.stage-dialog .modal-head p { font-size: 16px !important; }
.stage-row input,
.stage-add input { font-size: 16px !important; }
.stage-row-actions button,
.stage-help { font-size: 14px !important; }
.toast { font-size: 15px; }
.insight strong { font-size: 15px; }
.insight p { font-size: 14px !important; }
.calc-screen small { font-size: 14px !important; }
.calc-history-item span { font-size: 14px; }
.calc-history-item strong { font-size: 17px; }

.access-brand strong { font-size: 27px; }
.access-brand small { font-size: 12px; }
.access-card h1 { font-size: 33px; }
.access-kicker { font-size: 13px; }
.access-intro { font-size: 17px !important; }
.auth-tabs button { font-size: 16px !important; }
.access-form > label { font-size: 15px; }
.access-form input { font-size: 17px !important; }
.access-form label small,
.trial-note,
.terms-check span { font-size: 14px !important; }
.gate-feedback { font-size: 15px; }
.access-security { font-size: 13px; }
.plan-grid small { font-size: 14px !important; }
.plan-grid strong { font-size: 30px; }
.plan-grid span { font-size: 14px; }
.terms-check a,
.legal-links a { color: #c7aaff; text-decoration: underline; text-underline-offset: 3px; }
.terms-check a:hover,
.legal-links a:hover { color: #ff8fba; }
.legal-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 13px; }
.legal-links a { font-size: 13px; }

@media (max-width: 1180px) and (min-width: 721px) {
  :root { --app-sidebar: 252px; }
  .sidebar { padding-inline: 15px; }
  .nav-item { font-size: 15px !important; }
  .welcome h2 { font-size: 31px; }
  .section-head h2 { font-size: 30px; }
}

@media (max-width: 720px) {
  html { font-size: 17px; }
  body { font-size: 17px !important; }
  .sidebar { width: min(310px, 90vw); }
  .topbar h1 { font-size: 25px; }
  .topbar .eyebrow { font-size: 11px !important; }
  .section-head h2 { font-size: 28px; }
  .section-head p { font-size: 16px !important; }
  .welcome h2 { font-size: 29px; }
  .metrics strong { font-size: 24px; }
  .metrics small { font-size: 12px !important; }
  .panel h3 { font-size: 20px; }
  .calendar-title strong { font-size: 18px; }
  .calendar-title span { font-size: 14px; }
  .calendar-event { font-size: 14px; }
  .task-toolbar input,
  .task-toolbar select { min-height: 50px; }
  .access-card h1 { font-size: 28px; }
  .access-intro { font-size: 16px !important; }
}
