:root {
  --bg: #eef4f8;
  --bg-strong: #dfeaf1;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --text: #13334a;
  --text-muted: #567387;
  --primary: #1c5284;
  --primary-soft: #2d6ba3;
  --success: #39e240;
  --success-soft: #dff9e0;
  --danger: #d85c55;
  --border: rgba(28, 82, 132, 0.12);
  --shadow: 0 24px 48px rgba(13, 39, 61, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  font-family: "Roboto", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(57, 226, 64, 0.16), transparent 24%),
    linear-gradient(180deg, #f7fbfd 0%, var(--bg) 100%);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 100vh;
}

.auth-panel {
  padding: 56px;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(28, 82, 132, 0.96), rgba(25, 105, 140, 0.88)),
    linear-gradient(180deg, #1c5284, #24628e);
  color: #fff;
}

.brand-panel h1 {
  margin: 0 0 12px;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0 18px;
}

.login-logo,
.sidebar-logo {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
  background: #fff;
}

.login-subtitle {
  margin: 0;
  max-width: 520px;
}

.brand-kicker,
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.72;
}

.feature-list {
  padding-left: 18px;
  line-height: 1.8;
}

.demo-box {
  display: grid;
  gap: 4px;
  width: fit-content;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
}

.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px);
}

.tabs {
  display: inline-flex;
  width: fit-content;
  padding: 8px;
  border-radius: 999px;
  background: var(--bg-strong);
}

.tab,
.nav-link,
.ghost-button,
.mini-button {
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
}

.tab {
  padding: 12px 18px;
}

.tab.is-active {
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.auth-form,
.form-grid,
.stack,
.customer-list,
.chart-bars,
.kanban-list {
  display: grid;
  gap: 16px;
}

.auth-form label,
.form-grid label,
.mapping-grid label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
}

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

.primary-button,
.ghost-button {
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), #2470b0);
  color: #fff;
  box-shadow: 0 18px 32px rgba(28, 82, 132, 0.22);
}

.ghost-button {
  background: rgba(28, 82, 132, 0.08);
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.shell.sidebar-collapsed {
  grid-template-columns: 96px 1fr;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 28px 112px;
  background: rgba(17, 49, 74, 0.98);
  color: #fff;
}

.sidebar-toggle {
  position: absolute;
  top: 28px;
  right: -18px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.logo-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo-block p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--success), #80f77a);
  color: #0f2f44;
  font-weight: 700;
}

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

.merito-signature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(28, 82, 132, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.merito-signature span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.merito-signature strong {
  display: block;
  line-height: 1.15;
}

.merito-signature-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
}

.sidebar-signature {
  position: fixed;
  left: 28px;
  bottom: 96px;
  width: 224px;
  z-index: 9;
}

.login-signature {
  margin-top: 20px;
  width: fit-content;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  text-align: left;
  color: #fff;
  transition: background 160ms ease, border-color 160ms ease;
}

.nav-link.is-active {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.nav-short {
  display: none;
  width: 24px;
  text-align: center;
  font-weight: 700;
}

.nav-text {
  display: inline-block;
  width: 100%;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shell.sidebar-collapsed .logo-copy,
.shell.sidebar-collapsed .sidebar-signature,
.shell.sidebar-collapsed .nav-text {
  display: none;
}

.shell.sidebar-collapsed .sidebar {
  padding-inline: 16px;
}

.shell.sidebar-collapsed .logo-block,
.shell.sidebar-collapsed .nav-link,
.shell.sidebar-collapsed .sidebar-logout {
  justify-content: center;
}

.shell.sidebar-collapsed .nav-short {
  display: inline-block;
}

.content {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h2,
.panel h3 {
  margin: 6px 0 0;
}

.topbar-user {
  display: grid;
  text-align: right;
  color: var(--text-muted);
}

.subtle-text {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.dashboard-grid,
.stats-grid {
  display: grid;
  gap: 20px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.stat-card,
.loading-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  display: grid;
  gap: 12px;
}

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

.stat-card.accent {
  background: linear-gradient(135deg, rgba(57, 226, 64, 0.18), rgba(28, 82, 132, 0.08));
}

.panel-header,
.charge-card,
.customer-row,
.client-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-bars {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  min-height: 250px;
}

.annual-bars {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.bar-item {
  display: grid;
  gap: 8px;
  text-align: center;
}

.annual-item {
  max-width: 260px;
  margin: 0 auto;
}

.bar-track {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 180px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 82, 132, 0.08), rgba(28, 82, 132, 0.16));
}

.bar-track span {
  display: block;
  width: 70%;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, var(--success), var(--primary));
}

.annual-track {
  height: 240px;
  background: linear-gradient(180deg, rgba(57, 226, 64, 0.1), rgba(28, 82, 132, 0.16));
}

.annual-track span {
  width: 52%;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(28, 82, 132, 0.08);
  color: var(--text);
  font-size: 0.82rem;
}

.status-pago {
  background: rgba(57, 226, 64, 0.18);
}

.status-vencido {
  background: rgba(216, 92, 85, 0.18);
}

.tag.receita {
  background: rgba(57, 226, 64, 0.18);
}

.tag.despesa {
  background: rgba(216, 92, 85, 0.18);
}

.inline-form,
.mapping-grid,
.dual-panel {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
}

.filter-grid label {
  color: var(--text-muted);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.action-row {
  display: flex;
  gap: 8px;
}

.mini-button {
  padding: 8px 12px;
  background: rgba(28, 82, 132, 0.08);
}

.mini-button.danger {
  color: var(--danger);
}

.mini-button.warning {
  color: #926201;
}

.client-card,
.charge-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(28, 82, 132, 0.04);
}

.client-main,
.client-meta {
  display: grid;
  gap: 6px;
}

.muted-pill {
  opacity: 0.72;
}

.kanban-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.kanban-column {
  padding: 18px;
  border: 1px dashed rgba(28, 82, 132, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.kanban-header {
  margin-bottom: 14px;
  font-weight: 700;
}

.task-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 82, 132, 0.1), rgba(57, 226, 64, 0.08));
  cursor: grab;
}

.empty-state,
.empty-cell {
  color: var(--text-muted);
}

.hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff;
  background: var(--primary);
  box-shadow: var(--shadow);
}

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

.preview-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(28, 82, 132, 0.06);
}

.warning-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 184, 77, 0.18);
  color: #7a4b00;
}

.top-gap {
  margin-top: 20px;
}

.tabs-panel {
  background: rgba(28, 82, 132, 0.08);
}

.sidebar-logout {
  position: fixed;
  left: 28px;
  bottom: 28px;
  width: 224px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.shell.sidebar-collapsed .sidebar-logout {
  left: 16px;
  width: 64px;
  padding-inline: 0;
}

.shell.sidebar-collapsed .sidebar-signature {
  left: 16px;
  width: 64px;
  padding: 8px;
  justify-content: center;
}

@media (max-width: 1080px) {
  .auth-shell,
  .shell,
  .stats-grid,
  .kanban-grid,
  .dual-panel {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 20px;
  }

  .topbar,
  .panel-header,
  .charge-card,
  .customer-row,
  .client-card,
  .login-brand-lockup {
    flex-direction: column;
  }

  .inline-form,
  .chart-bars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .auth-panel,
  .sidebar {
    padding: 24px;
  }

  .sidebar-logout {
    position: static;
    width: 100%;
  }

  .sidebar-signature {
    position: static;
    width: 100%;
  }

  .inline-form,
  .mapping-grid,
  .chart-bars {
    grid-template-columns: 1fr;
  }
}
