:root {
  --mm-primary: #4c6ef5;
  --mm-primary-dark: #364fc7;
  --mm-secondary: #15aabf;
  --mm-accent: #f76707;
  --mm-success: #12b886;
  --mm-bg: #f4f6fb;
  --mm-surface: #ffffff;
  --mm-border: #e5e9f2;
  --mm-muted: #6c757d;
  --mm-text: #1f2937;
  --mm-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--mm-bg);
  color: var(--mm-text);
  min-height: 100vh;
}

body.app-body {
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--mm-primary);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1040;
}

.navbar .navbar-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mm-primary), var(--mm-secondary));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.sidebar {
  min-height: calc(100vh - 76px);
  padding: 2.5rem 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border-right: 1px solid var(--mm-border);
  position: sticky;
  top: 76px;
  gap: 1rem;
}

.sidebar .nav-link {
  border-radius: 16px;
  padding: 0.85rem;
  color: var(--mm-muted);
  transition: all 0.2s ease-in-out;
  background-color: transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
  color: var(--mm-primary);
  background-color: rgba(76, 110, 245, 0.08);
  box-shadow: inset 0 0 0 1px rgba(76, 110, 245, 0.16);
}

.sidebar .nav-link.active {
  color: var(--mm-primary);
  background-color: rgba(76, 110, 245, 0.12);
  box-shadow: inset 0 0 0 1px rgba(76, 110, 245, 0.24);
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(76, 110, 245, 0.1);
  color: var(--mm-primary);
  font-size: 1.2rem;
}

.content-area {
  background-color: transparent;
}

.page-header h1 {
  font-weight: 600;
}

.card {
  border-radius: 18px;
  border: 1px solid rgba(229, 233, 242, 0.85);
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--mm-shadow);
}

.highlight-card {
  background: radial-gradient(circle at top, rgba(76, 110, 245, 0.08), rgba(21, 170, 191, 0.08) 45%, #ffffff 85%);
}

.table-modern table {
  width: 100%;
  margin-bottom: 0;
  color: inherit;
}

.table-modern table td,
.table-modern table th {
  padding: 0.5rem 0.75rem;
  border-color: rgba(229, 233, 242, 0.65);
  vertical-align: middle;
}

.table-modern table tr.table-primary,
.table-modern table tr.table-secondary,
.table-modern table tr.table-danger,
.table-modern table tr.table-success,
.table-modern table tr.table-warning {
  border-radius: 12px;
}

.transaction-feed h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.transaction-feed table {
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(229, 233, 242, 0.8);
  overflow: hidden;
}

.transaction-feed table:last-child {
  margin-bottom: 0;
}

.transaction-preview dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mm-muted);
  margin-bottom: 0.25rem;
}

.transaction-preview dd {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--mm-text);
}

.info-tile {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background-color: rgba(76, 110, 245, 0.06);
  border: 1px solid rgba(76, 110, 245, 0.12);
}

.status-output,
#infobar,
#infobarCash {
  min-height: 2rem;
}

.status-output .spinner-border,
#infobar .spinner-border,
#infobarCash .spinner-border {
  width: 1.8rem;
  height: 1.8rem;
  border-width: 0.2rem;
}

.chart-wrapper {
  position: relative;
  min-height: 280px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.app-footer {
  margin-top: auto;
}

.btn-primary {
  background: linear-gradient(135deg, var(--mm-primary), var(--mm-secondary));
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--mm-primary-dark), var(--mm-secondary));
}

.btn-outline-primary {
  border-radius: 999px;
  border-color: rgba(76, 110, 245, 0.4);
  color: var(--mm-primary);
}

.btn-outline-primary:hover {
  border-color: var(--mm-primary);
  background-color: rgba(76, 110, 245, 0.08);
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(76, 110, 245, 0.16), transparent 55%), radial-gradient(circle at 80% 30%, rgba(21, 170, 191, 0.12), transparent 50%), var(--mm-bg);
  min-height: 100vh;
}

.auth-wrapper {
  max-width: 380px;
  width: 100%;
  padding: 1.5rem;
}

.auth-card {
  border-radius: 20px;
  box-shadow: var(--mm-shadow);
  border: none;
  background-color: var(--mm-surface);
}

@media (max-width: 991.98px) {
  .navbar {
    position: relative;
  }

  .content-area {
    padding: 2rem 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .card {
    border-radius: 16px;
  }

  .transaction-preview dt {
    font-size: 0.7rem;
  }
}