:root {
  --mm-font: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --mm-panel: #ffffff;
  --mm-text: #0f172a;
  --mm-muted: #64748b;
  --mm-line: #e2e8f0;
  --mm-radius: 16px;
  --mm-shadow: 0 16px 40px rgba(2, 6, 23, 0.12);
  --mm-bg: linear-gradient(145deg, #0b1224 0%, #101d39 45%, #132442 100%);
}

html { font-size: 16px; }

body {
  font-family: var(--mm-font) !important;
  background: var(--mm-bg) !important;
  color: #f8fafc;
  line-height: 1.45;
  font-size: 1rem !important;
}

.shell {
  gap: 1rem !important;
  align-items: start !important;
}

.sidebar,
.panel {
  border-radius: var(--mm-radius) !important;
}

.content {
  min-width: 0;
}

/* Keep sidebar visually consistent regardless of right-column content length */
@media (min-width: 981px) {
  .sidebar {
    position: sticky !important;
    top: 1rem !important;
    align-self: start !important;
    height: calc(100dvh - 2rem) !important;
    max-height: calc(100dvh - 2rem) !important;
    min-height: calc(100dvh - 2rem) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
}

.panel {
  background: var(--mm-panel) !important;
  color: var(--mm-text) !important;
  border: 1px solid var(--mm-line) !important;
  box-shadow: var(--mm-shadow) !important;
}

.header {
  padding: 1.15rem 1.25rem !important;
  gap: .8rem !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
}

.header > :last-child {
  justify-self: end;
}

.title {
  margin: 0 !important;
  font-size: 1.34rem !important;
  color: #0b213f !important;
  letter-spacing: .1px;
}

.subtitle {
  margin: .22rem 0 0 !important;
  color: var(--mm-muted) !important;
  font-size: .94rem !important;
}

h2 {
  margin: 0 0 .75rem !important;
  font-size: 1rem !important;
  color: #0b213f !important;
}

h3 {
  margin: 0 0 .55rem !important;
  font-size: .95rem !important;
  color: #0b213f !important;
}

p {
  font-size: .92rem;
}

.section {
  padding: 1rem 1.2rem 1.2rem !important;
}

.nav a {
  font-size: .93rem !important;
  padding: .62rem .72rem !important;
  border-radius: 10px !important;
}

label {
  font-size: .82rem !important;
  color: #334155 !important;
  margin: .45rem 0 .22rem !important;
}

input,
select,
textarea {
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  padding: .56rem .65rem !important;
  font-size: .9rem !important;
  font-family: var(--mm-font) !important;
  background: #fff !important;
}

.btn,
.small-btn,
.tiny {
  border-radius: 9px !important;
  font-size: .84rem !important;
  padding: .52rem .72rem !important;
  font-weight: 600 !important;
}

.notice {
  margin: 0 1.2rem 1rem !important;
  border-radius: 10px !important;
  padding: .65rem .82rem !important;
  font-size: .9rem !important;
}

.table-wrap table,
table {
  font-size: .89rem !important;
}

th {
  font-size: .77rem !important;
  letter-spacing: .04em !important;
}

th, td {
  padding: .58rem .42rem !important;
  border-bottom: 1px solid var(--mm-line) !important;
}

.chip {
  font-size: .74rem !important;
  padding: .18rem .48rem !important;
  border-radius: 999px !important;
}

.userbox {
  font-size: .84rem !important;
  gap: .55rem !important;
  white-space: nowrap;
}

.logout {
  font-size: .81rem !important;
  border-radius: 8px !important;
  padding: .34rem .6rem !important;
}

.footer-note,
.legal {
  font-size: .78rem !important;
}

@media (max-width: 980px) {
  .header {
    grid-template-columns: 1fr !important;
  }

  .header > :last-child {
    justify-self: start;
  }

  .userbox {
    white-space: normal;
  }

  .shell {
    align-items: start !important;
  }

  .sidebar {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
}

@media (max-width: 560px) {
  .header { padding: 1rem !important; }
  .section { padding: .9rem !important; }
}
