:root {
  color-scheme: light;
  --ink: #172238;
  --muted: #64738c;
  --border: #e1e6ef;
  --surface: #fff;
  --workspace: #f3f5f9;
  --brand: #5242e7;
  --brand-hover: #4432cc;
  --sidebar: #11192c;
  --shadow: 0 1px 3px #13244208, 0 4px 12px #13244204;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--workspace); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
button, input, select { accent-color: var(--brand); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid #7870fa;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; vertical-align: middle; }
input, select {
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dbe2ee;
  border-radius: 8px;
}
input::placeholder { color: #8593a9; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 30; top: 12px; left: 12px; background: white; padding: 10px 16px; border-radius: 8px; }
.startup { min-height: 100dvh; display: grid; place-items: center; }
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e8e5ff;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: rotate .75s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }

.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #dbe2ed;
  border-radius: 8px;
  background: var(--surface);
  color: #34425b;
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: #f5f6fc; border-color: #c7c5ee; }
.button-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button-primary:hover:not(:disabled) { color: #fff; background: var(--brand-hover); border-color: var(--brand-hover); }
.icon-button { min-width: 35px; min-height: 35px; padding: 7px; }
.small-button { min-height: 32px; padding: 4px 10px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  min-height: 22px;
  border-radius: 6px;
  font-size: .8rem;
  line-height: 1.15;
  font-weight: 700;
  white-space: nowrap;
}
.badge.green { background: #ddf7e9; color: #117653; }
.badge.amber { background: #fdf2d5; color: #935708; }
.badge.red { background: #fee5e5; color: #ac3338; }
.badge.blue { background: #e9edff; color: #4336b3; }
.badge.slate { background: #eef1f6; color: #60708a; }
.badge.teal { background: #ddf8f2; color: #137e6d; }
.badge.purple { background: #f1eaff; color: #6940bf; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 41px;
  height: 41px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #7868f6, #39acf0 82%);
  color: white;
  font-size: 1rem;
  letter-spacing: -.035em;
  font-weight: 800;
  box-shadow: 0 5px 18px #4838be40;
}
.brand-name { display: grid; gap: 4px; }
.brand-name strong { color: #f8f9ff; font-size: 1.08rem; line-height: 1.15; white-space: nowrap; }
.brand-name small { color: #a1adc5; font-size: .77rem; white-space: nowrap; }

.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 480px);
  place-content: center;
  padding: clamp(16px, 5vw, 48px);
  background: radial-gradient(ellipse at 93% 85%, #39298d 0, #221d50 33%, #11192c 77%);
}
.login-card {
  color: var(--ink);
  width: 100%;
  padding: clamp(26px, 3.7vw, 52px);
  background: #fff;
  border: 1px solid #fff7;
  border-radius: 22px;
  box-shadow: 0 25px 65px #0c0e3044;
}
.login-card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.login-key-icon { width: 45px; height: 45px; display: grid; place-items: center; color: var(--brand); background: #eeebff; border-radius: 12px; }
.login-card h1 { font-size: clamp(1.8rem, 2.6vw, 2.35rem); letter-spacing: -.04em; }
.login-card > p { margin-top: 7px; color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 8px; margin-top: 24px; }
.login-form label { font-size: .89rem; font-weight: 680; margin-top: 7px; }
.login-form input { width: 100%; min-height: 46px; padding: 0 13px; background: #fbfcfe; }
.password-field { position: relative; }
.password-field input { padding-right: 45px; }
.password-field button { position: absolute; inset: 6px 7px 6px auto; border: 0; color: #6c7991; background: transparent; }
.login-submit { width: 100%; margin-top: 11px; min-height: 46px; font-size: 1rem; box-shadow: 0 5px 12px #5144e52a; }
.login-submit svg { margin-left: 4px; }
.form-error { color: #a92c36; background: #fff1f2; border: 1px solid #ffd4d8; border-radius: 8px; padding: 9px 11px; font-size: .9rem; overflow-wrap: anywhere; }
.demo-help { margin-top: 18px; border: 1px solid var(--border); border-radius: 9px; background: #f8f9fc; color: #3d4c67; padding: 10px 12px; }
.demo-help summary { cursor: pointer; font-size: .88rem; font-weight: 700; }
.demo-help p { font-size: .8rem; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.demo-help code { overflow-wrap: anywhere; }
.demo-roles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.demo-role { min-height: 28px; padding: 3px 7px; font-size: .8rem; }
.login-footer { border-top: 1px solid var(--border); padding-top: 15px; margin-top: 21px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: .81rem; }

.workbench { --sidebar-width: 232px; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--sidebar);
  color: #c9d1e3;
  padding: 23px 14px 15px;
  overflow-y: auto;
}
.sidebar-brand { display: block; border-bottom: 1px solid #ffffff13; margin: 0 0 21px; padding: 0 7px 23px; }
.sidebar-nav { min-height: 0; flex: 1 0 auto; }
.nav-group { margin-bottom: 23px; }
.nav-group > p { color: #a3afc7; font-weight: 680; font-size: .74rem; letter-spacing: .075em; margin: 0 0 8px 11px; }
.sidebar-link { display: flex; position: relative; gap: 11px; align-items: center; min-height: 43px; padding: 7px 11px; color: #c5cfe4; border-radius: 8px; font-size: .93rem; font-weight: 630; }
.sidebar-link svg { color: #a8b5ce; }
.sidebar-link:hover { color: #fff; background: #fff1; }
.sidebar-link.active { background: #292552; color: #fff; }
.sidebar-link.active::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; background: #a79aff; }
.sidebar-link.active svg { color: #bdb3ff; }
.sidebar-submenu-heading { list-style: none; cursor: pointer; }
.sidebar-submenu-heading::-webkit-details-marker { display: none; }
.sidebar-submenu.contains-current > summary { color: #f4f1ff; }
.sidebar-disclosure { display: flex; margin-left: auto; }
.sidebar-submenu[open] .sidebar-disclosure { transform: rotate(90deg); }
.sidebar-submenu-links { margin: 0 0 5px 19px; padding-left: 9px; border-left: 1px solid #ffffff21; }
.sidebar-child-link { gap: 8px; min-height: 38px; padding: 6px 8px; font-size: .84rem; }
.sidebar-child-link svg { flex: none; }
.sidebar-bottom { margin-top: 20px; border-top: 1px solid #ffffff13; padding-top: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px; border-radius: 9px; background: #ffffff0d; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%; background: linear-gradient(145deg, #b49aef, #775ae8); font-weight: 800; color: #fff; }
.user-details { display: grid; gap: 3px; flex: 1; min-width: 0; }
.user-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f4f7ff; font-size: .85rem; }
.user-details small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b2bdd5; font-size: .72rem; }
.logout { padding: 4px; min-width: 29px; min-height: 29px; border-color: transparent; color: #b8c3da; background: transparent; }
.logout:hover:not(:disabled) { background: #ffffff14; border-color: #ffffff20; color: white; }
.workbench-main { min-width: 0; }
.topbar { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--border); background: #fff; }
.breadcrumbs, .topbar-actions, .topbar-date { display: flex; align-items: center; gap: 9px; }
.breadcrumbs { min-width: 0; font-size: .91rem; }
.breadcrumbs span, .breadcrumbs svg { color: var(--muted); }
.breadcrumbs strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; gap: 13px; }
.topbar-date { color: #52617a; font-size: .84rem; white-space: nowrap; gap: 6px; }
.menu-toggle, .nav-overlay { display: none; }
.workspace-content { padding: 25px 28px 38px; max-width: 1680px; margin: 0 auto; min-width: 0; }
.workspace-content:focus { outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 20px; }
.page-heading h1 { font-size: clamp(1.55rem, 2.6vw, 2rem); line-height: 1.25; letter-spacing: -.045em; }
.page-heading p { color: var(--muted); font-size: .91rem; margin-top: 6px; line-height: 1.5; }
.page-tools { display: flex; flex: none; align-items: center; gap: 9px; }
.update-note { color: var(--muted); font-size: .78rem; white-space: nowrap; }

.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 16px 19px 14px; }
.panel-heading h2 { font-size: 1.04rem; line-height: 1.3; font-weight: 760; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.panel-heading > svg { color: #74819b; }
.overview-filters {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 14px;
  padding: 10px 12px;
  margin-bottom: 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.filter-cluster, .custom-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-select {
  position: relative;
  display: flex;
  align-items: center;
  color: #566584;
}
.filter-select svg { position: absolute; left: 10px; pointer-events: none; }
.filter-select select {
  appearance: none;
  font-size: .87rem;
  font-weight: 650;
  min-height: 34px;
  padding: 5px 28px 5px 10px;
  background: #fbfcff;
}
.filter-select::after { content: ""; position: absolute; right: 12px; width: 6px; height: 6px; border: solid #647389; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-1.5px); pointer-events: none; }
.filter-select:has(svg) select { padding-left: 33px; }
.filter-period { color: var(--muted); font-size: .82rem; }
.custom-range label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .78rem; }
.custom-range input { min-height: 34px; padding: 4px 8px; }
.custom-range button { min-height: 34px; padding: 4px 10px; }
.overview-notice:not(:empty) { padding: 9px 12px; background: #fff4d7; border: 1px solid #f3deb1; color: #81540b; border-radius: 8px; margin-bottom: 12px; font-size: .87rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.metric-card { padding: 15px 16px 13px; }
.metric-top { display: flex; align-items: center; gap: 9px; color: #556681; font-size: .88rem; font-weight: 650; }
.metric-icon { display: grid; place-items: center; flex: none; width: 33px; height: 33px; border-radius: 9px; }
.metric-icon.purple { color: #5140d4; background: #efecff; }
.metric-icon.teal { color: #0f846d; background: #e3f8f1; }
.metric-icon.blue { color: #2c67c8; background: #e8f0ff; }
.metric-icon.amber { color: #a76010; background: #fff2db; }
.metric-card > strong { display: block; margin-top: 11px; font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-card > p { color: var(--muted); margin-top: 7px; font-size: .77rem; line-height: 1.4; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2.03fr) minmax(0, 1fr); gap: 15px; margin-bottom: 15px; }
.overview-rankings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.overview-body .empty-panel { margin: 0; background: none; border: 0; }
.overview-body > .empty-panel { background: #fff; border: 1px solid var(--border); }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; color: #53627d; font-size: .78rem; white-space: nowrap; margin-top: 3px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 100%; background: #5a49e9; }
.legend-dot.teal, .legend-dot.channel-1 { background: #16b498; }
.legend-dot.channel-2 { background: #f29d42; }
.legend-dot.channel-3 { background: #4a83e7; }
.trend-chart { padding: 0 14px 3px 9px; }
.trend-svg { display: block; width: 100%; min-height: 218px; max-height: 290px; }
.trend-svg text { fill: #677590; font-family: inherit; font-size: 12px; }
.chart-gridline { stroke: #e7ebf3; stroke-dasharray: 4 4; }
.chart-line { stroke-width: 2.6; stroke-linecap: round; fill: none; }
.receipt-line { stroke: #5a49e9; }
.payout-line { stroke: #16a68c; }
.chart-node { fill: #fff; stroke-width: 1.8; }
.receipt-node { stroke: #5a49e9; }
.payout-node { stroke: #16a68c; }
.trend-point:hover .chart-node { stroke-width: 3.2; }
.chart-hitzone { stroke: transparent; stroke-width: 18; }
.ring-body { display: grid; align-content: center; padding: 0 18px 14px; gap: 0; }
.ring-chart { position: relative; display: grid; place-items: center; }
.ring-chart svg { width: min(100%, 172px); height: auto; }
.ring-track { fill: none; stroke: #edf0f5; stroke-width: 17; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.ring-center strong { line-height: 1.05; font-size: 1.5rem; font-weight: 790; letter-spacing: -.035em; }
.ring-center small { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.ring-legend { list-style: none; padding: 0; margin: 2px 0 0; display: grid; gap: 6px; }
.ring-legend li { display: flex; justify-content: space-between; gap: 9px; align-items: center; padding: 0 4px; color: #53627d; font-size: .8rem; }
.ring-legend li span { display: flex; align-items: center; gap: 8px; }
.ring-legend li b { color: #24324a; font-variant-numeric: tabular-nums; }
.table-overflow { overflow: auto; }
.data-table { border-collapse: collapse; width: 100%; font-size: .84rem; text-align: left; }
.data-table th, .data-table td { padding: 11px 13px; border-top: 1px solid #e9edf4; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 19px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 19px; }
.data-table thead th { font-size: .77rem; color: #5f6e88; background: #f6f8fc; font-weight: 700; border-block: 1px solid #e8edf5; }
.data-table tbody th { font-weight: 650; color: #24324a; }
.data-table tbody th small { display: block; color: #72819a; margin-top: 3px; font-weight: 400; }
.data-table tbody tr:hover { background: #fafbfe; }
.rate-cell { font-variant-numeric: tabular-nums; font-weight: 700; color: #4b3ad0; }
.channel-range { display: block; margin-top: 5px; color: var(--muted); font-size: .74rem; }
.followup-list { padding: 0 16px 8px; margin: 0; list-style: none; }
.followup-list li { border-top: 1px solid #edf0f5; }
.followup-list li a, .followup-list li > div { display: flex; align-items: center; gap: 9px; padding: 8px 2px; color: var(--ink); }
.followup-list li a:hover { background: #faf9ff; }
.followup-list li a > svg { margin-left: auto; color: #74819c; }
.followup-list strong, .followup-list small { display: block; }
.followup-list strong { font-size: .83rem; }
.followup-list small { font-size: .76rem; line-height: 1.35; color: var(--muted); margin-top: 3px; }
.amount-panel, .source-panel, .embed-panel { margin-bottom: 15px; }
.source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 18px 15px; gap: 9px; }
.source-grid > div { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; }
.source-grid strong { display: block; font-size: .83rem; }
.source-grid small { display: block; margin-top: 3px; color: var(--muted); font-size: .74rem; }
.overview-footnote { color: var(--muted); font-size: .78rem; display: flex; align-items: start; gap: 6px; margin-top: 8px; margin-bottom: 17px; }
.embed-content iframe { display: block; width: calc(100% - 32px); height: clamp(480px, 75vh, 880px); margin: 0 16px 16px; border: 1px solid var(--border); border-radius: 9px; }
.empty-panel { min-height: 155px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 7px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.empty-panel > span:first-child:not(.loader) { color: #6d62d8; }
.empty-panel p { color: var(--muted); font-size: .87rem; line-height: 1.5; }

.admin-tabs { display: flex; flex-wrap: wrap; column-gap: 15px; border-bottom: 1px solid #dfe5f1; margin-bottom: 15px; }
.admin-tabs button { min-height: 41px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 9px; font-weight: 650; }
.admin-tabs button[aria-pressed=true] { color: var(--brand); border-bottom-color: var(--brand); }
.admin-credential-form { display: grid; gap: 8px; max-width: 535px; padding: 0 19px 19px; }
.admin-credential-form label { font-size: .88rem; font-weight: 650; }
.admin-credential-form input { width: 100%; }
.admin-credential-form > p:not(.form-error) { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.admin-credential-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.admin-credential-test-result { overflow-wrap: anywhere; border-radius: 8px; padding: 9px 11px; border: 1px solid #dce3ef; background: #f5f7fb; }
.admin-credential-form .admin-credential-test-result[data-state="passed"] { color: #176646; background: #effaf4; border-color: #bfe8d2; }
.admin-credential-form .admin-credential-test-result[data-state="failed"] { color: #a92c36; background: #fff1f2; border-color: #ffd4d8; }
.admin-total { color: var(--muted); font-size: .87rem; }
.admin-page-list { min-width: 11rem; line-height: 1.5; }
.admin-row-actions { display: flex; gap: 6px; }
.admin-delete-button { color: #a62c41; }
.admin-danger-submit { background: #a82941; border-color: #a82941; color: #fff; }
.admin-danger-submit:hover:not(:disabled) { background: #8e2335; border-color: #8e2335; color: #fff; }
.admin-dialog { width: min(94vw, 660px); max-height: 90dvh; padding: 0; border: 1px solid var(--border); border-radius: 15px; color: var(--ink); box-shadow: 0 30px 60px #11192c45; }
.admin-dialog::backdrop { background: #11192c77; backdrop-filter: blur(2px); }
.password-dialog { width: min(94vw, 440px); }
.admin-edit-fields.password-fields { grid-template-columns: minmax(0, 1fr); }
.change-password { white-space: nowrap; }
.admin-edit-form { padding: 20px; display: grid; gap: 13px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.dialog-heading h2 { font-size: 1.18rem; }
.dialog-heading p { color: var(--muted); margin-top: 4px; font-size: .86rem; }
.dialog-heading .icon-button { border: 0; }
.admin-edit-fields, .admin-scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-edit-fields label { display: grid; gap: 4px; font-size: .86rem; font-weight: 650; }
.admin-edit-fields input, .admin-edit-fields select { min-height: 36px; padding: 6px 8px; }
.active-control { display: flex; align-items: center; gap: 8px; font-size: .87rem; }
.active-control input, .admin-scope input, .employee-permissions input { width: 15px; height: 15px; margin: 0; }
.admin-scopes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-scope, .employee-permissions { border: 1px solid var(--border); border-radius: 9px; min-width: 0; padding: 9px 8px; }
.admin-scope legend, .employee-permissions legend { font-size: .81rem; font-weight: 700; color: #53627d; }
.admin-scope label, .employee-permissions label { display: flex; align-items: center; gap: 6px; font-size: .84rem; margin-bottom: 7px; }
.employee-permissions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
.employee-permissions input { flex: 0 0 15px; }
.employee-permission-hint { color: var(--muted); font-size: .82rem; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; }
.toast { position: fixed; bottom: 19px; right: 20px; z-index: 30; background: #1f2b42; color: #fff; padding: 10px 13px; border-radius: 9px; max-width: calc(100vw - 40px); font-size: .89rem; box-shadow: 0 6px 14px #0c122840; }

@media (max-width: 1200px) {
  .workbench { --sidebar-width: 200px; }
  .topbar { padding-inline: 20px; }
  .workspace-content { padding-inline: 20px; }
  .overview-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .overview-rankings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .metric-grid { gap: 9px; }
  .metric-card { padding-inline: 11px; }
  .metric-top { gap: 6px; }
  .metric-icon { width: 29px; height: 29px; }
  .overview-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 10px; }
  .overview-rankings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-heading { padding-inline: 14px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 14px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 14px; }
  .trend-svg { min-height: 180px; }
}
@media (max-width: 790px) {
  .workbench { display: block; }
  .sidebar { transform: translateX(-100%); visibility: hidden; width: min(270px, 80vw); position: fixed; inset: 0 auto 0 0; z-index: 25; transition: transform .2s, visibility .2s; }
  .nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .nav-open .nav-overlay { display: block; position: fixed; inset: 0; z-index: 24; border: 0; background: #10172b72; }
  .nav-open { overflow: hidden; }
  .menu-toggle { display: inline-flex; min-height: 38px; min-width: 38px; }
  .topbar { height: 59px; padding-inline: 12px; gap: 9px; }
  .workspace-content { padding: 20px 15px 25px; }
}
@media (max-width: 590px) {
  .breadcrumbs > span, .breadcrumbs > svg, .topbar-date { display: none; }
  .topbar-actions { gap: 5px; }
  .page-heading { align-items: start; }
  .page-heading p { font-size: .84rem; }
  .page-tools { flex-direction: column-reverse; gap: 4px; align-items: end; }
  .page-tools .button { min-height: 33px; padding: 5px 8px; font-size: .77rem; }
  .update-note { font-size: .69rem; }
  .overview-filters { padding: 9px; }
  .filter-cluster { gap: 5px; }
  .filter-select select { font-size: .77rem; padding-left: 7px; padding-right: 20px; }
  .filter-select svg { width: 12px; left: 7px; }
  .filter-select:has(svg) select { padding-left: 23px; }
  .filter-select::after { right: 8px; width: 5px; height: 5px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { padding: 12px 9px; }
  .metric-top { font-size: .77rem; }
  .metric-icon { width: 26px; height: 26px; border-radius: 7px; }
  .metric-icon svg { width: 15px; height: 15px; }
  .metric-card > p { font-size: .72rem; }
  .overview-grid, .source-grid { grid-template-columns: minmax(0, 1fr); }
  .trend-svg { min-height: 160px; }
  .ring-body { display: flex; align-items: center; justify-content: space-around; gap: 10px; }
  .ring-chart svg { width: min(37vw, 132px); }
  .ring-center strong { font-size: 1.25rem; }
  .ring-legend { min-width: 118px; gap: 8px; }
  .admin-scopes { grid-template-columns: minmax(0, 1fr); }
  .admin-tabs { column-gap: 5px; }
  .admin-credential-form { padding-inline: 14px; }
  .admin-edit-form { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
