/* ==========================================================================
   SOULMATE 门店 SaaS · 运营中心样式
   品牌：主色 #5C6B57 / 辅助 #B9C4A3 / 背景 #F6F6F4 / 文字 #2E2E2E
   ========================================================================== */

:root {
  --primary: #5C6B57;
  --primary-dark: #495642;
  --primary-mid: #6E7D68;
  --primary-light: #8A9A83;
  --accent: #B9C4A3;
  --accent-soft: #E7EBDD;
  --bg: #F6F6F4;
  --card: #FFFFFF;
  --text: #2E2E2E;
  --text-2: #5C5C58;
  --muted: #8A8A86;
  --line: #E6E6E1;
  --line-soft: #F0F0EC;
  --danger: #C0553F;
  --danger-soft: #FBEDEA;
  --warn: #C0872E;
  --warn-soft: #FBF3E4;
  --ok: #5C8A5C;
  --ok-soft: #EDF4EC;
  --info: #4A7396;
  --info-soft: #EDF2F7;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(46, 46, 46, .05);
  --shadow: 0 1px 2px rgba(46, 46, 46, .04), 0 6px 20px rgba(46, 46, 46, .06);
  --shadow-lg: 0 12px 40px rgba(30, 34, 28, .18);
  --sidebar-w: 218px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p, dl, dd, ul, ol { margin: 0; }
ul { padding: 0; list-style: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 13px; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.noscript { padding: 40px; text-align: center; }

/* ------------------------------ 顶部进度条 ------------------------------ */

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9000;
  background: transparent; overflow: hidden;
}
.progress i {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), var(--primary), transparent);
  animation: progress-run 1.05s linear infinite;
}
@keyframes progress-run {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

/* ------------------------------ 主布局 ------------------------------ */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #FFFFFF;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar-brand .brand-text { min-width: 0; }
.sidebar-brand .brand-name {
  font-size: 15px; font-weight: 700; letter-spacing: .5px; color: var(--text);
  white-space: nowrap;
}
.sidebar-brand .brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 1.4px; text-transform: uppercase; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px 24px; }
.nav-group { margin-bottom: 14px; }
.nav-group-title {
  font-size: 11px; color: var(--muted); letter-spacing: 1px;
  padding: 6px 10px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; border: 0; background: transparent;
  width: 100%; text-align: left; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item .ico { flex: 0 0 auto; opacity: .85; }
.nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item.active .ico { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: var(--accent-soft); color: var(--primary);
}
.nav-item.active .nav-badge { background: rgba(255, 255, 255, .22); color: #fff; }

.sidebar-foot {
  border-top: 1px solid var(--line-soft); padding: 10px 14px;
  font-size: 11px; color: var(--muted); line-height: 1.5;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-crumb { font-size: 12px; color: var(--muted); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.topbar-icon-btn:hover { border-color: var(--accent); color: var(--primary); }
.topbar-icon-btn .badge-dot {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}

.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer;
}
.user-chip:hover { border-color: var(--accent); }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.user-chip .u-name { font-size: 13px; font-weight: 600; line-height: 1.15; }
.user-chip .u-role { font-size: 11px; color: var(--muted); line-height: 1.15; }

.content { padding: 20px 22px 48px; flex: 1; min-width: 0; }

/* ------------------------------ 页面头 ------------------------------ */

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-title { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.page-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------ 卡片 ------------------------------ */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 16px; overflow: hidden;
}
.card-flat { box-shadow: none; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-title { font-size: 14.5px; font-weight: 600; }
.card-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.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-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.grid-stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* ------------------------------ 指标卡 ------------------------------ */

.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
}
.stat-card.tone-primary::before { background: var(--primary); }
.stat-card.tone-ok::before { background: var(--ok); }
.stat-card.tone-warn::before { background: var(--warn); }
.stat-card.tone-danger::before { background: var(--danger); }
.stat-card.tone-info::before { background: var(--info); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-ico { color: var(--accent); display: inline-flex; }
.stat-card.tone-primary .stat-ico { color: var(--primary-light); }
.stat-value { font-size: 23px; font-weight: 700; letter-spacing: .3px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ------------------------------ 标签 ------------------------------ */

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 19px;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-ok { background: var(--ok-soft); color: var(--ok); border-color: #D6E5D6; }
.tag-danger { background: var(--danger-soft); color: var(--danger); border-color: #F0D5CE; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: #F0E0C2; }
.tag-info { background: var(--info-soft); color: var(--info); border-color: #D6E2ED; }
.tag-primary { background: var(--accent-soft); color: var(--primary); border-color: #D8E0C8; }
.tag-muted { background: #F2F2EF; color: var(--muted); }

.dot-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-danger { background: var(--danger); }
.dot-warn { background: var(--warn); }
.dot-info { background: var(--info); }
.dot-muted { background: #BEBEB8; }

/* ------------------------------ 说明条 ------------------------------ */

.notice-bar {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px;
  margin-bottom: 14px; border: 1px solid transparent; line-height: 1.55;
}
.notice-bar .ico { flex: 0 0 auto; margin-top: 1px; }
.notice-info { background: var(--info-soft); color: #3B5C79; border-color: #DCE7F0; }
.notice-warn { background: var(--warn-soft); color: #8A6320; border-color: #F0E0C2; }
.notice-danger { background: var(--danger-soft); color: #93412F; border-color: #F0D5CE; }
.notice-ok { background: var(--ok-soft); color: #3F6B3F; border-color: #D6E5D6; }

/* ------------------------------ 键值列表 ------------------------------ */

.kv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 20px; }
.kv-row { display: flex; gap: 10px; align-items: baseline; border-bottom: 1px dashed var(--line-soft); padding-bottom: 7px; }
.kv-row dt { flex: 0 0 88px; color: var(--muted); font-size: 12.5px; }
.kv-row dd { flex: 1; min-width: 0; font-size: 13.5px; word-break: break-all; }

/* ------------------------------ 表格 ------------------------------ */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px;
  padding: 10px 14px; background: #FAFAF8; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FCFCFA; }
.table .ta-right, .table th.ta-right { text-align: right; }
.table .ta-center, .table th.ta-center { text-align: center; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { font-size: 11.5px; color: var(--muted); }
.table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.skeleton-row td { padding: 14px; }
.skeleton-bar {
  display: block; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, #F1F1EC 25%, #E8E8E2 37%, #F1F1EC 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ------------------------------ 分页 ------------------------------ */

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap;
}
.pg-info { font-size: 12.5px; color: var(--muted); }
.pg-ctrl { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pg-btn {
  min-width: 32px; height: 30px; padding: 0 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  cursor: pointer; font-size: 13px;
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--primary); }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-gap { color: var(--muted); padding: 0 2px; }

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--primary); background: #FBFCF8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #E7C7BF; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warn { color: var(--warn); border-color: #EBD9B7; }
.btn-warn:hover:not(:disabled) { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: transparent; color: var(--primary); cursor: pointer; padding: 0 2px; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.btn-link:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

/* ------------------------------ 表单 ------------------------------ */

.field { margin-bottom: 13px; min-width: 0; }
.field-label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.field-hint { margin-left: 6px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 4px; }

.input {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(185, 196, 163, .28); }
.input:disabled { background: #F7F7F4; color: var(--muted); cursor: not-allowed; }
.input::placeholder { color: #B4B4AE; }
.textarea { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; min-height: 76px; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8A86' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5 12 15l6-5.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .affix {
  position: absolute; right: 11px; font-size: 12px; color: var(--muted); pointer-events: none;
}
.input-affix .input { padding-right: 34px; }

.form-grid { display: grid; gap: 0 14px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .span-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.form-section-title {
  font-size: 12.5px; font-weight: 600; color: var(--primary); letter-spacing: .4px;
  margin: 6px 0 10px; padding-left: 8px; border-left: 3px solid var(--accent);
}
.form-section-title:first-child { margin-top: 0; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 40px; height: 22px; border-radius: 999px; background: #D8D8D2; position: relative;
  transition: background .18s; flex: 0 0 auto;
}
.switch-dot {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(185, 196, 163, .4); }
.switch.disabled { opacity: .55; cursor: not-allowed; }
.switch-label { font-size: 13.5px; }

.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13.5px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.checkbox.disabled { opacity: .55; cursor: not-allowed; }

/* ------------------------------ 下拉菜单 ------------------------------ */

.dropdown { position: relative; display: inline-block; }
.trigger-plain, .chip-trigger {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px;
}
.trigger-plain:hover, .chip-trigger:hover { color: var(--primary); }
.trigger-plain .ico, .chip-trigger .ico { opacity: .6; }
.menu {
  position: absolute; right: 0; top: calc(100% + 5px); min-width: 156px; z-index: 400;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 5px; display: none;
}
.drop-up .menu { top: auto; bottom: calc(100% + 5px); }
.menu.open { display: block; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 10px; border: 0; background: transparent; border-radius: 6px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.menu-item:hover:not(:disabled) { background: var(--bg); }
.menu-item.danger { color: var(--danger); }
.menu-item.disabled, .menu-item:disabled { color: #BDBDB7; cursor: not-allowed; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 4px; }

/* ------------------------------ 弹窗 ------------------------------ */

.layer { position: relative; z-index: 1000; }
.modal-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1000; }
.modal-layer > * { pointer-events: auto; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(38, 42, 36, .42);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade-in .16s ease;
}
.drawer-mask { justify-content: flex-end; padding: 0; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column;
  animation: modal-in .18s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-title { font-size: 15.5px; font-weight: 600; }
.modal-close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px; padding: 13px 18px;
  border-top: 1px solid var(--line-soft); background: #FCFCFA;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.confirm-body { font-size: 13.5px; }
.confirm-msg { color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }
.confirm-body .field { margin-top: 14px; }

.drawer {
  background: #fff; height: 100vh; max-width: 96vw; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: drawer-in .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-body { padding: 16px 18px 40px; overflow-y: auto; flex: 1; }

.copy-row { margin-bottom: 12px; }
.copy-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.copy-value { display: flex; gap: 8px; }
.copy-value .input { flex: 1; }
.copy-tip { display: block; font-size: 11.5px; color: var(--warn); margin-top: 5px; }

/* ------------------------------ Toast ------------------------------ */

.toast-layer {
  position: fixed; top: 18px; left: 0; right: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 8px; max-width: 460px;
  padding: 10px 15px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: 13.5px; animation: toast-in .18s ease; pointer-events: auto;
}
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.toast-ico { display: inline-flex; margin-top: 1px; }
.toast-msg { line-height: 1.55; word-break: break-word; }
.toast-success { border-color: #D6E5D6; background: var(--ok-soft); color: #3F6B3F; }
.toast-error { border-color: #F0D5CE; background: var(--danger-soft); color: #93412F; }
.toast-warn { border-color: #F0E0C2; background: var(--warn-soft); color: #8A6320; }
.toast-info { border-color: var(--line); background: #fff; color: var(--text); }

/* ------------------------------ 状态块 ------------------------------ */

.state-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; padding: 34px 16px; color: var(--muted); font-size: 13px; text-align: center;
}
.state-box.empty .state-ico { color: #CFCFC8; }
.state-box.error .state-ico { color: var(--danger); }
.state-hint { font-size: 12px; color: #A9A9A3; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ Tabs ------------------------------ */

.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line);
  margin-bottom: 16px; overflow-x: auto;
}
.tab {
  padding: 10px 15px; border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.tab-count {
  font-size: 11px; background: var(--bg); color: var(--muted);
  padding: 0 6px; border-radius: 9px;
}
.tab.active .tab-count { background: var(--accent-soft); color: var(--primary); }

/* ------------------------------ 工具条 ------------------------------ */

.toolbar {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft); background: #FCFCFA;
}
.toolbar .field { margin-bottom: 0; }
.toolbar .input { height: 34px; }
.toolbar-search { min-width: 220px; }
.toolbar-spacer { flex: 1; }
.toolbar-summary {
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted);
  padding: 9px 16px; background: #FAFAF8; border-bottom: 1px solid var(--line-soft);
}
.toolbar-summary b { color: var(--text); font-size: 14px; }

/* ------------------------------ 榜单条 ------------------------------ */

.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; gap: 10px; align-items: flex-start; }
.bar-row.clickable { cursor: pointer; border-radius: var(--radius-sm); padding: 5px 6px; margin: -5px -6px; }
.bar-row.clickable:hover { background: #FAFAF8; }
.bar-rank {
  flex: 0 0 20px; height: 20px; border-radius: 6px; background: var(--bg);
  color: var(--muted); font-size: 11.5px; display: inline-flex;
  align-items: center; justify-content: center; margin-top: 1px;
}
.bar-row:nth-child(1) .bar-rank { background: var(--primary); color: #fff; }
.bar-row:nth-child(2) .bar-rank { background: var(--primary-light); color: #fff; }
.bar-row:nth-child(3) .bar-rank { background: var(--accent); color: #495642; }
.bar-main { flex: 1; min-width: 0; }
.bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { height: 7px; background: #F0F0EC; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width .4s ease; }
.bar-fill.tone-primary { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.bar-fill.tone-accent { background: linear-gradient(90deg, var(--accent), #D5DCC4); }
.bar-fill.tone-info { background: linear-gradient(90deg, var(--info), #7FA0BC); }
.bar-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.dist-list { display: flex; flex-direction: column; gap: 12px; }
.dist-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.dist-value { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ------------------------------ 图表 ------------------------------ */

.chart-svg { width: 100%; height: auto; display: block; }
.chart-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.chart-legend { display: flex; gap: 16px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-svg { flex: 0 0 auto; }
.legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .lg-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .lg-value { color: var(--text-2); font-variant-numeric: tabular-nums; }
.legend .lg-pct { color: var(--muted); font-size: 12px; min-width: 34px; text-align: right; }
.sparkline { display: block; }

/* ------------------------------ 登录页 ------------------------------ */

.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}
.login-brand {
  background: linear-gradient(150deg, #5C6B57 0%, #495642 55%, #3C4737 100%);
  color: #fff; padding: 54px 56px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-brand::after {
  content: ''; position: absolute; right: -140px; bottom: -180px;
  width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(185, 196, 163, .34), transparent 68%);
}
.login-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-logo .l-name { font-size: 19px; font-weight: 700; letter-spacing: .6px; }
.login-logo .l-sub { font-size: 11px; letter-spacing: 2.6px; color: var(--accent); text-transform: uppercase; }
.login-title { font-size: 30px; font-weight: 700; line-height: 1.35; margin-bottom: 12px; letter-spacing: .4px; }
.login-desc { font-size: 14px; color: rgba(255, 255, 255, .78); line-height: 1.85; margin-bottom: 30px; }
.login-points { display: flex; flex-direction: column; gap: 11px; }
.login-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, .9); }
.login-points .pt-ico {
  width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .12);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.login-brand-foot { position: relative; z-index: 1; margin-top: 42px; font-size: 11.5px; color: rgba(255, 255, 255, .5); letter-spacing: .3px; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 392px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-card .login-sub { font-size: 13px; color: var(--muted); margin-bottom: 26px; }
.login-form .field { margin-bottom: 15px; }
.login-form .input { height: 42px; }
.login-submit { width: 100%; height: 42px; font-size: 15px; margin-top: 6px; }
.login-err {
  background: var(--danger-soft); color: #93412F; border: 1px solid #F0D5CE;
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px;
}
.demo-accounts { margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 16px; }
.demo-title { font-size: 12px; color: var(--muted); margin-bottom: 9px; letter-spacing: .4px; }
.demo-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s;
}
.demo-item:hover { border-color: var(--accent); background: #FBFCF8; }
.demo-item .d-user { font-size: 13px; font-weight: 600; }
.demo-item .d-role { font-size: 11.5px; color: var(--muted); }
.demo-item .d-fill { margin-left: auto; font-size: 11.5px; color: var(--primary); }
.login-tip { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 14px; }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { padding: 34px 26px; }
  .login-title { font-size: 23px; }
  .login-brand-foot { margin-top: 24px; }
  .login-points { display: none; }
}

/* ------------------------------ 详情页 ------------------------------ */

.detail-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.detail-head .dh-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-head h1 { font-size: 19px; font-weight: 700; }
.detail-head .dh-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.detail-head .dh-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.detail-head .dh-meta .m-item { font-size: 12.5px; color: var(--muted); }
.detail-head .dh-meta .m-item b { display: block; font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.detail-head .dh-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.feature-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.feature-row:last-child { border-bottom: 0; }
.feature-row .f-main { flex: 1; min-width: 0; }
.feature-row .f-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.feature-row .f-key { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.feature-row .f-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.store-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: #fff; }
.store-card:last-child { margin-bottom: 0; }
.store-card .s-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.store-card .s-name { font-size: 14px; font-weight: 600; }
.setting-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }

.config-group { margin-bottom: 16px; }
.config-item { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.config-item:last-child { border-bottom: 0; }
.config-item .c-label { font-size: 13px; font-weight: 500; padding-top: 8px; }
.config-item .c-remark { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.config-item .c-value { display: flex; gap: 8px; align-items: center; }
.config-item .c-flag { font-size: 11.5px; color: var(--warn); margin-top: 4px; }

.readonly-value { font-size: 13.5px; padding: 8px 0; color: var(--text-2); }

.member-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.member-head .m-avatar {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft);
  color: var(--primary); display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; overflow: hidden; flex: 0 0 auto;
}
.member-head .m-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wallet-amount { font-variant-numeric: tabular-nums; }
.wallet-amount.pos { color: var(--ok); }
.wallet-amount.neg { color: var(--danger); }
.section-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 16px 0 8px; letter-spacing: .3px; }
.section-label:first-child { margin-top: 0; }

.plan-card { display: flex; flex-direction: column; }
.plan-price { font-size: 26px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.feature-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin-top: 10px; }
.feature-matrix .fm-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.feature-matrix .fm-item.off { color: #B6B6B0; }
.feature-matrix .fm-ico { display: inline-flex; }

.template-card { display: flex; gap: 14px; align-items: stretch; }
.template-cover {
  width: 108px; flex: 0 0 108px; height: 92px; border-radius: var(--radius-sm);
  background: linear-gradient(140deg, var(--accent-soft), #F4F6EE);
  display: flex; align-items: center; justify-content: center; color: var(--primary);
  border: 1px solid var(--line); overflow: hidden;
}
.template-cover img { width: 100%; height: 100%; object-fit: cover; }
.schema-list { display: flex; flex-direction: column; gap: 8px; }
.schema-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; }
.schema-item .sc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.schema-item .sc-type { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--primary); background: var(--accent-soft); padding: 0 6px; border-radius: 5px; }
.schema-item pre {
  margin: 8px 0 0; padding: 9px; background: #FAFAF8; border-radius: 6px;
  font-size: 11.5px; color: var(--text-2); overflow-x: auto; max-height: 180px; line-height: 1.6;
}

.inline-check { display: flex; align-items: center; gap: 8px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 12px; }
.notice-item.off { opacity: .62; }
.notice-item .n-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; flex-wrap: wrap; }
.notice-item .n-title { font-size: 14.5px; font-weight: 600; }
.notice-item .n-content { font-size: 13px; color: var(--text-2); line-height: 1.75; white-space: pre-wrap; }
.notice-item .n-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }

.sys-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sys-item { background: #FAFAF8; border-radius: var(--radius-sm); padding: 10px 12px; }
.sys-item .s-label { font-size: 11.5px; color: var(--muted); }
.sys-item .s-value { font-size: 15px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ------------------------------ 行业分类 ------------------------------ */

.ind-card { display: flex; flex-direction: column; }
.ind-card .card-body { flex: 1; }
.ind-head { display: flex; gap: 11px; align-items: flex-start; }
.ind-emoji {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1;
}
.ind-title-wrap { flex: 1; min-width: 0; }
.ind-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ind-name { font-size: 15px; font-weight: 600; }
.ind-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.ind-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 11px; font-size: 12.5px; color: var(--text-2); }
.ind-meta b { font-variant-numeric: tabular-nums; }
.ind-count { color: var(--muted); }
.ind-swatch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ind-tenant { margin-top: 11px; font-size: 13px; }
.ind-foot {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-top: 1px solid var(--line-soft); background: #FCFCFA;
  border-radius: 0 0 var(--radius) var(--radius);
}
.ind-note { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.ind-section { margin-top: 18px; }
.ind-section-title {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600;
  padding-bottom: 7px; margin-bottom: 9px; border-bottom: 1px solid var(--line-soft);
}

/* 行业胶囊（列表 / 详情复用） */
.ind-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 6px;
  background: var(--accent-soft); color: var(--primary); border: 1px solid #D8E0C8;
  border-radius: 999px; font-size: 12.5px; line-height: 19px; white-space: nowrap;
}
.ind-chip .ic-emoji { font-size: 13px; }

/* 主题色块 */
.theme-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2);
  background: #FAFAF8; border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 9px;
}

/* 行业单选网格（开通向导 / 代改行业） */
.ind-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; margin-top: 4px; }
.ind-pick-item {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; font-family: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
.ind-pick-item:hover { border-color: var(--accent); background: #FBFCF8; }
.ind-pick-item.active { border-color: var(--primary); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.ind-pick-emoji { font-size: 18px; line-height: 1.2; }
.ind-pick-name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.ind-pick-desc { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.ind-preview { margin-top: 11px; }

/* 取色器 */
.theme-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.theme-pick { display: block; }
.theme-pick .tp-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.theme-pick .tp-ctrl { display: flex; align-items: center; gap: 9px; }
.color-input {
  width: 46px; height: 32px; padding: 2px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer;
}
.emoji-input { width: 88px; text-align: center; }

/* 业务术语 */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 9px; }
.term-item {
  display: flex; align-items: center; gap: 8px; background: #FAFAF8;
  border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12.5px;
}
.term-item .t-label { color: var(--muted); flex: 0 0 auto; }
.term-item .t-key { color: var(--accent); font-size: 10.5px; flex: 0 0 auto; }
.term-item .t-value { margin-left: auto; font-weight: 600; }

/* 点单方式 */
.ot-list { display: flex; flex-direction: column; gap: 8px; }
.ot-row {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px;
}
.ot-edit-row {
  display: grid; grid-template-columns: 148px minmax(0, 1fr) minmax(0, 1fr) 116px 80px 34px;
  gap: 0 10px; align-items: end; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 11px 2px; background: #FCFCFA;
}
.ot-edit-row .ot-remove { margin-bottom: 13px; height: 32px; }

/* 功能开关（只读展示 / 编辑） */
.feature-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.feature-chips .fc-item {
  display: flex; align-items: center; gap: 7px; background: #FAFAF8;
  border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12.5px;
}
.feature-chips .fc-item .f-key { color: var(--muted); font-size: 10.5px; margin-left: auto; }
.feature-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.fe-row {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 11px;
}
.fe-row .fe-main { flex: 1; min-width: 0; }
.fe-row .fe-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.fe-row .fe-name .f-key { color: var(--muted); font-size: 10.5px; }

/* 默认分类与示例商品清单 */
.cat-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; margin-bottom: 10px; }
.cat-block:last-child { margin-bottom: 0; }
.cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cat-head .cat-icon { font-size: 16px; }
.cat-head .cat-name { font-size: 13.5px; font-weight: 600; }
.prod-list { display: flex; flex-direction: column; gap: 6px; }
.prod-row {
  display: flex; align-items: center; gap: 12px;
  border-top: 1px dashed var(--line-soft); padding-top: 7px;
}
.prod-row:first-child { border-top: 0; padding-top: 0; }
.prod-row .p-main { flex: 1; min-width: 0; }
.prod-row .p-name { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.prod-row .p-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.prod-row .p-price { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: 13px; }
.prod-row .p-origin { color: var(--muted); text-decoration: line-through; font-size: 11.5px; }

/* ------------------------------ 响应式 ------------------------------ */

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

@media (max-width: 900px) {
  :root { --sidebar-w: 62px; }
  .sidebar-brand .brand-text, .nav-group-title, .nav-item span:not(.nav-badge), .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item .nav-badge { position: absolute; margin: 0; transform: translate(14px, -12px); }
  .nav-item { position: relative; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 40px; }
  .topbar { padding: 0 12px; }
  .user-chip .u-name, .user-chip .u-role { display: none; }
  .config-item { grid-template-columns: 1fr; }
  .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .ot-edit-row { grid-template-columns: 1fr; }
  .toolbar-search { min-width: 100%; }
}
