:root {
  --porto-blue-900: #083778;
  --porto-blue-800: #0d4ea6;
  --porto-blue-700: #1265c7;
  --porto-blue-500: #169bd7;
  --porto-cyan: #28b8e8;
  --porto-mint: #64d2c8;
  --ink-900: #172033;
  --ink-700: #3a4861;
  --ink-500: #68748b;
  --line: #d8e1ef;
  --line-strong: #b7c7dd;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef6fd;
  --success: #0f8f75;
  --warning: #d68100;
  --danger: #c7343e;
  --muted: #6b778d;
  --shadow: 0 16px 42px rgba(8, 55, 120, 0.12);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink-900);
  background:
    linear-gradient(180deg, rgba(22, 155, 215, 0.09), transparent 360px),
    var(--bg);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(40, 184, 232, 0.18), rgba(100, 210, 200, 0)),
    var(--porto-blue-900);
}

.brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.brand-mark img {
  width: 44px;
  height: auto;
  display: block;
}

.brand-text strong {
  display: block;
  line-height: 1.1;
  font-size: 1rem;
}

.brand-text span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.76);
  word-break: break-word;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  text-align: left;
}

.nav-button svg,
.action-button svg,
.ghost-button svg,
.primary-button svg,
.danger-button svg,
.icon-button svg,
.login-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-button.active,
.nav-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.session-card {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.88);
}

.session-card span {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-word;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 76px;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(216, 225, 239, 0.86);
  background: rgba(244, 247, 251, 0.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
  min-width: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar.align-right {
  justify-content: flex-end;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 220px));
  gap: 10px;
  align-items: end;
}

.filter-bar.compact {
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 220px));
}

.filter-field,
.form-field {
  display: grid;
  gap: 7px;
}

label {
  color: var(--ink-700);
  font-size: 0.83rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-900);
  background: #fff;
  outline: 0;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--porto-blue-500);
  box-shadow: 0 0 0 3px rgba(22, 155, 215, 0.16);
}

.field-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.checkbox-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-700);
  font-weight: 700;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.surface {
  padding: 18px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(8, 55, 120, 0.06);
}

.surface-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.surface-header h2,
.surface-header h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.surface-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 14px;
}

.stat-card {
  min-width: 0;
  min-height: 116px;
  padding: 17px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.92)),
    var(--surface);
  box-shadow: 0 12px 26px rgba(8, 55, 120, 0.05);
}

.stat-card strong {
  display: block;
  max-width: 100%;
  font-size: 2rem;
  line-height: 1;
  color: var(--porto-blue-900);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  color: var(--ink-700);
  font-size: 0.92rem;
  line-height: 1.3;
}

.stat-card.finance-only {
  grid-column: span 2;
}

.stat-card.finance-only strong {
  font-size: 1.85rem;
}

.stat-card.accent {
  border-color: rgba(22, 155, 215, 0.35);
  background: linear-gradient(140deg, #fff, #e9f8ff);
}

.stat-card.warning {
  border-color: rgba(214, 129, 0, 0.34);
  background: linear-gradient(140deg, #fff, #fff6e7);
}

.stat-card.danger {
  border-color: rgba(199, 52, 62, 0.28);
  background: linear-gradient(140deg, #fff, #fff0f1);
}

.portfolio-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.overview-card {
  --meter-color: var(--porto-blue-800);
  min-width: 0;
  min-height: 132px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.9)),
    #fff;
  box-shadow: 0 14px 32px rgba(8, 55, 120, 0.07);
}

.overview-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.overview-card strong {
  display: block;
  margin-top: 7px;
  color: var(--porto-blue-900);
  font-size: 1.75rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.overview-card p {
  margin: 8px 0 0;
  color: var(--ink-700);
  font-size: 0.84rem;
  line-height: 1.35;
}

.overview-card.cyan {
  --meter-color: var(--porto-cyan);
}

.overview-card.success {
  --meter-color: var(--success);
}

.overview-card.warning {
  --meter-color: var(--warning);
}

.overview-card.danger {
  --meter-color: var(--danger);
}

.radial-meter {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--meter-color) calc(var(--value) * 1%), #e6edf6 0);
  box-shadow: inset 0 0 0 1px rgba(8, 55, 120, 0.05);
}

.radial-meter span {
  color: var(--porto-blue-900);
  font-size: 0.78rem;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.monthly-table {
  margin-top: 12px;
}

.monthly-grid .stat-card strong {
  font-size: 1.75rem;
  overflow-wrap: anywhere;
}

.report-month-field {
  min-width: 220px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  color: var(--ink-700);
  background: #f8fbff;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.table-title {
  display: grid;
  gap: 3px;
}

.table-title strong {
  line-height: 1.25;
}

.table-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 132px;
}

.primary-button,
.ghost-button,
.action-button,
.danger-button,
.login-button,
.icon-button {
  min-height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  color: #fff;
  background: var(--porto-blue-800);
  box-shadow: 0 10px 22px rgba(13, 78, 166, 0.18);
}

.primary-button:hover {
  background: var(--porto-blue-900);
}

.ghost-button {
  color: var(--porto-blue-900);
  border-color: var(--line-strong);
  background: #fff;
}

.ghost-button:hover {
  border-color: var(--porto-blue-500);
  background: #f4fbff;
}

.action-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--porto-blue-900);
  border-color: var(--line);
  background: #fff;
  font-size: 0.83rem;
  white-space: nowrap;
}

.action-button:hover {
  border-color: var(--porto-blue-500);
}

.action-button.danger-action {
  color: var(--danger);
  border-color: rgba(199, 52, 62, 0.24);
  background: #fff7f8;
}

.action-button.danger-action:hover {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--porto-blue-900);
  border-color: var(--line);
  background: #fff;
}

.icon-button:hover {
  border-color: var(--porto-blue-500);
}

.status-pill,
.due-pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-ativa {
  color: #07604f;
  background: #dff7f1;
}

.status-ativo {
  color: #07604f;
  background: #dff7f1;
}

.status-inativo {
  color: #505d73;
  background: #e9edf4;
}

.status-vencida {
  color: #9d1f2a;
  background: #ffe4e7;
}

.status-em-renovacao {
  color: #795100;
  background: #fff1cd;
}

.status-cancelada {
  color: #505d73;
  background: #e9edf4;
}

.status-prospect {
  color: #0d4ea6;
  background: #e7f4ff;
}

.due-pill.ok {
  color: #0b6554;
  background: #e4f8f2;
}

.due-pill.soon {
  color: #795100;
  background: #fff1cd;
}

.due-pill.late {
  color: #9d1f2a;
  background: #ffe4e7;
}

.mini-pill {
  color: var(--ink-700);
  background: #edf2f8;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-item time {
  color: var(--porto-blue-900);
  font-weight: 900;
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-item p {
  margin: 0;
  color: var(--ink-700);
  line-height: 1.45;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #e6edf6;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--porto-blue-800), var(--porto-cyan));
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented-control button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-700);
  background: transparent;
  font-weight: 800;
}

.segmented-control button.active,
.segmented-control button:hover {
  color: #fff;
  background: var(--porto-blue-800);
}

.segmented-control.subtle button.active,
.segmented-control.subtle button:hover {
  background: var(--porto-cyan);
  color: var(--porto-blue-900);
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.premium-chart-surface {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 254, 0.94)),
    #fff;
}

.premium-chart-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(150px, 0.72fr));
  gap: 10px;
  margin-bottom: 14px;
}

.trend-card {
  min-height: 92px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trend-card.main {
  background:
    linear-gradient(135deg, rgba(18, 101, 199, 0.1), rgba(40, 184, 232, 0.12)),
    #fff;
}

.trend-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.trend-card strong {
  color: var(--porto-blue-900);
  font-size: 1.8rem;
  line-height: 1;
}

.trend-card em {
  color: var(--ink-700);
  font-size: 0.82rem;
  font-style: normal;
}

.trend-card em.positive {
  color: var(--success);
}

.trend-card em.negative {
  color: var(--danger);
}

.premium-chart-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.94), #ffffff 62%),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.premium-evolution-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-grid-line {
  stroke: #e4ecf6;
  stroke-width: 1;
}

.chart-area {
  fill: url(#clientAreaGradient);
}

.new-client-bar {
  fill: url(#clientBarGradient);
  opacity: 0.92;
}

.chart-bar-label {
  fill: var(--porto-blue-900);
  font-size: 0.74rem;
  font-weight: 900;
}

.chart-line {
  fill: none;
  stroke: url(#clientLineGradient);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.chart-line.glow {
  filter: url(#lineGlow);
  opacity: 0.42;
  stroke-width: 8;
}

.closed-policy-line {
  fill: none;
  stroke: url(#policyLineGradient);
  stroke-dasharray: 7 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-point {
  fill: #fff;
  stroke: var(--porto-blue-800);
  stroke-width: 3;
}

.policy-point {
  fill: #fff7e8;
  stroke: var(--warning);
  stroke-width: 3;
}

.chart-x-label,
.chart-y-label {
  fill: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.chart-y-label.secondary {
  fill: #9d5e00;
}

.chart-hover-zone {
  fill: transparent;
  pointer-events: all;
}

.chart-tooltip {
  opacity: 0;
  transform-box: fill-box;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.chart-hit:hover .chart-tooltip {
  opacity: 1;
}

.chart-tooltip rect {
  fill: rgba(8, 55, 120, 0.94);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
}

.chart-tooltip-title {
  fill: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.chart-tooltip-line {
  fill: rgba(255, 255, 255, 0.82);
  font-size: 0.7rem;
  font-weight: 700;
}

.trend-pill {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 900;
}

.trend-pill.positive {
  color: #07604f;
  background: #dff7f1;
}

.trend-pill.negative {
  color: #9d1f2a;
  background: #ffe4e7;
}

.evolution-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.evolution-summary div {
  min-height: 78px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.evolution-summary strong {
  color: var(--porto-blue-900);
  font-size: 1.45rem;
  line-height: 1;
}

.evolution-summary span {
  color: var(--muted);
  font-size: 0.84rem;
}

.evolution-chart {
  min-height: 248px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.evolution-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 148px auto auto;
  gap: 7px;
  align-items: end;
  text-align: center;
}

.evolution-bars {
  height: 148px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.evolution-bars span {
  width: 18px;
  min-height: 10px;
  border-radius: 6px 6px 0 0;
  display: block;
}

.evolution-bars .bar-total {
  background: linear-gradient(180deg, var(--porto-blue-800), var(--porto-blue-900));
}

.evolution-bars .bar-new {
  background: linear-gradient(180deg, var(--porto-cyan), var(--porto-mint));
}

.evolution-item strong {
  color: var(--porto-blue-900);
  line-height: 1;
}

.evolution-item > span {
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.chart-legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

.legend-total {
  background: var(--porto-blue-800);
}

.legend-new {
  background: var(--porto-cyan);
}

.legend-policy {
  background: var(--warning);
}

.action-plan {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.92)),
    #fff;
}

.action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.recommendation-card {
  min-height: 138px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--porto-blue-800);
  border-radius: 8px;
  background: #fff;
}

.recommendation-card strong {
  color: var(--porto-blue-900);
  line-height: 1.25;
}

.recommendation-card p {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.88rem;
  line-height: 1.42;
}

.recommendation-card.blue {
  border-left-color: var(--porto-blue-800);
}

.recommendation-card.cyan {
  border-left-color: var(--porto-cyan);
}

.recommendation-card.warning {
  border-left-color: var(--warning);
  background: linear-gradient(180deg, #fff, #fffaf1);
}

.recommendation-card.danger {
  border-left-color: var(--danger);
  background: linear-gradient(180deg, #fff, #fff5f6);
}

.recommendation-card.success {
  border-left-color: var(--success);
  background: linear-gradient(180deg, #fff, #f2fbf8);
}

.renewal-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.calendar-cell {
  min-height: 116px;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.calendar-cell.muted {
  background: #f5f8fc;
}

.calendar-cell.has-items {
  border-color: rgba(22, 155, 215, 0.34);
  background: linear-gradient(180deg, #fff, #f4fbff);
}

.calendar-day {
  color: var(--porto-blue-900);
  font-weight: 900;
}

.calendar-policy {
  min-height: 42px;
  padding: 7px;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(18, 101, 199, 0.18);
  border-radius: 6px;
  color: var(--ink-900);
  background: #fff;
  text-align: left;
}

.calendar-policy strong {
  color: var(--porto-blue-900);
  font-size: 0.78rem;
}

.calendar-policy span,
.calendar-cell em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.branch-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.branch-card {
  min-height: 132px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.branch-card strong {
  color: var(--porto-blue-900);
}

.branch-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.branch-bar {
  height: 9px;
  border-radius: 999px;
  background: #e6edf6;
  overflow: hidden;
}

.branch-bar span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--porto-blue-800), var(--porto-cyan));
}

.branch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.branch-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf2f8;
  color: var(--ink-700);
  font-weight: 800;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.task-board.compact {
  grid-template-columns: 1fr;
}

.task-card {
  min-height: 170px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--porto-blue-800);
  border-radius: 8px;
  background: #fff;
}

.task-card.alta {
  border-left-color: var(--danger);
}

.task-card.baixa {
  border-left-color: var(--success);
}

.task-card strong {
  color: var(--porto-blue-900);
}

.task-card span,
.task-card p {
  color: var(--ink-700);
  font-size: 0.84rem;
}

.task-card p {
  margin: 0;
  line-height: 1.42;
}

.task-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.empty-state {
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-list-row {
  min-height: 42px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 22px minmax(120px, 0.34fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mini-list-row svg {
  width: 18px;
  height: 18px;
  color: var(--porto-blue-800);
}

.mini-list-row span:last-child {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-profile {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
}

.profile-block {
  display: grid;
  gap: 10px;
}

.info-list {
  display: grid;
  gap: 9px;
}

.info-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f8;
}

.info-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.info-row strong {
  font-size: 0.9rem;
  word-break: break-word;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid .full,
.form-field.full {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 21, 44, 0.52);
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-panel.narrow {
  width: min(560px, 100%);
}

.modal-head,
.modal-foot {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  background: #f8fbff;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-body {
  padding: 20px;
  overflow: auto;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  background:
    radial-gradient(circle at 80% 20%, rgba(100, 210, 200, 0.22), transparent 32%),
    linear-gradient(135deg, #f5f9ff 0%, #edf7ff 50%, #ffffff 100%);
}

.login-panel {
  min-height: 100vh;
  padding: clamp(28px, 6vw, 76px);
  display: grid;
  align-content: center;
  gap: 26px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand img {
  width: 62px;
  height: auto;
}

.login-brand strong {
  display: block;
  font-size: 1.15rem;
}

.login-brand span {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-button {
  width: 100%;
  min-height: 46px;
  color: #fff;
  background: var(--porto-blue-800);
}

.login-aside {
  padding: clamp(28px, 6vw, 76px);
  display: grid;
  align-content: center;
  gap: 24px;
}

.login-aside h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
  color: var(--porto-blue-900);
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
}

.login-metric {
  min-height: 104px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(18, 101, 199, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.login-metric strong {
  color: var(--porto-blue-900);
  font-size: 1.5rem;
}

.login-metric span {
  color: var(--ink-700);
  font-size: 0.9rem;
}

.helper-line {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--porto-blue-900);
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.76fr);
  gap: 18px;
}

.backup-actions {
  display: grid;
  gap: 10px;
}

.mobile-tabs {
  display: none;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .mobile-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px 12px;
    background: var(--porto-blue-900);
  }

  .mobile-tabs .nav-button {
    width: auto;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.1);
  }

  .topbar {
    top: 0;
  }

  .dashboard-grid,
  .admin-grid,
  .client-profile {
    grid-template-columns: 1fr;
  }

  .premium-chart-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .content {
    padding: 18px 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .monthly-grid,
  .evolution-summary,
  .portfolio-overview,
  .action-list,
  .branch-report-grid,
  .task-board,
  .login-metrics {
    grid-template-columns: 1fr;
  }

  .renewal-calendar {
    grid-template-columns: 1fr;
  }

  .calendar-weekday,
  .calendar-cell.muted {
    display: none;
  }

  .calendar-cell:not(.has-items) {
    display: none;
  }

  .calendar-cell {
    min-height: auto;
  }

  .overview-card {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .stat-card strong,
  .monthly-grid .stat-card strong {
    font-size: 1.8rem;
  }

  .stat-card.finance-only strong {
    font-size: 1.65rem;
  }

  .radial-meter {
    width: 66px;
    height: 66px;
  }

  .stat-card.finance-only {
    grid-column: auto;
  }

  .filter-bar,
  .filter-bar.compact,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .surface-header {
    display: grid;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-aside {
    align-content: start;
  }

  .login-aside h1 {
    font-size: 2rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .info-row {
    grid-template-columns: 1fr;
  }

  .mini-list-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .mini-list-row span:last-child {
    grid-column: 2;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }
}
