html {
  font-size: 15px;
}

body {
  margin: 0;
  color: #1f2933;
  background: #f5f7fa;
}

.app-main {
  width: min(1320px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.app-main.with-sidebar {
  width: auto;
  max-width: 1440px;
  margin: 0 0 0 248px;
  padding: 28px 32px 120px;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  width: 248px;
  display: flex;
  flex-direction: column;
  color: #dfe7e3;
  background: #17251f;
  border-right: 1px solid #2d3d35;
}

.sidebar-brand {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #314139;
  font-size: 1.05rem;
  font-weight: 700;
}

.sidebar-brand:hover {
  color: #fff;
}

.sidebar-brand-mark {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #26865e;
  font-size: .82rem;
  font-weight: 800;
}

.sidebar-nav {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.sidebar-link,
.sidebar-context {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 6px;
  color: #cbd8d1;
  text-decoration: none;
}

.sidebar-link svg,
.sidebar-context svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.sidebar-link:hover {
  color: #fff;
  background: #26372f;
}

.sidebar-link.active {
  color: #fff;
  background: #236e50;
}

.sidebar-divider {
  height: 1px;
  margin: 10px 11px;
  background: #34463d;
}

.sidebar-toggle {
  margin: 0;
}

.sidebar-chevron {
  margin-left: auto;
  transition: transform .16s ease;
}

.sidebar-toggle[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: none;
  padding: 2px 0 4px 14px;
}

.sidebar-submenu-nested {
  padding-left: 16px;
}

.sidebar-submenu.open {
  display: block;
}

.sidebar-sublink {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: .92rem;
}

.sidebar-sublink svg {
  width: 18px;
  height: 18px;
}

.customer-statement-select {
  max-width: 560px;
}

.customer-statement-table th:last-child {
  width: 230px;
}

.statement-income {
  color: #1769aa;
}

.statement-expense {
  color: #c62828;
}

.statement-documents {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.statement-document {
  min-width: 58px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 700;
  text-decoration: none;
}

.statement-document svg {
  width: 19px;
  height: 19px;
}

.statement-document.available {
  color: #1769aa;
  background: #e8f3fb;
  border-color: #b7d8ee;
}

.statement-document.available:hover {
  color: #0d4e80;
  background: #d8ebf7;
}

.statement-document.missing {
  color: #9aa5ad;
  background: #f5f6f7;
  border-color: #e4e7e9;
}

.statement-empty-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 10px;
  border-top: 1px solid #314139;
}

.sidebar-footer form {
  margin: 0;
}

.sidebar-context {
  color: #fff;
}

.sidebar-context .sidebar-label {
  min-width: 0;
  display: grid;
}

.sidebar-context small {
  color: #9fb0a7;
  font-size: .7rem;
}

.sidebar-context strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85rem;
}

.sidebar-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.sidebar-logout {
  color: #ffb9b9;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header h1,
.form-page h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.page-header p {
  margin: 4px 0 0;
  color: #52606d;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel,
.auth-panel,
.metric {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 18px;
}

.panel h2 {
  font-size: 1.1rem;
  margin: 0 0 16px;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric span {
  display: block;
  color: #52606d;
  font-size: .9rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 140px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

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

.bar i {
  display: block;
  height: 100%;
  background: #2f9e44;
}

.bar-row.expense .bar i {
  background: #c92a2a;
}

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

.mini-list a {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 12px;
}

.mini-list strong,
.mini-list span {
  display: block;
}

.mini-list span {
  color: #52606d;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(9, 16, 14, .34), rgba(9, 16, 14, .08)),
    url("../images/login-financeiro.png") center / cover no-repeat;
}

.auth-panel {
  width: min(430px, 100%);
  padding: 32px;
  border-color: rgba(255, 255, 255, .42);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .94);
}

.auth-page .app-main {
  width: 100%;
  margin: 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid #d9e2ec;
}

.auth-brand h1 {
  margin: 2px 0 0;
  font-size: 1.4rem;
}

.auth-brand .eyebrow {
  margin: 0;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: #176b47;
  border-radius: 8px;
  font-weight: 800;
}

.auth-copy {
  margin: 26px 0 22px;
}

.auth-copy h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.auth-copy p,
.auth-security {
  color: #52606d;
  margin: 0;
}

.google-signin {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #aeb9c4;
  border-radius: 6px;
  color: #1f2933;
  background: #fff;
  font-weight: 600;
}

.google-signin:hover {
  background: #f7f9fb;
  border-color: #7b8794;
}

.google-g {
  color: #176b47;
  font-size: 1.15rem;
  font-weight: 800;
}

.auth-security {
  margin-top: 18px;
  text-align: center;
  font-size: .82rem;
}

.eyebrow {
  color: #2f9e44;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-page {
  max-width: 860px;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.context-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  flex-wrap: wrap;
}

.context-switcher span {
  color: #52606d;
  font-size: .9rem;
  margin-right: 4px;
}

.context-switcher button,
.badge-link,
.link-button {
  border: 0;
  background: transparent;
  color: #1864ab;
  padding: 0;
}

.link-button.danger {
  color: #c92a2a;
}

.context-switcher button {
  border: 1px solid #bcccdc;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f8fafc;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tabs a {
  text-decoration: none;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  padding: 6px 12px;
  color: #334e68;
}

.tabs a.active {
  color: #ffffff;
  background: #1864ab;
  border-color: #1864ab;
}

.linked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
}

.grid-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.grid-actions form {
  margin: 0;
}

.icon-action {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334e68;
  background: #fff;
  text-decoration: none;
}

.icon-action:hover {
  color: #0b5c3b;
  border-color: #9fb3c8;
  background: #f8fafc;
}

.icon-action.disabled {
  color: #a0aab4;
  border-color: #e1e5e9;
  background: #f5f6f7;
  cursor: not-allowed;
}

.icon-action.danger {
  color: #c92a2a;
}

.icon-action.danger:hover {
  color: #9f1c1c;
  border-color: #f3b6b6;
  background: #fff5f5;
}

.icon-action svg {
  width: 17px;
  height: 17px;
}

.attachment-link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.attachment-link svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.attachment-kind {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  color: #334e68;
  background: #e6f4ee;
  font-size: .72rem;
  font-weight: 700;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e4e7eb;
  font-size: .85rem;
}

.status-paid,
.status-received {
  background: #d3f9d8;
}

.status-overdue {
  background: #ffe3e3;
}

.empty {
  color: #52606d;
  margin: 0;
}

.drop-zone {
  min-height: 190px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 26px;
  border: 2px dashed #9fb3c8;
  border-radius: 8px;
  color: #334e68;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.drag-over,
.drop-zone.uploading {
  border-color: #236e50;
  background: #eefaf4;
  box-shadow: 0 0 0 3px rgba(35, 110, 80, .12);
  outline: none;
}

.drop-zone.uploading {
  cursor: wait;
  opacity: .86;
}

.drop-zone svg {
  width: 34px;
  height: 34px;
  color: #236e50;
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone span {
  color: #52606d;
  font-size: .92rem;
}

.drop-zone-input {
  margin-top: 10px;
}

.drop-zone-files {
  width: min(560px, 100%);
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.drop-zone-files li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  font-size: .9rem;
}

.adsense-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  min-height: 90px;
  display: grid;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid #d9e2ec;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, .08);
}

.adsense-footer.with-sidebar {
  left: 248px;
}

.adsense-footer .adsbygoogle {
  width: min(970px, 100%);
  min-height: 90px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .grid-two,
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .auth-shell {
    place-items: end center;
    padding: 18px;
    background-position: 65% center;
  }

  .auth-panel {
    padding: 24px;
  }

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

@media (max-width: 700px) {
  .app-sidebar {
    width: 68px;
  }

  .app-main.with-sidebar {
    margin-left: 68px;
    padding: 20px 14px 118px;
  }

  .adsense-footer.with-sidebar {
    left: 68px;
  }

  .sidebar-brand {
    justify-content: center;
    min-height: 64px;
    padding: 0;
  }

  .sidebar-nav,
  .sidebar-footer {
    padding-left: 8px;
    padding-right: 8px;
  }

  .sidebar-link,
  .sidebar-context {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-label {
    display: none !important;
  }

  .page-header h1,
  .form-page h1 {
    font-size: 1.4rem;
  }
}
