:root {
  --ink: #15283b;
  --muted: #718197;
  --line: #e5eaf0;
  --canvas: #f5f7fa;
  --panel: #ffffff;
  --teal: #147d78;
  --teal-dark: #0e5f5a;
  --navy: #18324b;
  --coral: #d76b50;
  --gold: #d69b3a;
  --shadow: 0 12px 32px rgba(33, 54, 78, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  min-width: 0;
}
button, input, select, textarea { font: inherit; max-width: 100%; }
button { cursor: pointer; }
img, svg, video { max-width: 100%; height: auto; }
.hidden { display: none !important; }
.muted { color: var(--muted); margin: 6px 0 0; }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 700; letter-spacing: .14em; margin: 0 0 8px; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  background: #f5f7f9;
}
.auth-panel { align-self: center; justify-self: center; width: min(390px, calc(100% - 32px)); padding: 42px 0; max-width: 100%; }
.brand-mark { color: var(--navy); font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.auth-panel h1 { font-size: 32px; letter-spacing: -.04em; margin: 28px 0 0; }
.stack-form { display: grid; gap: 17px; margin-top: 28px; }
.remember-password { align-items: center; cursor: pointer; display: flex; gap: 8px; width: max-content; }
.remember-password input { accent-color: var(--teal); margin: 0; min-height: 0; width: 16px; height: 16px; }
label { color: #4b5c70; display: grid; gap: 7px; font-size: 12px; font-weight: 600; }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); min-height: 40px; padding: 9px 11px; outline: 0; transition: border .2s, box-shadow .2s; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,125,120,.12); }
.primary-button, .ghost-button, .text-button { border-radius: 6px; border: 1px solid transparent; min-height: 40px; padding: 0 16px; font-weight: 700; transition: transform .15s, background .15s, border .15s; }
.primary-button { color: #fff; background: var(--teal); box-shadow: 0 5px 12px rgba(20,125,120,.2); }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.ghost-button { color: var(--navy); background: #fff; border-color: var(--line); }
.ghost-button:hover { border-color: #b9c7d4; background: #f9fbfc; }
.text-button { min-height: 32px; color: var(--muted); background: transparent; padding: 0 8px; }
.text-button:hover { color: var(--coral); }
.auth-hint { color: #98a5b4; font-size: 12px; margin-top: 22px; }
.auth-aside { display: flex; flex-direction: column; justify-content: center; padding: 70px clamp(44px, 9vw, 130px); color: #ecf3f0; background: var(--navy); position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; width: 430px; height: 430px; right: -160px; bottom: -170px; border: 1px solid rgba(168, 226, 215, .22); border-radius: 50%; box-shadow: 0 0 0 34px rgba(168,226,215,.04), 0 0 0 68px rgba(168,226,215,.025); }
.aside-kicker { color: #9fd9cb; font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.auth-aside h2 { font-size: clamp(32px, 4vw, 51px); line-height: 1.14; letter-spacing: -.05em; margin: 18px 0; position: relative; z-index: 1; }
.auth-aside p { color: #acc1c9; max-width: 330px; margin: 0; position: relative; z-index: 1; }
.aside-stat { display: grid; grid-template-columns: auto auto; gap: 7px 14px; align-items: baseline; margin-top: 55px; position: relative; z-index: 1; }
.aside-stat strong { color: #d5f0e8; font-size: 28px; }
.aside-stat span { color: #8fa9b2; font-size: 12px; }

.app-shell { min-height: 100vh; min-height: 100dvh; min-width: 0; }
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
  min-width: 0;
}
.brand-lockup { color: var(--navy); display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -.04em; min-width: 0; }
.brand-dot { width: 24px; height: 24px; display: block; flex: 0 0 24px; margin-right: -12px; object-fit: contain; transform: translateX(-3px); }
.topbar-actions { display: flex; align-items: center; gap: 8px 13px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.scope-chip { color: var(--teal-dark); background: #e6f4f0; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.user-name { color: #4b5c70; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); min-width: 0; }
.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 28px 14px 18px; min-width: 0; }
.sidebar-label { color: #9caaba; font-size: 11px; letter-spacing: .12em; font-weight: 700; padding: 0 13px 12px; }
.main-nav { display: grid; gap: 4px; }
.nav-group { display: grid; gap: 2px; }
.nav-group-toggle {
  border: 0;
  background: transparent;
  color: #728398;
  min-height: 42px;
  text-align: left;
  border-radius: 6px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  width: 100%;
}
.nav-group-toggle:hover { color: var(--navy); background: #f3f7f8; }
.nav-caret { margin-left: auto; font-size: 12px; color: #a6b2c0; transition: transform .15s; }
.nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-group.collapsed .nav-sub { display: none; }
.nav-sub { display: grid; gap: 2px; padding: 0 0 4px 18px; }
.nav-sub-item { min-height: 36px; font-size: 13px; }
.nav-item { border: 0; background: transparent; color: #728398; min-height: 42px; text-align: left; border-radius: 6px; padding: 0 12px; display: flex; align-items: center; gap: 11px; font-weight: 600; }
.nav-item:hover { color: var(--navy); background: #f3f7f8; }
.nav-item.active { color: var(--teal-dark); background: #e8f4f1; }
.nav-mark { font-size: 10px; color: #a6b2c0; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-mark { color: var(--teal); }
.nav-badge { background: var(--coral); border-radius: 999px; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; margin-left: auto; min-width: 16px; padding: 3px 6px; text-align: center; }
.new-assignment-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid #f0c36d;
  border-left: 4px solid #e0a106;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff8e8 0%, #fffdf7 100%);
}
.new-assignment-banner.hidden { display: none !important; }
.new-assignment-banner-main { display: grid; gap: 2px; min-width: 0; }
.new-assignment-banner-main strong { color: #8a5a00; font-size: 14px; }
.new-assignment-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.new-assign-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e0a106;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}
tbody tr.is-new-assignment {
  background: #fffaf0;
}
tbody tr.is-new-assignment:hover,
tbody tr.is-new-assignment.selected {
  background: #fff3d9;
}
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.region-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.region-tabs[hidden] { display: none !important; }
.region-tab { background: #fff; border: 1px solid var(--line); border-radius: 999px; color: #607287; font-size: 12px; font-weight: 700; min-height: 32px; padding: 0 12px; }
.region-tab:hover, .region-tab.active { background: #e8f4f1; border-color: #bfe2d8; color: var(--teal-dark); }
.period-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.period-tab { background: #fff; border: 1px solid var(--line); border-radius: 999px; color: #607287; font-size: 12px; font-weight: 700; min-height: 38px; padding: 0 14px; }
.period-tab:hover, .period-tab.active { background: #e8f4f1; border-color: #bfe2d8; color: var(--teal-dark); }
.batch-bar { align-items: center; background: #17324d; border-radius: 8px; color: #fff; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; padding: 10px 14px; }
.batch-bar.hidden { display: none !important; }
.batch-bar span { font-size: 12px; font-weight: 700; margin-right: auto; }
.batch-bar .primary-button { box-shadow: none; }
.batch-bar .ghost-button { background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.check-col { width: 36px; }
.check-col input { margin: 0; min-height: 0; }
.follow-cell { color: #61758c; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.channel-tag { background: #eef4fb; border-radius: 4px; color: #3568a2; display: inline-flex; font-size: 11px; font-weight: 700; padding: 4px 8px; }
.reminder-groups { display: grid; gap: 16px; }
.reminder-group { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.reminder-group header { align-items: center; background: #f8fafb; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 48px; padding: 0 16px; }
.reminder-group header strong { font-size: 13px; }
.reminder-item { align-items: start; border-top: 1px solid #edf0f4; cursor: pointer; display: grid; gap: 8px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; padding: 12px 16px; }
.reminder-item:first-of-type { border-top: 0; }
.reminder-item:hover { background: #f3faf8; }
.reminder-item strong, .reminder-item p { display: block; margin: 0; }
.reminder-item p { color: #61758c; font-size: 12px; margin-top: 3px; }
.reminder-item time { color: #98a5b3; font-size: 11px; white-space: nowrap; }
.reminder-item.overdue time { color: var(--coral); font-weight: 700; }
.import-hint { color: var(--muted); font-size: 12px; margin: 0; }
.file-input { background: #f8fafb; }
.contact-import-box { background: #f8fafb; border: 1px dashed #d8e0e7; border-radius: 6px; display: grid; gap: 8px; padding: 12px; }
.contact-import-box strong { color: #607287; font-size: 12px; }
.contact-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.contact-add-row input { min-width: 0; width: 100%; }
.contact-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.contact-pending-head strong { color: #607287; font-size: 12px; }
.contact-pending-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: min(42vh, 360px);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 6px;
}
.contact-pending-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
  text-align: center;
}
.contact-pending-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  min-width: 0;
  padding: 4px 6px 4px 8px;
  border: 1px solid #edf0f4;
  border-radius: 6px;
  background: #fafbfc;
}
.contact-pending-item:hover { border-color: #d5dde6; background: #f3f7f8; }
.contact-pending-index {
  flex: 0 0 auto;
  color: #a0aab8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 1.1em;
}
.contact-pending-text {
  flex: 1;
  min-width: 0;
  color: var(--navy);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-pending-remove {
  border: 0;
  background: transparent;
  color: #a6b2c0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  flex: 0 0 auto;
}
.contact-pending-remove:hover {
  background: #fdeceb;
  color: var(--coral);
}
.sidebar-foot { border-top: 1px solid var(--line); display: flex; gap: 9px; align-items: center; margin-top: auto; padding: 18px 12px 0; }
.sidebar-foot strong { display: block; font-size: 12px; }
.sidebar-foot small { display: block; color: #97a4b4; font-size: 11px; margin-top: 2px; }
.status-pip { background: #4ab58b; border-radius: 50%; height: 8px; width: 8px; box-shadow: 0 0 0 4px #e5f6ef; }
.main-content { padding: 34px clamp(14px, 3vw, 48px) 52px; min-width: 0; overflow-x: clip; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; min-width: 0; }
.page-heading > div:first-child { min-width: 0; flex: 1 1 auto; }
.page-heading h1 { font-size: clamp(22px, 5vw, 30px); letter-spacing: -.05em; margin: 0; word-break: break-word; }
.daily-overview { border-bottom: 1px solid var(--line); margin: -5px 0 17px; padding-bottom: 17px; }
.daily-overview-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 9px; }
.daily-overview-head strong { color: #607287; font-size: 12px; }
.daily-overview-head span { color: var(--muted); font-size: 11px; }
.daily-metrics { display: grid; gap: 9px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.daily-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 96px; padding: 14px 16px; }
.daily-card span, .daily-card small { color: var(--muted); display: block; font-size: 11px; }
.daily-card strong { color: var(--navy); display: block; font-size: 24px; margin: 3px 0 1px; }
.daily-card.rate-card { border-color: #bfe2d8; }
.daily-card.rate-card strong { color: var(--teal-dark); }
.daily-card.performance-card { border-color: #d8c7a4; }
.daily-card.performance-card strong { color: #9a6b1f; font-size: 21px; }
.daily-loading { color: var(--muted); grid-column: 1 / -1; padding: 20px 0; text-align: center; }
.daily-breakdown { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 11px; }
.daily-breakdown:empty { display: none; }
.daily-breakdown-group { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-width: 0; padding: 12px 14px; }
.daily-breakdown-group > strong { color: #607287; display: block; font-size: 11px; margin-bottom: 7px; }
.daily-rate-list { display: grid; gap: 1px; max-height: 180px; overflow: auto; }
.daily-rate-row { align-items: center; border-top: 1px solid #edf0f4; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto auto; min-height: 34px; }
.daily-rate-row:first-child { border-top: 0; }
.daily-rate-row span { color: #405267; font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-rate-row b { color: var(--teal-dark); font-size: 12px; }
.daily-rate-row small { color: #98a5b3; font-size: 10px; min-width: 38px; text-align: right; }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; min-width: 0; }
.search-wrap { position: relative; flex: 1 1 280px; min-width: 0; }
.search-wrap input { width: 100%; padding-left: 32px; }
.search-symbol { position: absolute; left: 12px; top: 8px; color: #9aa8b8; font-size: 20px; line-height: 1; pointer-events: none; }
.toolbar select { min-width: 0; flex: 1 1 125px; max-width: 100%; }
.date-filter { align-items: center; background: #fff; border: 1px solid #dce3ea; border-radius: 6px; display: flex; min-height: 40px; padding-left: 9px; min-width: 0; flex: 1 1 160px; max-width: 100%; }
.date-filter:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,125,120,.12); }
.date-filter span { color: var(--muted); flex: 0 0 auto; font-size: 10px; white-space: nowrap; }
.date-filter input { border: 0; box-shadow: none; min-height: 36px; min-width: 0; flex: 1 1 auto; padding: 7px 8px; width: 100%; max-width: 100%; }
.date-filter input:focus { border: 0; box-shadow: none; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .9fr); align-items: start; gap: 16px; min-width: 0; }
.single-grid { grid-template-columns: minmax(0, 1fr); }
.table-panel, .detail-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 0; max-width: 100%; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 55px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#metrics-customers-panel .panel-header { flex-wrap: wrap; gap: 8px; }
.panel-header strong { font-size: 14px; }
.count-label, .formula-label { color: #94a1b0; font-size: 12px; }
.formula-label { color: var(--teal); background: #eef8f5; border-radius: 4px; padding: 5px 8px; max-width: 100%; }
.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 290px);
  max-height: calc(100dvh - 290px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.table-scroll::-webkit-scrollbar { height: 8px; width: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: #c5d0db; border-radius: 999px; }
.customer-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.customer-pagination.hidden { display: none !important; }
.customer-pagination .page-status { color: #718197; font-size: 12px; }
.customer-pagination .page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: #718197;
  font-size: 12px;
  font-weight: 600;
}
.customer-pagination .page-size-control select {
  min-width: 72px;
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #405267;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.customer-pagination .small-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
table { border-collapse: collapse; width: 100%; min-width: 980px; }
.metrics-table-panel table { min-width: 720px; }
#metrics-customers-panel table { min-width: 980px; }
th, td { border-bottom: 1px solid #edf0f4; padding: 12px 13px; text-align: left; white-space: nowrap; }
th { color: #8a98a9; font-size: 11px; font-weight: 700; letter-spacing: .04em; position: sticky; top: 0; background: #fff; z-index: 1; }
td { color: #405267; font-size: 12px; }
tbody tr { transition: background .15s; cursor: pointer; }
tbody tr:hover, tbody tr.selected { background: #f3faf8; }
tbody tr:last-child td { border-bottom: 0; }
.contact-cell { color: var(--navy); font-weight: 700; }
/* 标签：恢复最初简洁配色（无符号前缀） */
.status-tag, .category-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 0;
  letter-spacing: 0;
  line-height: 1.3;
  max-width: 100%;
}
.status-tag::before, .category-tag::before { content: none !important; display: none !important; }

.status-intent { color: #976d1e; background: #fff5dd; }
.status-visited { color: #3568a2; background: #e7f0fb; }
.status-done { color: #16735a; background: #e2f6ed; }
/* 已成交保持紫色 */
.status-converted { color: #6b3fa0; background: #f0e6fb; }

.category-normal { color: #16735a; background: #e2f6ed; }
.category-bad { color: #a23f35; background: #ffebe7; text-decoration: none; }
.category-neutral { color: #61758c; background: #edf1f5; }
.category-repeat { color: #7558a3; background: #f0eafd; }
.category-alert { color: #a46719; background: #fff1db; box-shadow: none; border-left-width: 0; }

/* 兼容旧 class，避免缓存/旧 HTML 仍用 wechat-yes */
.wechat-yes { color: #16735a; background: #e2f6ed; }

.empty-table { color: #9aa7b5; text-align: center; padding: 44px 0; }
.detail-panel { min-height: 520px; }
.empty-detail { display: grid; place-items: center; }
.empty-state { color: #9aa7b5; display: grid; gap: 7px; justify-items: center; text-align: center; padding: 40px; }
.empty-state strong { color: #617287; }
.empty-icon { border: 1px dashed #bcc8d3; border-radius: 50%; color: #a6b3c1; width: 42px; height: 42px; display: grid; place-items: center; font-size: 20px; margin-bottom: 5px; }
.detail-head { padding: 20px; border-bottom: 1px solid var(--line); }
.detail-head-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.detail-head h2 { font-size: 20px; letter-spacing: -.04em; margin: 0; }
.detail-contact { color: var(--teal-dark); font-weight: 700; margin-top: 4px; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 8px 4px 6px;
  border: 1px solid #e6ebf0;
  border-radius: 999px;
  background: #f7f9fb;
}
.detail-meta-label {
  flex: 0 0 auto;
  color: #8a98a9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f6;
}
.detail-meta-value {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.detail-meta-value small {
  color: #8492a2;
  font-size: 11px;
  font-weight: 600;
}
.detail-meta-value .muted,
.detail-meta-value em.detail-meta-empty {
  color: #98a5b3;
  font-style: normal;
  font-weight: 600;
}
.detail-meta-value.is-pending {
  color: #b0792d;
}
.detail-meta-time {
  font-variant-numeric: tabular-nums;
}
.detail-meta-edit {
  border: 0;
  background: #e8f4f1;
  color: var(--teal-dark);
  border-radius: 999px;
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}
.detail-meta-edit:hover {
  background: #d7efe9;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.small-button { min-height: 32px; padding: 0 10px; font-size: 11px; }
.public-pool-button { margin-left: 0; color: #a46719; border-color: #ead8b1; }
.public-pool-button:hover { background: #fff8e9; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.detail-body { padding: 18px 20px 22px; display: grid; gap: 18px; min-width: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.section-title strong { font-size: 12px; color: #607287; letter-spacing: .02em; }
.timeline { display: grid; gap: 8px; min-width: 0; }
.timeline-item, .deal-item { border-left: 2px solid #d5ebe4; padding: 7px 0 7px 11px; min-width: 0; }
.refund-item { border-left-color: #e3b6ad; }
.timeline-item time, .deal-item time { color: #98a5b3; font-size: 11px; word-break: break-word; white-space: normal; }
.timeline-item p, .deal-item p { margin: 3px 0 0; color: #465b70; font-size: 12px; word-break: break-word; white-space: normal; }
.money-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.money-line strong { color: var(--navy); font-size: 20px; }
.money-line span { color: #8694a5; font-size: 11px; }
.metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 17px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 17px 18px; box-shadow: var(--shadow); min-width: 0; }
.metric-card span { display: block; color: #8492a2; font-size: 11px; }
.metric-card strong { color: var(--navy); display: block; font-size: clamp(18px, 4vw, 25px); letter-spacing: -.04em; margin-top: 6px; word-break: break-word; }
.metric-card em { color: var(--teal); font-size: 11px; font-style: normal; }
.metrics-note-input { min-width: 0; width: 100%; }
.metrics-person-link { background: transparent; border: 0; color: var(--navy); cursor: pointer; font: inherit; font-weight: 700; padding: 0; text-align: left; }
.metrics-person-link:hover { color: var(--teal-dark); text-decoration: underline; }
.metrics-drilldown-toolbar { align-items: center; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 18px; }
.metrics-drilldown-toolbar > .muted { margin: 0 auto 0 0; min-width: 0; }
.metrics-drilldown-toolbar label { align-items: center; display: flex; flex-direction: row; gap: 8px; min-width: 0; }
.metrics-drilldown-toolbar input { min-height: 34px; min-width: 0; }
.metrics-assignee-filter { margin-left: auto; min-width: 0; width: min(190px, 100%); min-height: 34px; }
.metrics-group-row td { background: #f8fafb; color: var(--navy); font-weight: 700; }
.metrics-team-row td { background: #fcfdfd; color: #405267; }
.metrics-group-row:hover td { background: #f1f8f6; }
.metrics-group-toggle { align-items: center; background: transparent; border: 0; color: inherit; cursor: pointer; display: inline-flex; font: inherit; gap: 8px; min-height: 28px; padding: 0; text-align: left; }
.metrics-group-toggle:hover { color: var(--teal-dark); }
.metrics-toggle-mark { align-items: center; border: 1px solid #b8c8d2; border-radius: 3px; color: var(--teal-dark); display: inline-flex; font-size: 15px; height: 18px; justify-content: center; line-height: 1; width: 18px; }
.month-picker { display: flex; align-items: center; grid-template-columns: auto auto; gap: 9px; }
.month-picker input { min-height: 38px; }
.metrics-date-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.metrics-date-range.hidden { display: none !important; }
.organization-section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }
.organization-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.organization-header strong { font-size: 16px; }
.organization-header p { margin: 3px 0 0; }
.org-actions { display: flex; gap: 8px; }
.organization-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; margin: 18px 0 14px; overflow: hidden; }
.organization-summary > div { background: #fff; min-width: 0; padding: 14px 16px; }
.organization-summary strong { color: var(--navy); display: block; font-size: 22px; }
.organization-summary span { color: var(--muted); display: block; font-size: 11px; margin-top: 2px; }
.organization-tree { display: grid; gap: 12px; }
.organization-loading, .empty-region { color: var(--muted); padding: 28px 18px; text-align: center; }
.admin-roster, .region-block { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.admin-roster { padding: 16px 18px; }
.region-heading { align-items: center; background: #f8fafb; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 50px; padding: 0 18px; }
.region-heading > div { align-items: center; display: flex; gap: 9px; }
.region-heading > span { color: var(--muted); font-size: 11px; }
.organization-name-row { align-items: center; display: flex; gap: 8px; }
.organization-edit-button { background: transparent; border: 0; color: var(--teal-dark); cursor: pointer; font-size: 11px; padding: 3px 4px; }
.organization-edit-button:hover { color: var(--navy); text-decoration: underline; }
.organization-delete-button { color: #a5443d; }
.organization-delete-button:hover { color: #7d2f2a; }
.region-mark { background: var(--teal); border-radius: 2px; display: block; height: 11px; transform: rotate(45deg); width: 11px; }
.team-list { display: grid; }
.team-row { padding: 17px 18px 19px; }
.team-row + .team-row { border-top: 1px solid var(--line); }
.team-overview { align-items: center; display: flex; justify-content: space-between; gap: 16px; }
.team-overview > div:first-child strong { display: block; font-size: 14px; }
.team-overview > div:first-child span { color: var(--muted); display: block; font-size: 11px; margin-top: 2px; }
.team-counts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.team-counts span { background: #eef8f5; border-radius: 4px; color: var(--teal-dark); font-size: 11px; padding: 4px 7px; }
.team-rosters { display: grid; gap: 18px; grid-template-columns: 1fr 1.5fr; margin-top: 15px; }
.roster-title { align-items: center; display: flex; justify-content: space-between; margin-bottom: 8px; }
.roster-title strong { color: #607287; font-size: 11px; }
.roster-title span { color: #98a5b3; font-size: 10px; }
.member-grid { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-roster .member-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.org-member { align-items: center; border: 1px solid #edf0f4; border-radius: 6px; display: grid; gap: 8px; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 48px; padding: 7px 9px; }
.org-member > div { min-width: 0; }
.org-member strong, .org-member small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-member strong { font-size: 12px; }
.org-member small { color: var(--muted); font-size: 10px; }
.member-role { border-radius: 4px; font-size: 10px; font-weight: 700; padding: 3px 5px; }
.role-admin { background: #e7f0fb; color: #3568a2; }
.role-manager { background: #fff1db; color: #97651e; }
.role-sales { background: #e2f6ed; color: #16735a; }
.member-state { color: #a5443d; font-size: 10px; }
.member-state.is-active { color: #16735a; }
.empty-roster { border: 1px dashed #d8e0e7; border-radius: 6px; color: #98a5b3; display: block; font-size: 11px; padding: 12px; text-align: center; }
.toast {
  background: var(--navy);
  border-radius: 5px;
  color: #fff;
  max-width: min(360px, calc(100vw - 24px));
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s;
  z-index: 100;
  word-break: break-word;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a5443d; }
.modal-backdrop {
  align-items: center;
  background: rgba(12, 28, 44, .42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
  position: fixed;
  z-index: 90;
}
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 70px rgba(10, 25, 40, .22);
  max-height: min(92dvh, calc(100vh - 24px));
  overflow: auto;
  width: min(560px, 100%);
  -webkit-overflow-scrolling: touch;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.modal-header h3 { font-size: 16px; margin: 0; min-width: 0; word-break: break-word; }
.modal-close { color: #8090a1; border: 0; background: transparent; font-size: 22px; line-height: 1; min-width: 36px; min-height: 36px; }
.modal-form { display: grid; gap: 14px; padding: 16px 18px 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
.password-input-wrap { align-items: center; display: flex; gap: 8px; min-width: 0; }
.password-input-wrap input { flex: 1; min-width: 0; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.modal-actions .primary-button,
.modal-actions .ghost-button { flex: 1 1 120px; }
.danger-button { color: #a5443d; border-color: #f1d3d0; }
.danger-button:hover { background: #fff4f2; }

@media (max-width: 1100px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-panel { min-height: 0; }
  .table-scroll { max-height: min(52vh, 460px); }
  .team-rosters { grid-template-columns: 1fr; }
  .admin-roster .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-layout { grid-template-columns: 200px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    position: sticky;
    top: 64px;
    z-index: 30;
    background: #fff;
  }
  .sidebar-label, .sidebar-foot { display: none; }
  .main-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .nav-group { display: flex; gap: 6px; flex: 0 0 auto; }
  .nav-group-toggle { display: none; }
  .nav-group.collapsed .nav-sub { display: flex; }
  .nav-sub {
    display: flex;
    gap: 6px;
    padding: 0;
  }
  .nav-item, .nav-sub-item {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 36px;
    padding: 0 12px;
    background: #f5f8fa;
    border: 1px solid var(--line);
  }
  .nav-item.active, .nav-sub-item.active {
    background: #e8f4f1;
    border-color: #bfe2d8;
  }
  .nav-mark { display: none; }
  .daily-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-breakdown { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-panel { width: min(390px, calc(100% - 24px)); padding: 28px 0 36px; }
  .auth-panel h1 { font-size: 28px; }
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }
  .brand-lockup { font-size: 16px; }
  .brand-dot { margin-right: 0; transform: none; }
  .scope-chip { font-size: 10px; padding: 3px 8px; }
  .user-name { display: none; }
  .topbar-actions { gap: 4px 8px; }
  .topbar-actions .text-button { min-height: 30px; padding: 0 6px; font-size: 12px; }
  .sidebar { top: 56px; padding: 8px; }
  .main-content {
    padding: 16px 10px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .page-heading { align-items: stretch; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .page-heading .primary-button,
  .heading-actions { width: 100%; }
  .heading-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .heading-actions .primary-button,
  .heading-actions .ghost-button,
  .heading-actions > * { width: 100%; min-width: 0; }
  .heading-actions .primary-button { grid-column: 1 / -1; }
  #metrics-period-tabs,
  #metrics-month-wrap,
  .metrics-date-range { grid-column: 1 / -1; width: 100%; }
  .metrics-date-range .month-picker,
  .metrics-date-range label { width: 100%; }
  .metrics-date-range input,
  .month-picker input { width: 100%; min-width: 0; }
  .metrics-assignee-filter { grid-column: 1 / -1; margin-left: 0; width: 100%; max-width: none; }
  .new-assignment-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .new-assignment-banner-actions { width: 100%; }
  .new-assignment-banner-actions .primary-button,
  .new-assignment-banner-actions .ghost-button { flex: 1 1 auto; }
  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .search-wrap { grid-column: 1 / -1; flex: none; }
  .toolbar select,
  .toolbar .date-filter,
  .toolbar .ghost-button,
  .toolbar .small-button { width: 100%; min-width: 0; flex: none; }
  .date-filter { padding-right: 4px; }
  #clear-date-filter,
  #refresh-customers { grid-column: 1 / -1; }
  .batch-bar { gap: 8px; padding: 10px 12px; }
  .batch-bar span { width: 100%; margin-right: 0; }
  .batch-bar .primary-button,
  .batch-bar .ghost-button { flex: 1 1 calc(50% - 8px); }
  .daily-overview { margin-bottom: 12px; padding-bottom: 12px; }
  .daily-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .daily-card { min-height: 0; padding: 12px; }
  .daily-card strong { font-size: 20px; }
  .daily-card.rate-card,
  .daily-card.performance-card { grid-column: 1 / -1; }
  .daily-breakdown { grid-template-columns: 1fr; }
  .metric-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 12px; }
  .table-panel { border-radius: 8px; }
  .panel-header { padding: 10px 12px; min-height: 48px; }
  .table-scroll {
    max-height: min(58vh, 520px);
    border-radius: 0 0 8px 8px;
  }
  table { min-width: 860px; }
  .metrics-table-panel table,
  #metrics-customers-panel table { min-width: 720px; }
  th, td { padding: 10px 10px; font-size: 11px; }
  .customer-pagination {
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
  }
  .customer-pagination .page-size-control {
    width: 100%;
    margin-right: 0;
    justify-content: center;
    order: -2;
  }
  .customer-pagination .page-status { width: 100%; text-align: center; order: -1; }
  .customer-pagination .ghost-button { flex: 1 1 40%; }
  .detail-head { padding: 14px 12px; }
  .detail-head-row { flex-direction: column; align-items: stretch; }
  .detail-actions { width: 100%; }
  .detail-actions .ghost-button,
  .detail-actions .primary-button,
  .detail-actions .danger-button { flex: 1 1 calc(50% - 7px); }
  .detail-body { padding: 14px 12px 18px; }
  .detail-meta-item { max-width: 100%; }
  .reminder-item { grid-template-columns: 1fr; }
  .reminder-group header { padding: 0 12px; }
  .organization-header { align-items: start; flex-direction: column; }
  .org-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .organization-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .organization-summary > div:last-child { grid-column: 1 / -1; }
  .team-overview { align-items: start; flex-direction: column; }
  .team-counts { justify-content: flex-start; }
  .member-grid, .admin-roster .member-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: 16px 16px 0 0;
    max-height: min(92dvh, calc(100vh - env(safe-area-inset-top, 0px)));
    width: 100%;
  }
  .modal-form { padding: 16px 14px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .modal-actions .primary-button,
  .modal-actions .ghost-button { flex: 1 1 calc(50% - 8px); }
  .contact-add-row { grid-template-columns: minmax(0, 1fr) auto; }
  .contact-pending-list { grid-template-columns: 1fr 1fr; max-height: min(36vh, 280px); }
  .install-shell { grid-template-columns: 1fr; }
  .install-aside { display: none; }
  .install-panel { width: min(520px, calc(100% - 24px)); padding: 28px 0 40px; }
  .install-grid { grid-template-columns: 1fr; }
  .install-actions .primary-button,
  .install-actions .ghost-button { width: 100%; }
  .permissions-layout { grid-template-columns: 1fr; }
  .toast {
    right: 12px;
    left: 12px;
    max-width: none;
    top: max(10px, env(safe-area-inset-top, 0px));
  }
}

@media (max-width: 420px) {
  .toolbar { grid-template-columns: 1fr; }
  .daily-metrics,
  .metric-cards { grid-template-columns: 1fr; }
  .daily-card.rate-card,
  .daily-card.performance-card { grid-column: auto; }
  .contact-pending-list { grid-template-columns: 1fr; }
  .heading-actions { grid-template-columns: 1fr; }
  .nav-item { padding: 0 10px; font-size: 12px; }
  table { min-width: 760px; }
}

@media (min-width: 761px) {
  .modal-backdrop { align-items: center; padding: 18px; }
  .modal { border-radius: 8px; }
}

.install-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(320px, .75fr);
  background:
    radial-gradient(circle at top left, rgba(20, 125, 120, .12), transparent 34%),
    linear-gradient(160deg, #f3f7f8 0%, #eef3f7 48%, #f7f5f1 100%);
}
.install-panel {
  align-self: center;
  justify-self: center;
  width: min(520px, calc(100% - 48px));
  padding: 48px 0;
}
.install-panel h1 { font-size: 34px; letter-spacing: -.04em; margin: 24px 0 0; }
.install-form { margin-top: 28px; }
.install-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.install-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.install-actions .primary-button,
.install-actions .ghost-button { min-width: 120px; }
.install-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 18px;
}
.install-done {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid #cfe6df;
  border-radius: 10px;
  background: #f2faf7;
}
.install-done strong { color: var(--teal-dark); font-size: 16px; }
.install-log {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: #4b5c70;
  white-space: pre-wrap;
}
.install-log[data-kind="ok"] { border-color: #bfe2d8; background: #f2faf7; color: var(--teal-dark); }
.install-log[data-kind="error"] { border-color: #f0c7bb; background: #fff6f3; color: #a84a34; }
.install-notes {
  margin: 22px 0 0;
  padding-left: 18px;
  color: #7a8a9c;
  font-size: 12px;
  line-height: 1.7;
}
.install-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 70px clamp(36px, 7vw, 88px);
  color: #ecf3f0;
  background:
    linear-gradient(165deg, rgba(24, 50, 75, .92), rgba(14, 95, 90, .88)),
    var(--navy);
}
.install-steps {
  margin: 22px 0 0;
  padding-left: 18px;
  color: #d7ebe4;
  line-height: 1.8;
}
.install-aside-note,
.install-aside-meta {
  margin-top: 28px;
  color: #9fb8c0;
  max-width: 360px;
  font-size: 13px;
}
.install-aside code {
  color: #d5f0e8;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

@media (max-width: 900px) {
  .install-shell { grid-template-columns: 1fr; }
  .install-aside { order: -1; padding: 36px 24px; min-height: auto; }
  .install-grid { grid-template-columns: 1fr; }
}

.permissions-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.permissions-users-panel .table-scroll { max-height: 70vh; }
.permission-user-row { cursor: pointer; }
.permission-user-row:hover { background: #f5faf8; }
.permission-user-row.is-selected { background: #e8f4f1; }
.permission-user-row .contact-cell { display: grid; gap: 2px; }
.permissions-editor-panel { min-height: 420px; }
.permissions-empty {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
}
.permissions-form { padding: 0 0 18px; }
.permissions-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px 0;
}
.permission-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}
.permission-mode-option:has(input:checked) {
  border-color: #bfe2d8;
  background: #e8f4f1;
  color: var(--teal-dark);
}
.permissions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
}
.permissions-groups {
  display: grid;
  gap: 14px;
  padding: 0 16px 8px;
}
.permission-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  overflow: hidden;
}
.permission-group-title {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #607287;
  background: #f3f7f8;
  border-bottom: 1px solid var(--line);
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding: 12px;
}
.permission-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #4b5c70;
}
.permission-check:hover { border-color: #d7e3ec; }
.permission-check input { margin-top: 2px; accent-color: var(--teal); }

@media (max-width: 980px) {
  .permissions-layout { grid-template-columns: 1fr; }
}


