:root {
  --mh-bg: #f6f1eb;
  --mh-surface: #fffcfa;
  --mh-card: #ffffff;
  --mh-text: #2b2421;
  --mh-muted: #8a7670;
  --mh-primary: #9c5a62;
  --mh-primary-dark: #7f444b;
  --mh-accent: #d9b17a;
  --mh-border: rgba(156, 90, 98, 0.18);
  --mh-shadow: 0 8px 28px rgba(43, 36, 33, 0.08);
  --mh-bottom-nav-h: 70px;
}

body {
  font-family: "Manrope", system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(217, 177, 122, 0.22), transparent 48%),
    linear-gradient(180deg, var(--mh-surface) 0%, var(--mh-bg) 100%);
  color: var(--mh-text);
  min-height: 100dvh;
  padding-bottom: calc(var(--mh-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

.app-header {
  background: linear-gradient(110deg, #5f343a 0%, var(--mh-primary-dark) 38%, var(--mh-primary) 100%);
  color: #fff;
  box-shadow: var(--mh-shadow);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.app-header h1,
h2,
h3,
.nav-link {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.02em;
}

.app-header h1 {
  font-size: 2rem;
}

.app-header .text-muted {
  color: rgba(255, 255, 255, 0.82) !important;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.24));
}

.brand-fallback {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  color: var(--mh-primary-dark);
  font-weight: 700;
  font-size: 1.2rem;
}

.nav-pills .nav-link {
  background: rgba(255, 255, 255, 0.86);
  color: #5f343a;
  border: 1px solid #ecd8d2;
  border-radius: 999px;
  font-size: 1.15rem;
  padding: 0.45rem 1rem;
}

.nav-pills .nav-link.active {
  background: linear-gradient(120deg, var(--mh-primary-dark), var(--mh-primary));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 16px rgba(127, 68, 75, 0.22);
}

.mh-header-nav .nav-link {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  font-size: 1rem;
}

.mh-header-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

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

.mh-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--mh-bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 252, 250, 0.98);
  border-top: 1px solid #ead9d2;
  z-index: 1030;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  box-shadow: 0 -4px 22px rgba(43, 36, 33, 0.08);
}

.mh-bnav-item {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--mh-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mh-bnav-item i {
  font-size: 1.2rem;
  line-height: 1;
}

.mh-bnav-item.active {
  color: var(--mh-primary-dark);
}

.mh-bnav-item:active {
  background: rgba(156, 90, 98, 0.08);
}

@media (max-width: 575.98px) {
  .app-header .container {
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    padding-top: 0.7rem !important;
    padding-bottom: 0.7rem !important;
  }

  .app-header-main {
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.55rem !important;
  }

  .app-header-main > div:last-child {
    min-width: 0;
  }

  .app-header h1 {
    font-size: 1.45rem;
    line-height: 1;
  }

  .app-header .text-muted {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-logo,
  .brand-fallback {
    width: 48px;
    height: 48px;
  }

  .header-data-menu {
    flex: 0 0 auto;
  }

  .btn-data-menu {
    font-size: 0.75rem;
    padding: 0.22rem 0.46rem;
    border-radius: 8px;
    line-height: 1.15;
    white-space: nowrap;
  }
}

.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

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

.kpi-card {
  background: var(--mh-card);
  border: 1px solid var(--mh-border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 4px 14px rgba(43, 36, 33, 0.05);
}

.kpi-label {
  margin: 0;
  color: var(--mh-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.kpi-value {
  margin: 0.25rem 0 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--mh-primary-dark);
}

.card {
  border: 1px solid var(--mh-border);
  border-radius: 16px;
  background: var(--mh-card);
  box-shadow: 0 4px 14px rgba(43, 36, 33, 0.05);
}

.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  border-bottom-color: #efdfda;
}

.table thead th {
  color: #6f5651;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control,
.form-select {
  border-color: #ead9d2;
  border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(156, 90, 98, 0.48);
  box-shadow: 0 0 0 0.2rem rgba(156, 90, 98, 0.14);
}

.btn-primary {
  background: linear-gradient(120deg, var(--mh-primary-dark), var(--mh-primary));
  border: 0;
  border-radius: 10px;
  font-weight: 600;
}

.btn-primary:hover {
  background: linear-gradient(120deg, #6e3b42, var(--mh-primary-dark));
}

.badge-soft {
  background: #f8e9dd;
  color: #85524a;
  border: 1px solid #edd6c9;
}
