:root {
  color-scheme: light;
  --navy: #0a2d5b;
  --navy-2: #10437f;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --sidebar-start: #082a56;
  --sidebar-end: #0b356e;
  --hero-start: #082a56;
  --hero-mid: #0b356e;
  --hero-end: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #15966b;
  --green-soft: #e9f8f1;
  --amber: #c97808;
  --amber-soft: #fff5df;
  --red: #d94655;
  --red-soft: #fff0f2;
  --purple: #7c4ce0;
  --purple-soft: #f1ebff;
  --ink: #12213b;
  --muted: #66758e;
  --line: #dce5f1;
  --surface: #ffffff;
  --canvas: #f3f7fc;
  --shadow: 0 12px 34px rgba(31, 62, 104, .08);
  --radius: 18px;
  font-family: "Roboto", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Roboto", Arial, sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .24);
  outline-offset: 2px;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.is-loading .app-shell { visibility: hidden; }
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  background: var(--canvas);
  font-size: 13px;
}
body:not(.is-loading) .loading-screen { display: none; }
.workspace-load-state { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #dbe5f3; border-radius: 14px; background: #f8fbff; color: #385476; }
.workspace-load-state[hidden] { display: none; }
.workspace-load-state [hidden] { display: none; }
.workspace-load-state.is-error { border-color: #efd6ad; background: #fffaf1; color: #805b24; }
.workspace-load-state__mark { width: 13px; height: 13px; flex: 0 0 auto; border: 2px solid #bfd0e8; border-top-color: var(--blue); border-radius: 50%; animation: workspace-spin .8s linear infinite; }
.workspace-load-state.is-error .workspace-load-state__mark { border: 0; border-radius: 0; animation: none; }
.workspace-load-state.is-error .workspace-load-state__mark::before { content: "!"; display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; background: #fff0d2; font-weight: 900; }
.workspace-load-state div { min-width: 0; flex: 1; }
.workspace-load-state strong { display: block; color: inherit; font-size: 13px; }
.workspace-load-state p { margin: 3px 0 0; color: inherit; font-size: 11px; line-height: 1.45; }
.workspace-load-state button { flex: 0 0 auto; }
@keyframes workspace-spin { to { transform: rotate(360deg); } }
.loading-screen.auth-recovery { padding: 24px; text-align: center; }
.auth-recovery h2 { margin: 0; color: var(--ink, #18345a); font-size: 24px; }
.auth-recovery p { max-width: 480px; margin: 0; line-height: 1.7; }
.auth-recovery button { min-height: 44px; padding: 11px 24px; border: 0; border-radius: 10px; background: var(--blue, #2563eb); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.auth-recovery button:focus-visible { outline: 3px solid #96b9ff; outline-offset: 3px; }
.loader-mark {
  min-width: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  animation: loaderPulse 1.2s ease-in-out infinite;
}
.loader-mark img {
  width: auto;
  max-width: 128px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
}
@keyframes loaderPulse { 50% { transform: translateY(-4px); } }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 252px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 22% 8%, rgba(65, 142, 255, .28), transparent 28%),
    linear-gradient(180deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%);
  box-shadow: 12px 0 36px rgba(12, 42, 78, .08);
  transition: transform .22s ease;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  width: 100%;
  min-width: 0;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.brand-mark img {
  width: 100%;
  max-width: 190px;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 2px; color: #a9c6ec; font-size: 10px; }
.workspace-label {
  margin: 24px 12px 8px;
  color: #91afd6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.side-nav { display: grid; gap: 5px; margin-top: 0; }
.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 11px;
  color: #d7e8ff;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.nav-item svg {
  width: 23px;
  height: 23px;
  padding: 4px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px;
  stroke-width: 1.9;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, #1f69d7, #2e7cf0);
  box-shadow: 0 8px 18px rgba(5,26,55,.2);
}
.sidebar-footer {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d7e8ff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}
.sidebar-footer a:hover { color: #fff; }
.sidebar-footer a svg { width: 16px; height: 16px; stroke-width: 2; }
.sidebar-footer p { margin: 12px 0 0; color: #a9c6ec; font-size: 10px; }
.sidebar-footer p span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #54e2a4;
  box-shadow: 0 0 0 5px rgba(84,226,164,.14);
}

.main-column { margin-left: 252px; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(220,229,241,.92);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
}
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.breadcrumb span::after { content: "/"; margin-left: 10px; color: #b5c1d1; }
.breadcrumb strong { color: var(--ink); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #3475d4);
  font-size: 12px;
  font-weight: 800;
}
.user-copy { min-width: 140px; display: grid; }
.user-copy strong, .user-copy small {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-copy strong { font-size: 12px; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.text-button {
  padding: 8px 10px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}
.icon-button svg { width: 18px; height: 18px; stroke-width: 1.9; }
.menu-button { display: none; }

main { width: min(1540px, 100%); margin: 0 auto; padding: 30px 30px 64px; }
.page-heading {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 10%, rgba(68,153,255,.45), transparent 25%),
    linear-gradient(112deg, var(--hero-start) 0%, var(--hero-mid) 65%, var(--hero-end) 100%);
  box-shadow: var(--shadow);
}
.page-heading::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: -140px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255,255,255,.04), 0 0 0 68px rgba(255,255,255,.025);
}
.page-heading > * { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 8px; color: #9fc8ff; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.page-heading h1 { margin: 0; font-size: clamp(27px,3vw,38px); letter-spacing: -.04em; }
.page-heading > div > p:last-child { max-width: 650px; margin: 10px 0 0; color: #d8e8fb; font-size: 13px; line-height: 1.65; }

.primary-button, .secondary-button {
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button {
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 9px 20px rgba(37,99,235,.22);
}
.page-heading .primary-button {
  min-height: 44px;
  padding: 0 18px;
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}
.primary-button:hover { background: var(--blue-2); }
.page-heading .primary-button:hover { background: rgba(255,255,255,.22); }
.primary-button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 15px; height: 15px; stroke-width: 2; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }

.stats-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 15px;
}
.stats-grid article {
  min-height: 112px;
  padding: 18px 19px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(38,65,105,.04);
}
.stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
}
.stat-icon svg { width: 20px; height: 20px; stroke-width: 1.9; }
.stat-icon--green { color: var(--green); background: var(--green-soft); }
.stat-icon--blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon--purple { color: var(--purple); background: var(--purple-soft); }
.stat-icon--orange { color: var(--amber); background: var(--amber-soft); }
.stats-grid article div { display: grid; gap: 4px; }
.stats-grid strong { font-size: 24px; letter-spacing: -.04em; }
.stats-grid article div span { color: var(--muted); font-size: 10px; }

.view-panel { margin-top: 24px; }
.content-panel, .role-card, .module-list, .store-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(38,65,105,.04);
}
.content-panel { overflow: hidden; border-radius: var(--radius); }
.panel-heading, .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.panel-heading {
  min-height: 82px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-heading h2, .section-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.panel-heading p, .section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.section-heading { margin-bottom: 15px; }
.search-box { position: relative; width: 260px; }
.search-box svg {
  position: absolute;
  left: 13px;
  top: 11px;
  width: 16px;
  height: 16px;
  color: #7888a0;
  stroke-width: 2;
}
.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #f8fafe;
}
.search-box input::placeholder { color: #8c9bb0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 20px; border-bottom: 1px solid #edf1f6; text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f8fafe; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
td { font-size: 10.5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
.member-cell { display: flex; align-items: center; gap: 10px; }
.member-avatar, .assignee-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--navy);
  background: var(--blue-soft);
  font-weight: 800;
}
.member-avatar { width: 38px; height: 38px; font-size: 10px; }
.member-copy, .assignee-copy { display: grid; gap: 3px; min-width: 0; }
.member-copy strong, .assignee-copy strong { color: var(--ink); font-size: 10.5px; }
.member-copy span, .assignee-copy span { color: var(--muted); font-size: 9px; }
.role-chips, .row-actions, .store-badges, .capability-list, .store-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.role-chip, .status-badge, .module-state, .store-badge, .capability-list span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 800;
}
.role-chip { padding: 5px 8px; color: #53637b; background: #eef2f7; }
.role-chip--owner { color: var(--amber); background: var(--amber-soft); }
.status-badge { gap: 6px; padding: 5px 8px; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge--active { color: var(--green); background: var(--green-soft); }
.status-badge--suspended, .status-badge--failed { color: var(--red); background: var(--red-soft); }
.status-badge--invited { color: var(--amber); background: var(--amber-soft); }
.date-cell { color: var(--muted); }
.row-actions { justify-content: flex-end; }
.row-button {
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.row-button:hover { color: var(--blue); border-color: #b9cff2; background: var(--blue-soft); }
.row-button--danger:hover { color: var(--red); border-color: #f2c5cb; background: var(--red-soft); }
.row-button:disabled { opacity: .45; cursor: not-allowed; }
.empty-state { padding: 36px 20px; color: var(--muted); text-align: center; font-size: 11px; }

.role-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.role-card { min-height: 210px; padding: 20px; border-radius: var(--radius); }
.role-card__head { display: flex; align-items: center; justify-content: space-between; }
.role-card__icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--blue);
  background: var(--blue-soft);
}
.role-card__icon svg { width: 21px; height: 21px; stroke-width: 1.9; }
.role-card h3 { margin: 15px 0 6px; font-size: 14px; }
.role-card > p { min-height: 34px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.permission-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.permission-list span, .permission-count, .module-permission {
  padding: 5px 8px;
  border-radius: 8px;
  color: #52647e;
  background: #f0f4f9;
  font-size: 8px;
  font-weight: 700;
}
.permission-count { color: var(--blue); background: var(--blue-soft); }

.module-list { overflow: hidden; border-radius: var(--radius); }
.module-row {
  min-height: 67px;
  padding: 13px 18px;
  display: grid;
  grid-template-columns: minmax(220px,1fr) minmax(180px,.7fr) 120px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #edf1f6;
}
.module-row:last-child { border-bottom: 0; }
.module-row strong, .module-row small { display: block; }
.module-row strong { font-size: 11px; }
.module-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.module-state { width: max-content; padding: 5px 8px; color: var(--muted); background: #eff2f6; }
.module-state--enabled { color: var(--green); background: var(--green-soft); }

.store-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.store-card { overflow: hidden; border-radius: var(--radius); }
.store-card__top, .store-card__body, .store-card__footer { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.store-card__top { border-bottom: 1px solid #edf1f6; }
.store-card__body { min-height: 82px; }
.store-card__footer { border-top: 1px solid #edf1f6; background: #fbfcfe; }
.store-identity, .assignee { display: flex; align-items: center; gap: 10px; min-width: 0; }
.store-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg,var(--navy),#3475d4);
  font-weight: 900;
}
.store-copy { min-width: 0; }
.store-copy strong, .store-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-copy strong { font-size: 11px; }
.store-copy span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.store-badges { justify-content: flex-end; }
.store-badge { padding: 5px 8px; color: var(--muted); background: #eff2f6; }
.store-badge--currency { color: var(--blue); background: var(--blue-soft); }
.assignee-avatar { width: 36px; height: 36px; font-size: 9px; }
.capability-list span { padding: 5px 8px; color: var(--blue); background: var(--blue-soft); }
.store-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #cbd7e6;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,.55);
  text-align: center;
}
.store-empty[hidden] { display: none; }
.store-empty > span { font-size: 36px; color: var(--blue); }
.store-empty h3 { margin: 0; color: var(--ink); font-size: 14px; }
.store-empty p { margin: 0 0 7px; font-size: 10px; }

.dialog {
  width: min(760px,calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(13,42,78,.25);
}
.dialog::backdrop { background: rgba(8,31,62,.56); backdrop-filter: blur(4px); }
.dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-heading .eyebrow { color: var(--blue); }
.dialog-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.dialog-heading > div > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.role-options { margin-top: 18px; display: grid; gap: 8px; }
.role-option {
  min-height: 64px;
  padding: 11px 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.role-option:has(input:checked) { border-color: #9dbcf0; background: var(--blue-soft); }
.role-option input { margin-top: 3px; accent-color: var(--blue); }
.role-option strong, .role-option span { display: block; }
.role-option strong { font-size: 10.5px; }
.role-option span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.role-option:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.dialog-note {
  margin-top: 15px;
  padding: 11px 13px;
  border-radius: 11px;
  color: #5d6e85;
  background: #f4f7fb;
  font-size: 9.5px;
  line-height: 1.5;
}
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 9px; }
.invite-fields, .store-fields { margin-top: 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-field { display: grid; gap: 7px; color: var(--ink); font-size: 9.5px; font-weight: 700; }
.form-field span strong, .invite-role-fieldset legend strong { color: var(--red); }
.form-field input, .form-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
.form-field input:focus, .form-field select:focus { border-color: #8bb0ed; outline: 3px solid rgba(37,99,235,.12); }
.invite-role-fieldset, .capability-fieldset {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}
.invite-role-fieldset legend, .capability-fieldset legend { color: var(--ink); font-size: 9.5px; font-weight: 700; }
.invite-role-fieldset .role-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-field--wide { grid-column: 1 / -1; }
.assignment-dialog { width: min(610px,calc(100vw - 32px)); }
.assignment-fields { margin-top: 18px; }
.capability-fieldset { display: grid; gap: 8px; }
.capability-fieldset label {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}
.capability-fieldset label:has(input:checked) { border-color: #9dbcf0; background: var(--blue-soft); }
.capability-fieldset input { margin-top: 3px; accent-color: var(--blue); }
.capability-fieldset strong, .capability-fieldset small { display: block; }
.capability-fieldset strong { font-size: 10px; }
.capability-fieldset small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid #c9d9ee;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 18px 50px rgba(20,44,80,.2);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: .2s ease;
  font-size: 11px;
  line-height: 1.5;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { color: #a62532; border-color: #f0bbc2; background: #fff7f8; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .role-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .store-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .main-column { margin-left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .menu-button { display: grid; }
  .breadcrumb { display: none; }
  .topbar { padding: 0 16px; }
  main { padding: 20px 16px 48px; }
  .user-copy { display: none; }
  .module-row { grid-template-columns: minmax(180px,1fr) 110px; }
  .module-permission { display: none; }
}
@media (max-width: 620px) {
  .page-heading { min-height: 0; padding: 23px 20px; align-items: flex-start; flex-direction: column; }
  .page-heading .primary-button { width: 100%; }
  .stats-grid, .role-grid { grid-template-columns: 1fr; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .topbar .text-button { padding-right: 0; }
  th:nth-child(4), td:nth-child(4) { display: none; }
  th, td { padding: 12px; }
  .row-actions { min-width: 90px; }
  .invite-fields, .invite-role-fieldset .role-options, .store-fields { grid-template-columns: 1fr; }
  .form-field--wide { grid-column: auto; }
  .store-card__top, .store-card__body, .store-card__footer { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


.permission-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.permission-section__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.permission-section__heading h3 { margin: 0; font-size: 13px; }
.permission-section__heading p { margin: 5px 0 0; color: var(--muted); font-size: 9.5px; }
.permission-section__heading a, .member-store-empty a {
  color: var(--blue);
  text-decoration: none;
  font-size: 9.5px;
  font-weight: 800;
}
.member-store-options { margin-top: 12px; display: grid; gap: 9px; }
.member-store-option {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.member-store-option.is-selected { border-color: color-mix(in srgb, var(--blue) 42%, #fff); background: var(--blue-soft); }
.member-store-option__head {
  min-height: 62px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.member-store-option__head > input { accent-color: var(--blue); }
.member-store-option__copy { min-width: 0; }
.member-store-option__copy strong, .member-store-option__copy small { display: block; }
.member-store-option__copy strong { font-size: 10.5px; }
.member-store-option__copy small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.member-store-option__owner { color: var(--muted); font-size: 8.5px; font-weight: 700; }
.member-store-scopes {
  padding: 10px 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  border-top: 1px solid rgba(220,229,241,.85);
  background: rgba(255,255,255,.68);
}
.member-store-scopes label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 9px; font-weight: 700; }
.member-store-scopes input { accent-color: var(--blue); }
.member-store-scopes input:disabled + * { opacity: .55; }
.member-store-empty {
  padding: 22px;
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 1px dashed #cbd7e6;
  border-radius: 13px;
  background: #f8fafe;
  text-align: center;
}
.member-store-empty strong { font-size: 11px; }
.member-store-empty p { max-width: 430px; margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.55; }

@media (max-width: 620px) {
  .permission-section__heading { flex-direction: column; }
  .member-store-option__head { grid-template-columns: auto minmax(0,1fr); }
  .member-store-option__owner { grid-column: 2; }
}


.permission-section--first {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}
.permission-section .role-options { margin-top: 12px; }
.member-module-options {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
}
.member-module-option {
  min-height: 66px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}
.member-module-option.is-selected {
  border-color: color-mix(in srgb, var(--blue) 42%, #fff);
  background: var(--blue-soft);
}
.member-module-option:has(input:disabled) { cursor: default; }
.member-module-option > input { accent-color: var(--blue); }
.member-module-option__copy { min-width: 0; }
.member-module-option__copy strong,
.member-module-option__copy small { display: block; }
.member-module-option__copy strong { font-size: 10.5px; }
.member-module-option__copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-module-option .module-state { font-size: 8px; white-space: nowrap; }
.member-module-summary {
  max-width: 420px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .member-module-options { grid-template-columns: 1fr; }
  .member-module-option { grid-template-columns: auto minmax(0,1fr); }
  .member-module-option .module-state { grid-column: 2; }
}
