.settings-main{max-width:1700px;width:100%;padding:28px}
.settings-topbar{margin-bottom:18px;align-items:flex-end}
.settings-topbar h1{font-size:30px;line-height:1.08;letter-spacing:-.7px}
.settings-topbar p{font-size:13px;color:var(--muted)}
.settings-readonly{height:38px;display:flex;align-items:center;gap:7px;padding:0 12px;border:1px solid #dae4f0;border-radius:11px;background:#fff;color:#65748a;font-size:10px;font-weight:700}
.settings-readonly svg{width:15px;height:15px;color:#1769ff}
.settings-health{margin-bottom:16px;padding:13px 16px;border-radius:14px}
body[data-system-status="warning"] .settings-health{background:linear-gradient(90deg,#fffaf0,#f8fffb)}
body[data-system-status="error"] .settings-health{background:linear-gradient(90deg,#fff3f3,#fffaf0)}
.settings-kpi-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;margin-bottom:16px}
.settings-kpi{min-height:106px;padding:15px;border:1px solid var(--line);border-radius:15px;background:#fff;box-shadow:var(--shadow);display:flex;justify-content:space-between;gap:12px}
.settings-kpi>div{min-width:0}
.settings-kpi small{display:block;color:#748198;font-size:10px;font-weight:650}
.settings-kpi strong{display:block;margin-top:10px;color:#17233c;font-size:20px;line-height:1.08;letter-spacing:-.35px;overflow:hidden;text-overflow:ellipsis}
.settings-kpi span:not(.settings-kpi-icon){display:block;margin-top:6px;color:#97a2b3;font-size:8.5px;line-height:1.35}
.settings-kpi-icon{width:36px;height:36px;flex:0 0 36px;border-radius:11px;display:grid;place-items:center;background:#edf4ff;color:#1769ff}
.settings-kpi-icon svg{width:17px;height:17px}
.settings-panel{margin-bottom:16px;border-radius:16px!important}
.settings-panel .panel-head{padding:18px 18px 14px}
.settings-panel .panel-head h2{font-size:16px;font-weight:700}
.settings-panel .panel-head h2 svg{width:18px;height:18px;color:#1769ff}
.settings-panel .panel-head p{font-size:11px;margin-top:4px;color:#8591a4}
.settings-head-badge{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:28px;padding:0 10px;border-radius:999px;background:#eaf2ff;color:#1769ff;font-size:10px;font-weight:800}
.settings-head-badge.neutral{background:#f2f5f9;color:#67778e}
.settings-table{width:100%;border-collapse:collapse;font-size:10.5px}
.settings-table thead th{padding:10px 12px;background:#f7f9fc;border-top:1px solid #edf1f6;border-bottom:1px solid #e5ebf3;color:#718096;font-size:9px;font-weight:750;text-align:left;white-space:nowrap}
.settings-table tbody td{padding:11px 12px;border-bottom:1px solid #edf1f6;color:#263650;vertical-align:middle}
.settings-table tbody tr:hover{background:#fbfdff}
.settings-table .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.component-name{display:flex;align-items:center;gap:10px;min-width:210px}
.component-name>span{width:31px;height:31px;border-radius:9px;display:grid;place-items:center;background:#edf4ff;color:#1769ff}
.component-name svg{width:15px;height:15px}
.component-name strong,.sys-site-cell strong{display:block;color:#17233c;font-size:10.5px}
.component-name small,.sys-site-cell small{display:block;color:#96a2b3;font-size:8px;margin-top:2px}
.cell-sub{display:block;color:#98a3b3;font-size:8px;margin-top:3px}
.sys-status{display:inline-flex;align-items:center;justify-content:center;height:22px;padding:0 7px;border-radius:999px;font-size:8px;font-weight:800;white-space:nowrap}
.sys-status.good{background:#def7eb;color:#0b8051}
.sys-status.warn{background:#fff1d6;color:#9c6500}
.sys-status.bad{background:#ffe7e7;color:#b83b3b}
.sys-status.neutral{background:#eef2f7;color:#66768d}
.derived-mark{display:inline-flex;margin-left:6px;padding:2px 5px;border-radius:6px;background:#f2f5f9;color:#8a96a8;font-size:7px;font-weight:750;vertical-align:middle}
.sys-site-cell{display:flex;align-items:center;gap:9px;min-width:155px}
.sys-site-icon{width:27px;height:27px;flex:0 0 27px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;display:grid;place-items:center;overflow:hidden}
.sys-site-icon img{width:18px;height:18px;border-radius:4px}
.sys-site-icon b{font-size:8px;color:#23344f}
.site-sync-cell{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.site-sync-cell small{display:block;width:100%;color:#8d9aab;font-size:7.7px}
.settings-sites-wrap{overflow-x:auto}
.sites-sync-table{min-width:980px}
.settings-two-col{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}
.db-table-wrap{max-height:430px;overflow:auto}
.db-table thead th{position:sticky;top:0;z-index:2}
.db-table code{font:700 9.5px/1.3 "SFMono-Regular",Consolas,monospace;color:#31435e}
.retention-list{padding:0 18px 18px;display:grid;grid-template-columns:1fr 1fr;gap:9px}
.retention-row{display:flex;align-items:center;gap:10px;min-height:58px;padding:10px 11px;border:1px solid #e5ebf3;border-radius:12px;background:#fff}
.retention-row>span{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:#f2f6fb;color:#55708f}
.retention-row svg{width:14px;height:14px}
.retention-row strong{display:block;color:#1d2b43;font-size:9.5px}
.retention-row small{display:block;margin-top:3px;color:#8794a6;font-size:8px;line-height:1.25}
.technical-grid{padding:0 18px 18px;display:grid;grid-template-columns:1fr 1fr;gap:9px}
.technical-item{display:flex;gap:10px;align-items:flex-start;padding:11px;border:1px solid #e5ebf3;border-radius:12px}
.technical-item>span{width:31px;height:31px;display:grid;place-items:center;border-radius:9px;background:#edf4ff;color:#1769ff}
.technical-item svg{width:15px;height:15px}
.technical-item small{display:block;color:#7f8ca0;font-size:8px;font-weight:700}
.technical-item strong{display:block;color:#17233c;font-size:14px;margin-top:3px}
.technical-item em{display:block;color:#99a4b3;font-style:normal;font-size:7.8px;margin-top:3px;line-height:1.25}
.errors-list{padding:0 18px 18px}
.error-row{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid #edf1f6}
.error-row>span{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:#ffeaea;color:#bc3e3e}
.error-row svg{width:14px;height:14px}
.error-row strong{display:block;color:#24344f;font-size:9.5px}
.error-row small{display:block;margin-top:3px;color:#8a96a8;font-size:8px}
.no-errors{display:flex;gap:11px;align-items:center;padding:14px;border:1px solid #dff1e8;border-radius:12px;background:#f7fcf9}
.no-errors>svg{width:22px;height:22px;color:#0c9b62}
.no-errors strong{display:block;color:#1f4937;font-size:10px}
.no-errors span{display:block;color:#759084;font-size:8px;margin-top:3px}
@media(max-width:1450px){.settings-kpi-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1100px){.settings-two-col{grid-template-columns:1fr}.retention-list,.technical-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.settings-main{padding:18px}.settings-kpi-grid{grid-template-columns:1fr 1fr}.retention-list,.technical-grid{grid-template-columns:1fr}}
@media(max-width:480px){.settings-kpi-grid{grid-template-columns:1fr}}


/* Settings v1.1 */
.settings-top-actions{display:flex;align-items:center;gap:9px}
.settings-generated{color:#8a97a9;font-size:8.5px;white-space:nowrap}
.settings-refresh-btn{height:38px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 13px;border:1px solid #cfdced;border-radius:11px;background:#fff;color:#31506f;font:700 9.5px/1 Inter,sans-serif;cursor:pointer;transition:.16s ease}
.settings-refresh-btn:hover{border-color:#9fc0ef;background:#f7fbff;color:#1769ff}
.settings-refresh-btn:disabled{opacity:.65;cursor:wait}
.settings-refresh-btn svg{width:15px;height:15px;color:#1769ff}
.settings-refresh-btn.is-loading svg{animation:settings-spin .8s linear infinite}
@keyframes settings-spin{to{transform:rotate(360deg)}}
.settings-refreshed .settings-health{box-shadow:0 0 0 2px rgba(23,105,255,.08),var(--shadow)}
.components-table thead th,
.sites-sync-table thead th{
  display:table-cell!important;
  visibility:visible!important;
  opacity:1!important;
  background:#f5f8fc!important;
  color:#5f7088!important;
  border-top:1px solid #e4ebf4!important;
  border-bottom:1px solid #dce5ef!important;
  font-size:9px!important;
  font-weight:800!important;
  letter-spacing:.01em;
}
.sites-sync-table thead{
  display:table-header-group!important;
  visibility:visible!important;
}
.sites-sync-table thead tr{display:table-row!important;visibility:visible!important}
.sites-sync-table thead th:first-child{padding-left:18px}
.sites-sync-table tbody td:first-child{padding-left:18px}
.components-table th:nth-child(1){width:25%}
.components-table th:nth-child(2){width:17%}
.components-table th:nth-child(3){width:17%}
.components-table th:nth-child(4){width:18%}
.components-table th:nth-child(5){width:14%}
.components-table th:nth-child(6){width:9%}
.components-table td strong{color:#263650}
.site-sync-cell .sys-status{min-width:58px}
.db-table td:nth-child(2) strong{color:#22334e}
.settings-kpi strong{white-space:nowrap}
@media(max-width:1050px){
  .settings-topbar{align-items:flex-start;gap:12px}
  .settings-top-actions{flex-wrap:wrap;justify-content:flex-end}
  .settings-generated{width:100%;text-align:right}
}


/* Settings v1.2 final polish */
.health-badges .health-badge{
  white-space:nowrap;
}
.db-head-meta{
  display:flex;
  align-items:center;
  gap:9px;
}
.db-head-meta small{
  color:#8c99aa;
  font-size:8px;
  white-space:nowrap;
}
.db-table-wrap{
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
.db-table{
  width:100%!important;
  table-layout:fixed;
}
.db-table th:nth-child(1){width:38%}
.db-table th:nth-child(2){width:15%}
.db-table th:nth-child(3){width:15%}
.db-table th:nth-child(4){width:15%}
.db-table th:nth-child(5){width:17%}
.db-table td,
.db-table th{
  min-width:0!important;
}
.db-table code{
  white-space:normal!important;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.db-share{
  display:inline-flex;
  margin-left:7px;
  padding:2px 5px;
  border-radius:6px;
  background:#eef4ff;
  color:#1769ff;
  font-size:7px;
  font-weight:800;
  vertical-align:middle;
  white-space:nowrap;
}
.db-dominant-row{
  background:#fbfdff;
}
.db-dominant-row td:first-child{
  box-shadow:inset 3px 0 0 #1769ff;
}
.settings-main{
  padding-bottom:24px;
}
