/* ==========================================================================
   Mentorfolio — design system
   A single stylesheet shared by the public site, the learner dashboard,
   the mentor panel and the admin panel.
   ========================================================================== */

:root {
  --rm-bg: #f6f7fb;
  --rm-surface: #ffffff;
  --rm-surface-alt: #f1f3f9;
  --rm-border: #e4e7f0;
  --rm-border-strong: #cfd4e3;

  --rm-text: #141824;
  --rm-text-soft: #5b6478;
  --rm-text-mute: #8a92a6;

  --rm-primary: #4f46e5;
  --rm-primary-dark: #4338ca;
  --rm-primary-soft: #eef0ff;
  --rm-accent: #0ea5a4;
  --rm-accent-soft: #e4f7f6;
  --rm-warn: #b45309;
  --rm-warn-soft: #fef3c7;
  --rm-danger: #dc2626;
  --rm-danger-soft: #fee2e2;
  --rm-success: #15803d;
  --rm-success-soft: #dcfce7;

  --rm-radius: 14px;
  --rm-radius-sm: 9px;
  --rm-radius-lg: 22px;
  --rm-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --rm-shadow-lg: 0 24px 60px rgba(16, 24, 40, .12);

  --rm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --rm-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --rm-container: 1200px;
  --rm-header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--rm-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--rm-text);
  background: var(--rm-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--rm-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.15rem; }

.container { width: 100%; max-width: var(--rm-container); margin: 0 auto; padding: 0 20px; }
.main { min-height: 62vh; padding-bottom: 56px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rm-border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 20px;
  min-height: var(--rm-header-h);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--rm-text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--rm-primary), #7c3aed);
  color: #fff; font-size: .95rem; font-weight: 800;
}
.brand__text { font-size: 1.06rem; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.site-nav__link {
  padding: 8px 12px; border-radius: var(--rm-radius-sm);
  color: var(--rm-text-soft); font-weight: 500; font-size: .93rem;
}
.site-nav__link:hover { background: var(--rm-surface-alt); color: var(--rm-text); text-decoration: none; }
.site-nav__link.is-active { color: var(--rm-primary); background: var(--rm-primary-soft); }

.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle__bar { display: block; width: 20px; height: 2px; background: var(--rm-text); margin: 4px 0; border-radius: 2px; }

.locale-switch__select {
  border: 1px solid var(--rm-border); background: var(--rm-surface);
  border-radius: var(--rm-radius-sm); padding: 6px 8px; font: inherit; font-size: .85rem; color: var(--rm-text-soft);
}

.account-menu { position: relative; }
.account-menu__trigger {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--rm-border); border-radius: 999px;
  padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; color: var(--rm-text);
}
.account-menu__name { font-size: .88rem; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--rm-surface); border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius); box-shadow: var(--rm-shadow-lg);
  padding: 6px; display: none; z-index: 60;
}
.account-menu.is-open .account-menu__panel { display: block; }
.account-menu__panel a, .account-menu__panel button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--rm-radius-sm);
  background: none; border: 0; font: inherit; font-size: .9rem; color: var(--rm-text); cursor: pointer;
}
.account-menu__panel a:hover, .account-menu__panel button:hover { background: var(--rm-surface-alt); text-decoration: none; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--rm-primary); color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, .28); }
.btn--primary:hover { background: var(--rm-primary-dark); }
.btn--ghost { background: transparent; border-color: var(--rm-border-strong); color: var(--rm-text); }
.btn--ghost:hover { background: var(--rm-surface-alt); }
.btn--soft { background: var(--rm-primary-soft); color: var(--rm-primary-dark); }
.btn--danger { background: var(--rm-danger); color: #fff; }
.btn--success { background: var(--rm-success); color: #fff; }
.btn--sm { padding: 7px 13px; font-size: .84rem; }
.btn--lg { padding: 13px 26px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  box-shadow: var(--rm-shadow);
}
.card__body { padding: 20px; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--rm-border);
}
.card__title { margin: 0; font-size: 1rem; font-weight: 700; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--rm-border); background: var(--rm-surface-alt); }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 320px; }
.grid--main { grid-template-columns: 280px minmax(0, 1fr); }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 7vw, 96px) 0;
  background:
    radial-gradient(1100px 460px at 12% -10%, rgba(124, 58, 237, .16), transparent 60%),
    radial-gradient(900px 420px at 92% 8%, rgba(14, 165, 164, .16), transparent 62%),
    linear-gradient(180deg, #fbfbff, var(--rm-bg));
}
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--rm-primary-soft); color: var(--rm-primary-dark);
  font-size: .82rem; font-weight: 600; margin-bottom: 18px;
}
.hero__lead { font-size: 1.06rem; color: var(--rm-text-soft); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero__panel { background: var(--rm-surface); border: 1px solid var(--rm-border); border-radius: var(--rm-radius-lg); box-shadow: var(--rm-shadow-lg); padding: 24px; }
.hero__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.hero__stat { background: var(--rm-surface-alt); border-radius: var(--rm-radius); padding: 14px; }
.hero__stat b { display: block; font-size: 1.35rem; }
.hero__stat span { font-size: .82rem; color: var(--rm-text-soft); }

/* ---------------------------------------------------------------- sections */

.section { padding: clamp(40px, 5vw, 72px) 0; }
.section--tight { padding: 28px 0; }
.section__head { max-width: 64ch; margin-bottom: 30px; }
.section__head p { color: var(--rm-text-soft); margin: 0; }
.section__title { margin-bottom: 8px; }
.eyebrow {
  display: inline-block; margin-bottom: 10px;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rm-primary);
}

/* ---------------------------------------------------------------- tutor card */

.tutor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.tutor-card {
  display: flex; flex-direction: column;
  background: var(--rm-surface); border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius); overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tutor-card:hover { transform: translateY(-3px); box-shadow: var(--rm-shadow-lg); border-color: var(--rm-border-strong); text-decoration: none; }
.tutor-card__top { display: flex; gap: 14px; padding: 18px 18px 12px; }
.tutor-card__name { margin: 0; font-size: 1rem; }
.tutor-card__headline { margin: 2px 0 0; color: var(--rm-text-soft); font-size: .87rem; }
.tutor-card__tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.tutor-card__foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--rm-border); background: var(--rm-surface-alt);
}
.tutor-card__price { font-weight: 700; }
.tutor-card__price small { font-weight: 500; color: var(--rm-text-mute); }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rm-primary), #7c3aed);
  color: #fff; font-weight: 700; font-size: 1.05rem;
}
.avatar--sm { width: 30px; height: 30px; font-size: .78rem; }
.avatar--lg { width: 92px; height: 92px; font-size: 1.8rem; }

.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  background: var(--rm-surface-alt); border: 1px solid var(--rm-border);
  font-size: .78rem; color: var(--rm-text-soft);
}
.tag--primary { background: var(--rm-primary-soft); border-color: transparent; color: var(--rm-primary-dark); }
.tag--accent { background: var(--rm-accent-soft); border-color: transparent; color: #0f766e; }
.tag--warn { background: var(--rm-warn-soft); border-color: transparent; color: var(--rm-warn); }
.tag--danger { background: var(--rm-danger-soft); border-color: transparent; color: var(--rm-danger); }
.tag--success { background: var(--rm-success-soft); border-color: transparent; color: var(--rm-success); }

.rating { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; }
.rating__star { color: #f59e0b; }

/* ---------------------------------------------------------------- forms */

.field { margin-bottom: 16px; }
.field__label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; color: var(--rm-text-soft); }
.field__hint { margin-top: 5px; font-size: .78rem; color: var(--rm-text-mute); }
.field__error { margin-top: 5px; font-size: .8rem; color: var(--rm-danger); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--rm-border-strong); border-radius: var(--rm-radius-sm);
  background: var(--rm-surface); font: inherit; font-size: .93rem; color: var(--rm-text);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--rm-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6478' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.checkbox, .radio { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; }
.checkbox input, .radio input { margin-top: 3px; accent-color: var(--rm-primary); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.auth-card { max-width: 460px; margin: 56px auto; }
.auth-card__head { text-align: center; margin-bottom: 26px; }
.auth-card__head p { color: var(--rm-text-soft); }
.auth-alt { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--rm-text-soft); }
.role-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-option { position: relative; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option span {
  display: block; text-align: center; padding: 10px 8px;
  border: 1px solid var(--rm-border-strong); border-radius: var(--rm-radius-sm);
  font-size: .88rem; font-weight: 600; color: var(--rm-text-soft); cursor: pointer;
}
.role-option input:checked + span { border-color: var(--rm-primary); background: var(--rm-primary-soft); color: var(--rm-primary-dark); }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--rm-border); vertical-align: middle; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rm-text-mute); font-weight: 700; background: var(--rm-surface-alt); white-space: nowrap; }
.table tbody tr:hover { background: #fafbff; }
.table--compact th, .table--compact td { padding: 8px 10px; }
.table__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table td.is-numeric, .table th.is-numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- stats */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat {
  background: var(--rm-surface); border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius); padding: 18px;
}
.stat__label { font-size: .78rem; color: var(--rm-text-mute); text-transform: uppercase; letter-spacing: .05em; }
.stat__value { font-size: 1.6rem; font-weight: 750; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: .8rem; color: var(--rm-text-soft); margin-top: 4px; }

/* ---------------------------------------------------------------- dashboard shell */

.shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 24px; padding-top: 26px; }
.shell__side { position: sticky; top: calc(var(--rm-header-h) + 20px); align-self: start; }
.shell__nav { background: var(--rm-surface); border: 1px solid var(--rm-border); border-radius: var(--rm-radius); padding: 8px; }
.shell__group { margin-bottom: 6px; }
.shell__label { padding: 12px 12px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rm-text-mute); font-weight: 700; }
.shell__link {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: var(--rm-radius-sm);
  color: var(--rm-text-soft); font-size: .9rem; font-weight: 500;
}
.shell__link:hover { background: var(--rm-surface-alt); color: var(--rm-text); text-decoration: none; }
.shell__link.is-active { background: var(--rm-primary-soft); color: var(--rm-primary-dark); font-weight: 600; }
.shell__link-badge { margin-left: auto; font-size: .72rem; background: var(--rm-primary); color: #fff; border-radius: 999px; padding: 1px 7px; }
.shell__main { min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.6rem; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--rm-text-soft); font-size: .92rem; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.toolbar .field { margin: 0; min-width: 170px; }

/* ---------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rm-border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 15px; border: 0; background: none; font: inherit; font-size: .9rem;
  font-weight: 600; color: var(--rm-text-soft); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--rm-text); }
.tab.is-active { color: var(--rm-primary); border-bottom-color: var(--rm-primary); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------------------------------------------------------------- alerts */

.alert {
  margin: 16px 0; padding: 12px 16px; border-radius: var(--rm-radius-sm);
  border: 1px solid transparent; font-size: .9rem;
}
.alert--success { background: var(--rm-success-soft); border-color: #bbf7d0; color: #14532d; }
.alert--error { background: var(--rm-danger-soft); border-color: #fecaca; color: #7f1d1d; }
.alert--info { background: var(--rm-primary-soft); border-color: #c7d2fe; color: #3730a3; }
.alert--warn { background: var(--rm-warn-soft); border-color: #fde68a; color: #78350f; }
.alert__list { margin: 0; padding-left: 1.1rem; }

.empty { padding: 44px 20px; text-align: center; color: var(--rm-text-mute); }
.empty__title { font-weight: 600; color: var(--rm-text-soft); margin-bottom: 4px; }

.badge-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--rm-danger); color: #fff; font-size: .68rem; font-weight: 700; }

/* ---------------------------------------------------------------- filters */

.filter-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px;
  background: var(--rm-surface); border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius); padding: 18px; margin-bottom: 22px;
}
.filter-bar__actions { display: flex; align-items: flex-end; gap: 8px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--rm-border);
  background: var(--rm-surface); font-size: .83rem; color: var(--rm-text-soft); cursor: pointer;
}
.chip.is-active { background: var(--rm-primary); border-color: var(--rm-primary); color: #fff; }

/* ---------------------------------------------------------------- blog */

.post-card { background: var(--rm-surface); border: 1px solid var(--rm-border); border-radius: var(--rm-radius); overflow: hidden; }
.post-card__body { padding: 18px; }
.post-card__title { font-size: 1.02rem; margin: 0 0 6px; }
.post-card__excerpt { color: var(--rm-text-soft); font-size: .89rem; margin: 0 0 12px; }
.post-card__meta { font-size: .78rem; color: var(--rm-text-mute); }

.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .35rem; }
.prose blockquote { margin: 1.5rem 0; padding: 12px 18px; border-left: 3px solid var(--rm-primary); background: var(--rm-primary-soft); border-radius: 0 var(--rm-radius-sm) var(--rm-radius-sm) 0; }

/* ---------------------------------------------------------------- footer */

.site-footer { background: #0f1220; color: #aab1c5; margin-top: 60px; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 40px; padding: 48px 20px 32px; }
.brand--footer, .brand--footer:hover { color: #fff; }
.site-footer__blurb { margin: 14px 0 16px; font-size: .9rem; max-width: 42ch; }
.site-footer__title { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.site-footer__list { list-style: none; padding: 0; margin: 0; }
.site-footer__list li { margin-bottom: 8px; }
.site-footer__list a { color: #aab1c5; font-size: .9rem; }
.site-footer__list a:hover { color: #fff; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding: 18px 20px; font-size: .84rem; }
.social-row { display: flex; gap: 8px; }
.social-row__link {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; background: rgba(255, 255, 255, .07); color: #cfd5e6;
}
.social-row__link:hover { background: var(--rm-primary); color: #fff; }

/* ---------------------------------------------------------------- modal */

.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 18, 32, .55); }
.modal__dialog {
  position: relative; margin: 6vh auto; max-width: 620px; width: calc(100% - 32px);
  background: var(--rm-surface); border-radius: var(--rm-radius-lg); box-shadow: var(--rm-shadow-lg);
  max-height: 88vh; overflow: auto;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--rm-border); }
.modal__body { padding: 22px; }
.modal__close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--rm-text-mute); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell__side { position: static; }
  .shell__nav { display: flex; overflow-x: auto; gap: 4px; }
  .shell__group { display: flex; gap: 4px; margin: 0; }
  .shell__label { display: none; }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; order: 3; }
  .site-nav {
    display: none; order: 4; width: 100%;
    position: absolute; top: var(--rm-header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--rm-surface); border-bottom: 1px solid var(--rm-border);
    padding: 10px 20px 16px; box-shadow: var(--rm-shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-header__inner { flex-wrap: wrap; }
  .site-header__actions { margin-left: auto; }
  .account-menu__name { display: none; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-picker { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 1.35rem; }
  .stat__value { font-size: 1.35rem; }
  .container { padding: 0 16px; }
}

@media (pointer: coarse) {
  .btn, .tab, .shell__link, .chip { min-height: 44px; }
}

@media print {
  .site-header, .site-footer, .btn, .toolbar { display: none !important; }
  body { background: #fff; }
}
