/* Shell: sidebar + topbar + layout */

.mt-app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

/* Sidebar */
.mt-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.mt-side__brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.mt-side__logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-soft);
}
.mt-side__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}
.mt-side__sub {
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.mt-side__nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 16px;
}
.mt-side__group { margin-bottom: 14px; }
.mt-side__section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 10px 10px 6px;
}
.mt-side__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-muted);
  text-align: left;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.mt-side__item > span:not(.mt-side__badge) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-side__item { min-width: 0; }
.mt-side__item:hover { background: var(--bg-inset); color: var(--ink); }
.mt-side__item.is-active {
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
  font-weight: 500;
}
.mt-side__item svg { opacity: 0.8; }
.mt-side__item.is-active svg { opacity: 1; }
.mt-side__soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-faint);
  background: var(--bg-inset);
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mt-side__item.is-soon { opacity: 0.55; cursor: not-allowed; }
.mt-side__item.is-soon:hover { background: transparent; color: var(--ink-muted); }
.mt-side__badge {
  margin-left: auto;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.mt-side__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.mt-side__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--viz-4), var(--viz-3));
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
}
.mt-side__whoName { font-size: 13px; font-weight: 500; color: var(--ink-strong); }
.mt-side__whoRole { font-size: 11px; color: var(--ink-muted); }

/* Topbar */
.mt-main { display: flex; flex-direction: column; min-width: 0; }
.mt-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px 32px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.mt-top__crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.mt-top__crumbs .is-current { color: var(--ink); }
.mt-top__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  margin: 0;
  line-height: 1.1;
}
.mt-top__sub {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
}
.mt-top__right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mt-top__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  min-width: 280px;
  color: var(--ink-muted);
  transition: border-color 0.15s;
}
.mt-top__search:focus-within { border-color: var(--brand); }
.mt-top__search input {
  border: 0; outline: 0; background: transparent;
  font-size: 13px; flex: 1; color: var(--ink);
}
.mt-top__search input::placeholder { color: var(--ink-faint); }
.mt-top__search kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  background: var(--bg-inset);
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

.mt-iconbtn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  position: relative;
  transition: all 0.1s;
}
.mt-iconbtn:hover { color: var(--ink); border-color: var(--border-strong); }
.mt-iconbtn__dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--bg-elev);
}

/* Page container */
.mt-page {
  padding: 28px 32px 56px;
  max-width: 1400px;
  width: 100%;
}

/* Buttons */
.mt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}
.mt-btn--primary {
  background: var(--brand);
  color: var(--brand-ink);
}
.mt-btn--primary:hover { background: var(--brand-deep); }
.mt-btn--ghost {
  background: var(--bg-elev);
  color: var(--ink);
  border-color: var(--border);
}
.mt-btn--ghost:hover { border-color: var(--border-strong); background: var(--bg-inset); }
.mt-btn--subtle {
  color: var(--ink-muted);
  padding: 6px 10px;
}
.mt-btn--subtle:hover { color: var(--ink); background: var(--bg-inset); }
.mt-btn--danger {
  color: var(--danger);
  border-color: var(--danger-soft);
  background: var(--bg-elev);
}
.mt-btn--danger:hover { background: var(--danger-soft); }

/* Card */
.mt-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.mt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.mt-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.mt-card__sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.mt-card__body { padding: 16px 18px; }

/* Pill / badge */
.mt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.mt-pill--brand { background: var(--brand-soft); color: var(--brand-soft-ink); }
.mt-pill--ok { background: var(--ok-soft); color: var(--ok); }
.mt-pill--warn { background: var(--warn-soft); color: var(--warn); }
.mt-pill--danger { background: var(--danger-soft); color: var(--danger); }
.mt-pill--info { background: var(--info-soft); color: var(--info); }
.mt-pill--ghost { background: var(--bg-inset); color: var(--ink-muted); }
.mt-pill--outline { border-color: var(--border); color: var(--ink-muted); }

/* Utility */
.mt-row { display: flex; gap: 12px; align-items: center; }
.mt-col { display: flex; flex-direction: column; gap: 12px; }
.mt-grid { display: grid; gap: 12px; }
.mt-divider { height: 1px; background: var(--border); margin: 12px 0; }
.mt-stack > * + * { margin-top: 12px; }
.mt-mono { font-family: var(--font-mono); font-size: 12px; }

/* Tweaks panel */
.mt-tweaks {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  min-width: 240px;
  display: none;
}
.mt-tweaks.is-open { display: block; }
.mt-tweaks__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mt-tweaks__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.mt-tweaks__row:first-of-type { border-top: 0; }
.mt-seg {
  display: inline-flex;
  background: var(--bg-inset);
  border-radius: 6px;
  padding: 2px;
  gap: 0;
}
.mt-seg button {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--ink-muted);
}
.mt-seg button.is-active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
