:root {
  --brand-blue: #1f5fa8;
  --brand-blue-2: #2e7bdc;
  --success-green: #2eaf6f;
  --danger-red: #e45757;
  --bg-soft: #f3f6fb;
  --text-main: #1f2937;
  --text-soft: #6b7280;
  --panel-radius: 12px;
  --panel-shadow: 0 8px 22px rgba(31, 56, 88, 0.08);
  --panel-border: #e6ebf3;
}

body,
.app-shell {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-soft);
  color: var(--text-main);
  min-height: 100vh;
}

.app-content {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.topbar {
  background: linear-gradient(90deg, #1f5fa8 0%, #2a68b3 100%);
  min-height: 68px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.topbar .navbar-brand,
.topbar .nav-link {
  color: rgba(255, 255, 255, 0.88);
}

.brand-logo {
  height: 90px;
  width: auto;
  max-width: 480px;
  object-fit: contain;
  display: block;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  filter:
    drop-shadow(1px 0 0 #fff)
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 -1px 0 #fff);
}

.login-logo {
  height: 110px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.topbar .nav-link {
  font-weight: 600;
  margin-right: 0.15rem;
  border-radius: 12px;
  padding: 0.5rem 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.topbar .nav-link:hover,
.topbar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.topbar-nav-group {
  gap: 0.2rem;
}

.topbar-nav-group .nav-link.active {
  background: #fff;
  color: var(--brand-blue);
  box-shadow: 0 8px 20px rgba(20, 52, 89, 0.28);
}

.topbar-nav-group .nav-link i {
  font-size: 0.9rem;
  opacity: 0.95;
}

.company-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #1f4f8c;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 4px 12px rgba(26, 64, 107, 0.22);
}

.navbar-toggler {
  background: rgba(255, 255, 255, 0.86);
}

.btn-user {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.92rem;
}

.btn-user:hover,
.btn-user:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.panel,
.card-soft,
.table-card {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
}

.card-highlight {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
}

.panel-body {
  padding: 1rem 1.25rem 1.25rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.profile-header .section-subtitle {
  font-size: 0.92rem;
}

.profile-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.profile-card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf4ff;
  color: var(--brand-blue-2);
  font-size: 1.7rem;
}

.profile-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-meta {
  display: grid;
  gap: 0.55rem;
}

.profile-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e5ebf5;
  background: #fff;
}

.profile-meta-item span {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6f7f92;
  font-weight: 700;
}

.profile-meta-item strong {
  font-size: 0.95rem;
  color: #1c304b;
  font-weight: 700;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.profile-edit-form {
  padding: 1rem;
  border: 1px solid #e4eaf4;
  border-radius: 12px;
  background: #f8fbff;
}

.profile-store-form {
  padding: 1rem 1.25rem;
  border-top: 1px solid #e8eef7;
  border-bottom: 1px solid #e8eef7;
  background: #f8fbff;
}

.profile-memberships-table td {
  vertical-align: middle;
}

.card-metric,
.metric-card {
  border-radius: var(--panel-radius);
  color: #fff;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 20px rgba(31, 56, 88, 0.14);
}

.card-metric--success {
  background: linear-gradient(135deg, #28a764 0%, var(--success-green) 100%);
}

.card-metric--danger {
  background: linear-gradient(135deg, #db4a4a 0%, var(--danger-red) 100%);
}

.card-metric--info {
  background: linear-gradient(135deg, #2a70ca 0%, var(--brand-blue-2) 100%);
}

.card-metric__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  opacity: 0.95;
}

.card-metric__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.card-metric__value,
.metric-value {
  margin-top: 0.7rem;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
}

.metric-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.panel .table,
.table-card .table {
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.8rem 0.9rem;
}

.table thead th {
  background: #f2f5fa;
  color: #526072;
  font-weight: 700;
  border-bottom: 1px solid #e5eaf2;
  white-space: nowrap;
}

.table tbody tr {
  border-bottom-color: #eef2f7;
}

.table tbody tr:hover {
  background: #f9fbff;
}

.dfc-sheet-table .dfc-sheet-category {
  white-space: nowrap;
  min-width: 280px;
}

.dfc-sheet-root {
  background: #f6f9ff;
}

.dfc-sheet-group {
  background: #fbfdff;
}

.dfc-sheet-level-0 td {
  background: #eef4ff;
  font-weight: 700;
  text-transform: uppercase;
}

.dfc-sheet-level-1 td {
  background: #f7faff;
  font-weight: 600;
}

.dfc-sheet-table tfoot th {
  background: #f0f4fb;
  border-top: 2px solid #dbe5f3;
}

.money-positive {
  color: var(--success-green);
  font-weight: 700;
}

.money-negative {
  color: var(--danger-red);
  font-weight: 700;
}

.money-neutral {
  color: var(--brand-blue-2);
  font-weight: 700;
}

.form-control,
.form-select {
  border-color: #dbe3ef;
  border-radius: 10px;
  min-height: 42px;
}

.form-control:focus,
.form-select:focus {
  border-color: #8eb4ea;
  box-shadow: 0 0 0 0.18rem rgba(46, 123, 220, 0.15);
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}

.btn-primary {
  background: var(--brand-blue-2);
  border-color: var(--brand-blue-2);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #236cbe;
  border-color: #236cbe;
}

.btn-outline-primary {
  color: var(--brand-blue-2);
  border-color: #93b8ea;
}

.result-list {
  display: grid;
  gap: 0.55rem;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f9fd;
  border: 1px solid #e7ecf5;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.result-item__label {
  color: #4f5f72;
  font-size: 0.9rem;
}

.result-item__value {
  font-weight: 700;
}

.history-table {
  font-size: 0.86rem;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.anchor-offset {
  scroll-margin-top: 90px;
}

.pagination .page-link {
  border-radius: 8px;
  margin-right: 0.25rem;
  border-color: #d7e1ee;
  color: #3f5470;
}

.pagination .page-item.active .page-link {
  background: var(--brand-blue-2);
  border-color: var(--brand-blue-2);
}

.bg-finance {
  background: var(--bg-soft);
}

.login-page {
  background-color: #e9f0fb;
  background-image:
    linear-gradient(130deg, rgba(14, 47, 95, 0.46) 0%, rgba(14, 47, 95, 0.22) 48%, rgba(14, 47, 95, 0.12) 100%),
    url("../img/tela_login.png?v=1");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

.login-page .card-soft {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #d4e0f2;
  box-shadow: 0 18px 46px rgba(16, 40, 78, 0.2);
  backdrop-filter: blur(2px);
}

.login-page .topbar-blue {
  background: linear-gradient(90deg, #1b4f96 0%, #255ea9 100%);
}

.login-page .form-control {
  background: #fdfefe;
  border-color: #cfdaeb;
}

.login-page .btn-primary {
  background: linear-gradient(135deg, #2e7bdc 0%, #226cc8 100%);
  border-color: #256fc8;
}

.login-page .btn-primary:hover,
.login-page .btn-primary:focus {
  background: linear-gradient(135deg, #256fc8 0%, #1f5fa8 100%);
  border-color: #205fa6;
}

.login-theme-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.login-theme-picker__label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #54719a;
  font-weight: 700;
}

.login-theme-picker__group .btn {
  border-radius: 999px;
  padding-inline: 0.75rem;
}

.login-theme-picker__group .btn.active {
  background: #2e7bdc;
  border-color: #2e7bdc;
  color: #fff;
  box-shadow: 0 8px 18px rgba(30, 82, 151, 0.28);
}

.login-theme-dark {
  background-color: #0c1a32;
  background-image:
    linear-gradient(140deg, rgba(6, 16, 32, 0.84) 0%, rgba(8, 20, 40, 0.62) 52%, rgba(8, 20, 40, 0.52) 100%),
    url("../img/tela_login.png?v=1");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

.login-theme-dark .topbar-blue {
  background: linear-gradient(90deg, #0f2d58 0%, #17437d 100%);
}

.login-theme-dark .card-soft {
  background: rgba(12, 27, 52, 0.9);
  border: 1px solid #2e456b;
  box-shadow: 0 20px 50px rgba(4, 10, 20, 0.45);
}

.login-theme-dark h1,
.login-theme-dark label,
.login-theme-dark .form-check-label {
  color: #e7effc !important;
}

.login-theme-dark .text-muted {
  color: #a7bad8 !important;
}

.login-theme-dark .login-theme-picker__label {
  color: #9fb6da;
}

.login-theme-dark .login-theme-picker__group .btn.active {
  background: #3d88e4;
  border-color: #3d88e4;
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 19, 37, 0.45);
}

.login-theme-dark .form-control {
  background: #102440;
  border-color: #35557f;
  color: #edf3ff;
}

.login-theme-dark .form-control::placeholder {
  color: #a6b7d1;
}

.login-theme-dark .form-control:focus {
  border-color: #73a8ff;
  box-shadow: 0 0 0 0.18rem rgba(95, 153, 244, 0.25);
}

.login-theme-dark .btn-outline-primary {
  color: #c9dcff;
  border-color: #557eb7;
}

.login-theme-dark .btn-outline-primary:hover,
.login-theme-dark .btn-outline-primary:focus {
  color: #eaf2ff;
  border-color: #82a7d8;
  background: rgba(122, 162, 218, 0.15);
}

.login-theme-dark .btn-primary {
  background: linear-gradient(135deg, #2e7bdc 0%, #285fb4 100%);
  border-color: #2d69c3;
}

.login-theme-dark .btn-primary:hover,
.login-theme-dark .btn-primary:focus {
  background: linear-gradient(135deg, #3178d1 0%, #2c5aa2 100%);
  border-color: #3b72bf;
}

.login-theme-dark .alert-danger {
  background: #3a1c27;
  color: #ffd4dd;
  border-color: #6d3344;
}

.topbar-blue {
  background: var(--brand-blue);
}

.badge-status-pendente {
  background: #fff7e6;
  color: #7c4f00;
}

.badge-status-aceito {
  background: #e8f9ef;
  color: #11643a;
}

.badge-status-expirado,
.badge-status-suspenso {
  background: #fdecec;
  color: #8b1f1f;
}

@media (max-width: 991.98px) {
  .app-content {
    padding-top: 1rem;
  }

  .topbar .navbar-collapse {
    margin-top: 0.7rem;
    border-radius: 14px;
    padding: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(11, 47, 93, 0.28);
  }

  .topbar-nav-group {
    gap: 0.3rem;
  }

  .topbar .nav-link {
    margin-right: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .card-metric,
  .metric-card {
    min-height: 102px;
  }

  .card-metric__value,
  .metric-value {
    font-size: 1.25rem;
  }

  .chart-wrap {
    height: 240px;
  }
}

@media (max-width: 767.98px) {
  .brand-logo {
    height: 66px;
    max-width: 340px;
  }

  .login-logo {
    height: 86px;
  }

  .topbar .navbar-brand span {
    font-size: 1rem;
  }

  .table-responsive {
    overflow-x: auto;
  }
}
