:root {
  --mm-bg: #f4f7fb;
  --mm-surface: #ffffff;
  --mm-ink: #132238;
  --mm-muted: #66758a;
  --mm-line: #dce4ee;
  --mm-soft: #eef4fb;
  --mm-dark: #07111f;
  --mm-dark-2: #0c1b2f;
  --mm-primary: #1167d8;
  --mm-primary-2: #11b8a6;
  --mm-warning: #f0a020;
  --mm-danger: #d9364f;
  --mm-success: #14996f;
  --mm-radius: 8px;
  --mm-shadow: 0 14px 40px rgba(19, 34, 56, 0.10);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--mm-ink);
  background:
    linear-gradient(135deg, rgba(17, 103, 216, 0.08), rgba(17, 184, 166, 0.08) 42%, rgba(240, 160, 32, 0.05)),
    var(--mm-bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--mm-primary);
}

.mm-shell {
  min-height: 100vh;
  display: flex;
}

.mm-sidebar {
  position: sticky;
  top: 0;
  width: 284px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 20px 16px;
  color: #dbeafe;
  background:
    linear-gradient(180deg, rgba(18, 184, 166, 0.16), transparent 34%),
    linear-gradient(180deg, var(--mm-dark), var(--mm-dark-2));
  box-shadow: 10px 0 30px rgba(7, 17, 31, 0.18);
  z-index: 30;
}

.mm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 18px;
  color: #ffffff;
  text-decoration: none;
}

.mm-brand:hover {
  color: #ffffff;
}

.mm-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 209, 255, 0.40);
  border-radius: 8px;
  color: #dffcff;
  background: linear-gradient(135deg, var(--mm-primary), var(--mm-primary-2));
  font-weight: 800;
}

.mm-brand strong,
.mm-brand small {
  display: block;
}

.mm-brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.mm-brand small {
  margin-top: 3px;
  color: #9fb2cc;
  font-size: 0.78rem;
}

.mm-nav {
  overflow-y: auto;
  padding: 6px 0;
}

.mm-nav-group + .mm-nav-group {
  margin-top: 18px;
}

.mm-nav-label {
  padding: 0 10px 7px;
  color: #7f93b2;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mm-nav-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--mm-radius);
  color: #c7d6ea;
  text-decoration: none;
  font-weight: 650;
}

.mm-nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.mm-nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(17, 103, 216, 0.92), rgba(17, 184, 166, 0.72));
  box-shadow: 0 10px 24px rgba(17, 103, 216, 0.25);
}

.mm-nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #dffcff;
  background: rgba(255, 255, 255, 0.11);
  font-size: 0.72rem;
  font-weight: 800;
}

.mm-sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid rgba(148, 209, 255, 0.18);
  border-radius: var(--mm-radius);
  color: #b9c8df;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.mm-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--mm-primary-2);
  box-shadow: 0 0 0 4px rgba(17, 184, 166, 0.16);
}

.mm-setup-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(17, 103, 216, 0.18);
  border-radius: 999px;
  color: var(--mm-primary);
  background: rgba(17, 103, 216, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.mm-main {
  min-width: 0;
  flex: 1;
}

.mm-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 30px;
  border-bottom: 1px solid rgba(220, 228, 238, 0.86);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(16px);
}

.mm-topbar-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mm-topbar-title strong {
  font-size: 1.05rem;
}

.mm-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mm-user-pill {
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--mm-line);
  border-radius: var(--mm-radius);
  color: var(--mm-muted);
  background: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-mobile-toggle {
  display: none;
  width: 42px;
  height: 38px;
  border: 1px solid var(--mm-line);
  border-radius: var(--mm-radius);
  background: #ffffff;
}

.mm-mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--mm-ink);
}

.mm-content {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 28px 30px 44px;
}

.mm-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.mm-page-header h1 {
  margin: 2px 0 4px;
  font-size: clamp(1.55rem, 2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0;
}

.mm-page-header p {
  max-width: 760px;
  margin: 0;
  color: var(--mm-muted);
}

.mm-eyebrow {
  color: var(--mm-primary);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mm-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card {
  border: 1px solid rgba(220, 228, 238, 0.95);
  border-radius: var(--mm-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--mm-shadow);
}

.card.shadow-sm {
  box-shadow: var(--mm-shadow) !important;
}

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mm-line);
  border-radius: var(--mm-radius) var(--mm-radius) 0 0 !important;
  color: var(--mm-ink);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  font-weight: 750;
}

.card-body {
  padding: 18px;
}

.mm-hero {
  position: relative;
  overflow: hidden;
  border: 0;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(17, 103, 216, 0.94), rgba(8, 28, 50, 0.98) 58%, rgba(17, 184, 166, 0.84));
}

.mm-hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -48% 46%;
  height: 260px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12));
  transform: rotate(-12deg);
}

.mm-hero .card-body {
  position: relative;
  z-index: 1;
  padding: 24px;
}

.mm-hero h2,
.mm-hero p,
.mm-hero .text-muted {
  color: #ffffff !important;
}

.mm-hero p {
  opacity: 0.82;
}

.mm-hero .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.52);
}

.mm-stat-card {
  min-height: 126px;
}

.mm-stat-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mm-stat-label,
.text-muted.small {
  color: var(--mm-muted) !important;
  font-size: 0.78rem;
  font-weight: 700;
}

.display-6 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 820;
  letter-spacing: 0;
}

.badge {
  border-radius: 999px;
  padding: 0.42rem 0.62rem;
  font-weight: 700;
}

.text-bg-primary {
  background: rgba(17, 103, 216, 0.12) !important;
  color: #0b56b8 !important;
}

.text-bg-secondary {
  background: #eef2f7 !important;
  color: #536176 !important;
}

.text-bg-success {
  background: rgba(20, 153, 111, 0.13) !important;
  color: #08734f !important;
}

.text-bg-warning {
  background: rgba(240, 160, 32, 0.18) !important;
  color: #8a5b00 !important;
}

.text-bg-danger {
  background: rgba(217, 54, 79, 0.13) !important;
  color: #b52139 !important;
}

.btn {
  min-height: 36px;
  border-radius: var(--mm-radius);
  font-weight: 750;
}

.btn-sm {
  min-height: 32px;
}

.btn-primary {
  border-color: var(--mm-primary);
  background: linear-gradient(135deg, var(--mm-primary), #0b8ee8);
  box-shadow: 0 10px 18px rgba(17, 103, 216, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: #0a57ba;
  background: linear-gradient(135deg, #0a57ba, #087fd1);
}

.btn-outline-primary {
  border-color: rgba(17, 103, 216, 0.34);
  color: #0b56b8;
}

.btn-outline-primary:hover {
  border-color: var(--mm-primary);
  background: var(--mm-primary);
}

.btn-outline-secondary {
  border-color: var(--mm-line);
  color: #4f5f73;
  background: #ffffff;
}

.btn-outline-secondary:hover {
  border-color: #c7d3e1;
  color: var(--mm-ink);
  background: #f4f7fb;
}

.form-control,
.form-select {
  min-height: 40px;
  border-color: #ccd7e5;
  border-radius: var(--mm-radius);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: rgba(17, 103, 216, 0.64);
  box-shadow: 0 0 0 0.2rem rgba(17, 103, 216, 0.13);
}

.form-label {
  color: #35445a;
  font-size: 0.82rem;
  font-weight: 750;
}

.form-text {
  color: var(--mm-muted);
}

.form-check-input:checked {
  border-color: var(--mm-primary-2);
  background-color: var(--mm-primary-2);
}

.table-responsive {
  border-radius: 0 0 var(--mm-radius) var(--mm-radius);
}

.table {
  margin-bottom: 0;
  color: var(--mm-ink);
}

.table-responsive > .table {
  min-width: 860px;
}

.table th {
  padding: 12px 14px;
  color: #536176;
  background: #f7faff;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom-color: var(--mm-line);
  white-space: nowrap;
}

.table td {
  padding: 13px 14px;
  border-color: #edf2f7;
  vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: #fbfdff;
}

.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: #eef6ff;
}

.list-group-item {
  padding: 14px 16px;
  border-color: #edf2f7;
}

.sync-list {
  max-height: 22rem;
  overflow-y: auto;
}

.module-picker {
  max-height: 14rem;
  overflow-y: auto;
}

code,
.font-monospace {
  color: #0c4f9e;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.alert {
  border: 0;
  border-radius: var(--mm-radius);
  box-shadow: var(--mm-shadow);
}

.mm-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(17, 103, 216, 0.14), rgba(17, 184, 166, 0.08) 48%, rgba(240, 160, 32, 0.07)),
    var(--mm-bg);
}

.mm-login-shell {
  width: min(100%, 1040px);
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  overflow: hidden;
  border: 1px solid rgba(220, 228, 238, 0.95);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(19, 34, 56, 0.18);
}

.mm-login-info {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(17, 184, 166, 0.18), transparent 46%),
    linear-gradient(150deg, var(--mm-dark), #0f3157 62%, #0a796e);
}

.mm-login-info h1 {
  max-width: 520px;
  margin: 20px 0 12px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 850;
  letter-spacing: 0;
}

.mm-login-info p {
  max-width: 520px;
  color: #c7d6ea;
  font-size: 1rem;
}

.mm-login-points {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.mm-login-point {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--mm-radius);
  background: rgba(255, 255, 255, 0.06);
}

.mm-login-point span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mm-login-form {
  display: flex;
  align-items: center;
  padding: 34px;
}

.mm-login-form .card {
  width: 100%;
  border: 0;
  box-shadow: none;
}

.mm-home-panel {
  max-width: 900px;
  margin: 4rem auto;
}

@media (max-width: 1180px) {
  .mm-sidebar {
    position: fixed;
    transform: translateX(-104%);
    transition: transform 0.18s ease;
  }

  .mm-body.mm-nav-open .mm-sidebar {
    transform: translateX(0);
  }

  .mm-mobile-toggle {
    display: inline-block;
  }

  .mm-content,
  .mm-topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  .mm-login-body {
    padding: 12px;
    overflow-x: hidden;
  }

  .mm-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mm-topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .mm-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .mm-content {
    padding-top: 20px;
  }

  .card-body {
    padding: 16px;
  }

  .mm-login-shell {
    grid-template-columns: 1fr;
    width: min(680px, calc(100vw - 120px));
    width: min(680px, calc(100svw - 40px));
  }

  .mm-login-info {
    min-width: 0;
    min-height: auto;
    padding: 24px;
  }

  .mm-login-info h1,
  .mm-login-info p {
    overflow-wrap: anywhere;
  }

  .mm-login-form {
    min-width: 0;
    padding: 22px;
  }
}

@media (max-width: 480px) {
  .mm-login-body {
    place-items: start;
  }

  .mm-login-shell {
    justify-self: start;
    width: min(330px, calc(100vw - 32px));
    margin-left: 8px;
  }

  .mm-login-info,
  .mm-login-form {
    padding: 20px;
  }
}
