:root {
  color-scheme: light;
  --ink: #182235;
  --muted: #788398;
  --muted-dark: #647087;
  --line: #e9e5f2;
  --surface: #fff;
  --canvas: #f5f2fb;
  --purple: #7862e8;
  --purple-deep: #5943cb;
  --sidebar: #1b1a32;
  --sidebar-raised: #292641;
  --green: #22a879;
  --red: #dd6373;
  --theme-accent: #7862e8;
  --theme-accent-strong: #5943cb;
  --theme-accent-soft: #312d53;
  --theme-accent-light: #ab9cf6;
  --theme-accent-tint: #f0edff;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: clip; }
html[dir="rtl"] { direction: ltr; }
body { margin: 0; min-width: 320px; overflow-x: clip; background: var(--canvas); color: var(--ink); font-size: 13px; }
button, select, input { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; overflow-x: clip; }
[hidden] { display: none !important; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(ellipse at 50% 20%, #ebe6ff 0, var(--canvas) 58%); }
.auth-brand { position: absolute; top: 24px; left: 28px; margin: 0; color: var(--ink); }
.auth-brand .brand-name { color: var(--ink); }
.auth-card { width: min(100%, 410px); padding: 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 55px rgb(22 35 55 / 9%); text-align: center; }
.auth-eyebrow { color: var(--theme-accent); font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
.auth-card h1 { margin: 12px 0 8px; font-size: 23px; }
.auth-card > p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-login-button { width: 100%; justify-content: center; min-height: 42px; margin: 18px 0 11px; }
.auth-note { font-size: 10px !important; }
.auth-warning { margin: 14px 0 0; padding: 10px; border: 1px solid #f1d0cc; border-radius: 6px; color: #a94540 !important; background: #fff5f3; }
.auth-data-note { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.55; }
body[data-theme="dark"] .auth-gate { background: radial-gradient(ellipse at 50% 20%, #211d35 0, var(--canvas) 58%); }
body[data-theme="dark"] .auth-card { border-color: var(--line); background: var(--surface); }
body[data-theme="dark"] .auth-brand, body[data-theme="dark"] .auth-brand .brand-name { color: var(--ink); }
body[data-theme="dark"] .auth-warning { border-color: #68403e; color: #ffc0b8 !important; background: #382321; }

.sidebar {
  width: 252px; height: 100vh; height: 100dvh; max-height: 100vh; position: fixed; inset: 0 auto 0 0; z-index: 20;
  display: flex; flex-direction: column; padding: 23px 15px 14px; color: #d1d6e0;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a4458 transparent;
  background: var(--sidebar);
}
.brand { display: flex; align-items: center; gap: 10px; height: 38px; margin: 0 10px 24px; color: #fff; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; color: #a595ff; }
.brand-mark svg { width: 31px; height: 31px; }
.brand-name { font: 800 21px/1 "Manrope", sans-serif; letter-spacing: -1.2px; }
.server-switcher { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border: 1px solid #30394a; border-radius: 9px; color: #f2f3f8; background: var(--sidebar-raised); text-align: left; }
.server-avatar { flex: 0 0 34px; width: 34px; height: 34px; display: block; overflow: hidden; border-radius: 9px; background: #10131b; }
.server-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.server-info { min-width: 0; flex: 1; }
.server-info strong, .server-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-info strong { font-size: 12px; font-weight: 600; }
.server-info small { margin-top: 4px; color: #909aae; font-size: 10px; }
.switcher-chevron { width: 16px; height: 16px; fill: none; stroke: #939db0; stroke-width: 1.8; }
.nav-label { margin: 30px 11px 10px; color: #758096; font-size: 9px; font-weight: 700; letter-spacing: 1.25px; }
.primary-nav { display: grid; gap: 4px; }
.nav-link { min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 11px; border-radius: 7px; color: #aab2c2; font-size: 12px; font-weight: 500; transition: background .16s, color .16s; }
.nav-link:hover { color: #f7f7fb; background: var(--sidebar-raised); }
.nav-link.active { color: #fff; background: var(--theme-accent-soft); box-shadow: inset 2px 0 var(--theme-accent-light); }
.nav-link svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-link span:nth-child(2) { flex: 1; }
.nav-count { padding: 3px 6px; border-radius: 5px; background: #2a3446; color: #9da7b7; font-size: 9px; }
.nav-link.active .nav-count { background: #48416f; color: #d9d2ff; }
.data-badge > span, .voice-status-badge > span { width: 7px; height: 7px; border-radius: 50%; background: #44c593; box-shadow: 0 0 0 3px rgb(68 197 147 / 12%); }
.tools-label { margin-top: 28px; }
.disabled-link { color: #747f92; cursor: default; }
.disabled-link:hover { color: #747f92; background: transparent; }
.soon-tag { padding: 3px 6px; border-radius: 4px; color: #8d98aa; background: #263043; font-size: 9px; }
.sidebar-bottom { margin-top: auto; }
.discord-connect-card { padding: 15px 13px 13px; border: 1px solid var(--theme-accent-soft); border-radius: 9px; background: linear-gradient(135deg, var(--theme-accent-soft), var(--sidebar-raised)); }
.connect-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--theme-accent-light); background: color-mix(in srgb, var(--theme-accent) 20%, var(--sidebar-raised)); }
.connect-icon svg { width: 18px; height: 18px; }
.discord-connect-card > strong { display: block; margin-top: 12px; color: #f2f1ff; font-size: 11px; }
.discord-connect-card p { margin: 5px 0 12px; color: #a3a9ba; font-size: 10px; line-height: 1.55; }
.connect-button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; color: white; background: var(--theme-accent-strong); font-size: 10px; font-weight: 600; }
.connect-button:hover { background: var(--theme-accent); }
.connect-button span { font-size: 15px; line-height: 10px; }
.profile-row { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; padding: 12px 4px 0; border-top: 1px solid #2b3444; }
.profile-avatar { width: 30px; height: 30px; display: grid; flex: 0 0 30px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #df9c7e, #a96472); font-size: 9px; font-weight: 700; object-fit: cover; }
.profile-avatar-fallback { background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-strong)); }
.profile-info { flex: 1; min-width: 0; }
.profile-info strong, .profile-info small { display: block; }
.profile-info strong { color: #e5e8ef; font-size: 10px; font-weight: 600; }
.profile-info small { margin-top: 3px; color: #818ca0; font-size: 9px; }
.profile-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu { width: 27px; height: 27px; border: 0; border-radius: 5px; color: #aab2c2; background: transparent; font-size: 17px; }
.profile-menu:hover { color: white; background: var(--sidebar-raised); }

.main-content { min-height: 100vh; margin-left: 252px; }
.topbar { height: 65px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--surface); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8992a2; font-size: 11px; }
.breadcrumb strong { color: #323c4e; font-weight: 600; }
.breadcrumb-sep { color: #c3c9d2; }
.topbar-actions { display: flex; align-items: center; gap: 19px; }
.data-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #d5f0e5; border-radius: 5px; color: #21855f; background: #f0fbf6; font-size: 9px; font-weight: 600; }
.data-badge > span { width: 6px; height: 6px; box-shadow: none; }
.icon-button { width: 30px; height: 30px; position: relative; display: grid; place-items: center; border: 0; border-radius: 6px; color: #718095; background: transparent; }
.icon-button:hover { background: #f2f3f7; }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.notification-button i { width: 5px; height: 5px; position: absolute; top: 5px; right: 4px; border: 1px solid white; border-radius: 50%; background: #e77584; }
.topbar-divider { width: 1px; height: 22px; background: #eceef2; }
.topbar-date { display: flex; align-items: center; gap: 6px; color: #929aaa; font-size: 10px; }
.date-icon { font-size: 17px; line-height: 1; }
.mobile-menu { display: none; }
.page-content { max-width: 1500px; margin: 0 auto; padding: 22px 36px 0; }
.data-banner { min-height: 39px; display: flex; align-items: center; gap: 9px; margin: 0 0 24px; padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--theme-accent) 24%, var(--line)); border-radius: 7px; color: var(--theme-accent-strong); background: var(--theme-accent-tint); }
.banner-icon { width: 15px; height: 15px; display: grid; place-items: center; flex: 0 0 15px; border: 1px solid var(--theme-accent); border-radius: 50%; font-size: 9px; font-weight: 700; }
.data-banner p { flex: 1; margin: 0; font-size: 10px; }
.data-banner strong { color: var(--theme-accent-strong); }
.data-banner button { padding: 0 3px; border: 0; color: #8c81bb; background: none; font-size: 18px; line-height: 1; }
.page-view { display: none; animation: appear .18s ease-out; }
.page-view.active { display: block; }
@keyframes appear { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.eyebrow { margin: 0 0 8px; color: var(--theme-accent); font-size: 8px; font-weight: 700; letter-spacing: 1.35px; }
h1, h2, p { margin-top: 0; }
h1 { margin: 0; color: var(--ink); font: 700 25px/1.2 "Manrope", sans-serif; letter-spacing: -.8px; }
.page-subtitle { margin: 7px 0 0; color: #7c8799; font-size: 11px; }
.period-select-wrap { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: #7c8799; background: var(--surface); }
.period-select-wrap > svg:first-of-type { width: 14px; height: 14px; fill: none; stroke: #8390a2; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.period-select-wrap select { width: 95px; appearance: none; border: 0; outline: 0; color: #515c6d; background: transparent; font-size: 10px; cursor: pointer; }
.period-select-wrap .select-chevron, .filter-chevron { width: 12px; height: 12px; fill: none; stroke: #8993a3; stroke-width: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgb(22 35 55 / 2%); }
.metric-card { min-height: 125px; padding: 15px 15px 11px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { color: #788397; font-size: 10px; font-weight: 500; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; }
.metric-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.metric-icon.purple { color: var(--theme-accent); background: var(--theme-accent-tint); }
.metric-icon.blue { color: #4488d8; background: #edf5ff; }
.metric-icon.green { color: #25a67c; background: #eaf8f2; }
.metric-icon.orange { color: #d38c37; background: #fff5e9; }
.metric-value { display: flex; align-items: center; gap: 8px; margin-top: 11px; color: #1d2739; font: 700 21px/1.2 "Manrope", sans-serif; letter-spacing: -.55px; white-space: nowrap; }
.metric-change { display: inline-flex; align-items: center; gap: 3px; padding: 3px 5px; border-radius: 4px; font: 600 9px/1 "DM Sans", sans-serif; letter-spacing: 0; }
.metric-change.positive { color: #258f69; background: #eff9f4; }
.metric-change span { font-size: 11px; }
.metric-foot { min-height: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; color: #9ba3b0; font-size: 9px; }
.mini-sparkline { width: 71px; height: 23px; display: block; flex: 0 0 71px; }
.mini-sparkline svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.spark-purple { color: #8273e8; }.spark-blue { color: #5799e4; }.spark-green { color: #39b087; }.spark-orange { color: #e2a04b; }
.panel { padding: 17px 18px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .92fr); gap: 14px; margin-bottom: 14px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 0; color: #293448; font: 700 12px/1.45 "Manrope", sans-serif; letter-spacing: -.15px; }
.panel-heading p { margin: 4px 0 0; color: #9099a8; font-size: 9px; }
.chart-legend { display: flex; align-items: center; gap: 12px; padding-top: 2px; color: #8993a2; font-size: 8px; white-space: nowrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 7px; height: 7px; display: inline-block; border-radius: 2px; }
.legend-members { background: #806bea; }.legend-messages { background: #9fd9ca; }.legend-leaves { background: #efadb5; }
.activity-panel { min-height: 302px; }
.chart-wrap { height: 220px; margin: 14px 0 0; overflow: hidden; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-gridline { stroke: var(--line); stroke-width: 1; }
.chart-y-label, .chart-x-label { fill: #a3abb7; font: 9px "DM Sans", sans-serif; }
.chart-line-members { fill: none; stroke: #7864e8; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-messages { fill: none; stroke: #83cbb8; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area-members { fill: url(#membersGradient); }.chart-area-messages { fill: url(#messagesGradient); }
.chart-hover-line { stroke: #d8d2fb; stroke-dasharray: 3 4; }
.voice-panel { min-height: 302px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; padding-top: 2px; color: var(--theme-accent-strong); font-size: 9px; font-weight: 600; white-space: nowrap; }
.text-link:hover { color: var(--theme-accent); }
.text-link span { font-size: 13px; }
.voice-summary { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: 6px; margin: 18px 0 0; }
.voice-summary > strong { color: #293448; font: 700 22px "Manrope", sans-serif; letter-spacing: -.6px; }
.voice-summary > strong span { color: #8c95a4; font: 500 10px "DM Sans", sans-serif; letter-spacing: 0; }
.summary-change { color: #29956f; font-size: 8px; font-weight: 600; }
.voice-summary small { grid-column: 1 / -1; color: #99a2af; font-size: 9px; }
.voice-chart { height: 98px; display: flex; align-items: flex-end; gap: 9px; margin: 13px 1px 0; padding: 0 3px; border-bottom: 1px solid #edf0f4; }
.voice-bar-wrap { height: 100%; display: flex; flex: 1; align-items: flex-end; justify-content: center; }
.voice-bar { width: min(20px, 70%); min-height: 6px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #ab9cf6, #7864e8); opacity: .84; }
.voice-bar.peak { background: linear-gradient(180deg, #a595f8, #6954da); opacity: 1; }
.voice-chart-labels { display: flex; justify-content: space-between; margin: 6px 1px 0; color: #a2aab6; font-size: 8px; }
.voice-current { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding-top: 11px; border-top: 1px solid #f0f2f5; color: #788496; font-size: 9px; }
.voice-current strong { margin-left: auto; color: #4b596a; font-size: 9px; font-weight: 600; }
.live-indicator, .inline-live { width: 6px; height: 6px; border-radius: 50%; background: #41ba8d; box-shadow: 0 0 0 3px #eaf8f2; }
.lower-grid .panel { min-height: 246px; }
.compact-member-list, .recent-activity-list { margin-top: 12px; }
.compact-member-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
.compact-member-row:last-child { border-bottom: 0; }
.member-avatar { width: 27px; height: 27px; position: relative; flex: 0 0 27px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--theme-accent-light), var(--theme-accent)); font-size: 8px; font-weight: 700; }
.member-avatar-image { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.member-avatar.has-image > span { display: none; }
.member-info { flex: 1; min-width: 0; }
.member-info strong, .member-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-info strong { color: #455064; font-size: 9px; font-weight: 600; }
.member-info small { margin-top: 3px; color: #a1a9b5; font-size: 8px; }
.member-activity-value { color: #536073; font-size: 9px; font-weight: 600; white-space: nowrap; }
.activity-row { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-bottom: 1px solid #f0f2f5; }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 25px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.activity-text { flex: 1; min-width: 0; color: #697589; font-size: 9px; line-height: 1.45; }
.activity-text strong { color: #394559; font-weight: 600; }
.activity-text small { display: block; margin-top: 3px; color: #a2aab5; font-size: 8px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px 17px; color: #a0a8b4; font-size: 8px; }
.unavailable-panel { min-height: 130px; display: grid; place-items: center; padding: 24px; color: var(--muted); font-size: 11px; text-align: center; }
.voice-panel .unavailable-panel { min-height: 80px; }

.three-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 15px; }
.three-metrics .metric-card { min-height: 118px; }
.metric-unit { color: #8a94a4; font: 500 10px "DM Sans", sans-serif; letter-spacing: 0; }
.outline-button { height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #e3e7ed; border-radius: 6px; color: #536074; background: #fff; font-size: 10px; font-weight: 600; }
.outline-button:hover { border-color: #cfc8f5; color: #6452c6; }
.outline-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.member-chart-panel { margin-bottom: 14px; }
.member-chart-panel .chart-wrap { height: 192px; }
.member-lookup-panel { position: relative; margin-bottom: 14px; }
.member-search-control { height: 40px; display: flex; align-items: center; gap: 9px; margin-top: 15px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.member-search-control svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.member-search-control input { width: 100%; min-width: 0; outline: 0; border: 0; color: var(--ink); background: transparent; font-size: 11px; }
.member-search-control input::placeholder { color: #a7afbc; }
.member-search-status { margin: 8px 0 0; color: var(--muted); font-size: 9px; }
.member-search-results { position: absolute; z-index: 3; top: 126px; right: 18px; left: 18px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 30px rgb(15 23 42 / 12%); }
.member-search-result { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.member-search-result:last-child { border-bottom: 0; }
.member-search-result:hover, .member-search-result:focus-visible { outline: 0; background: var(--theme-accent-tint); }
.member-search-result img, .member-search-result-avatar { width: 30px; height: 30px; display: grid; flex: 0 0 30px; place-items: center; border-radius: 50%; object-fit: cover; color: white; background: var(--theme-accent); font-size: 10px; font-weight: 700; }
.member-search-result-copy { min-width: 0; }
.member-search-result-copy strong, .member-search-result-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-search-result-copy strong { font-size: 10px; }
.member-search-result-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.member-profile { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.member-profile-empty { padding: 24px 12px; color: var(--muted); background: var(--canvas); text-align: center; font-size: 10px; }
.member-profile-header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-profile-avatar { width: 54px; height: 54px; display: grid; flex: 0 0 54px; place-items: center; border-radius: 50%; object-fit: cover; color: white; background: var(--theme-accent); font-size: 18px; font-weight: 700; }
.member-profile-heading { min-width: 0; flex: 1; }
.member-profile-heading h3 { margin: 0; overflow-wrap: anywhere; color: var(--ink); font: 700 15px/1.35 "Manrope", sans-serif; }
.member-profile-heading p { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; }
.member-profile-id { padding: 6px 8px; border-radius: 5px; color: var(--muted-dark); background: var(--canvas); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.member-profile-banner { width: 100%; max-height: 180px; display: block; margin-top: 12px; border-radius: 7px; object-fit: cover; }
.member-profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.member-profile-field { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.member-profile-field small, .member-profile-field strong { display: block; }
.member-profile-field small { margin-bottom: 5px; color: var(--muted); font-size: 8px; }
.member-profile-field strong { overflow-wrap: anywhere; color: var(--ink); font-size: 10px; font-weight: 600; }
.member-profile-section { margin-top: 16px; }
.member-profile-section h4 { margin: 0 0 8px; color: var(--ink); font: 700 10px "Manrope", sans-serif; }
.member-profile-roles { display: flex; flex-wrap: wrap; gap: 5px; }
.member-role-chip { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-dark); background: var(--canvas); font-size: 8px; }
.member-profile-events { display: grid; gap: 6px; }
.member-profile-event { padding: 8px 10px; border-left: 2px solid var(--theme-accent); border-radius: 0 5px 5px 0; background: var(--canvas); }
.member-profile-event strong { display: block; color: var(--ink); font-size: 9px; }
.member-profile-event p { margin: 4px 0; color: var(--muted-dark); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.member-profile-event small { color: var(--muted); font-size: 8px; }
.member-profile-note { margin: 12px 0 0; color: var(--muted); font-size: 8px; line-height: 1.6; }
.member-profile-warning { margin-top: 12px; padding: 9px 11px; border: 1px solid #eee1ba; border-radius: 6px; color: #816927; background: #fffaf0; font-size: 9px; line-height: 1.5; }
.member-changes-panel { margin-bottom: 15px; }
.member-changes-count { min-width: 28px; padding: 5px 8px; border-radius: 999px; color: var(--theme-accent-strong); background: var(--theme-accent-tint); font-size: 9px; font-weight: 700; text-align: center; }
.member-journey-list { max-height: 480px; display: grid; gap: 7px; overflow-y: auto; }
.member-journey-item { width: 100%; display: flex; align-items: flex-start; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); text-align: left; transition: border-color .16s, background .16s, transform .16s; }
.member-journey-item:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--theme-accent) 42%, var(--line)); background: color-mix(in srgb, var(--theme-accent-tint) 45%, var(--surface)); }
.journey-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; object-fit: cover; }
.journey-avatar-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--theme-accent-light), var(--theme-accent)); font-size: 13px; font-weight: 700; }
.member-journey-copy { min-width: 0; flex: 1; display: grid; gap: 5px; }
.member-journey-topline { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.member-journey-topline > strong { max-width: 100%; overflow-wrap: anywhere; color: var(--ink); font-size: 10px; font-weight: 700; }
.member-journey-badge { padding: 3px 7px; border-radius: 999px; font-size: 8px; font-weight: 700; }
.member-journey-badge.joined { color: #218460; background: #eaf8f1; }
.member-journey-badge.left { color: #bf596a; background: #fff0f1; }
.member-journey-details { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted-dark); font-size: 8px; line-height: 1.5; }
.member-journey-details span { overflow-wrap: anywhere; }
.member-journey-copy time { color: var(--muted); font-size: 8px; }
.member-journey-empty { padding: 24px 12px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); background: var(--canvas); text-align: center; font-size: 9px; line-height: 1.6; }
.member-journey-note { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.6; }
.levels-status-banner { display: flex; align-items: center; gap: 9px; margin: -4px 0 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-dark); background: var(--surface); font-size: 9px; line-height: 1.5; }
.levels-status-banner.connected { border-color: #cdebdc; color: #267753; background: #f0faf4; }
.levels-status-banner.warning { border-color: #eeddb7; color: #83682e; background: #fffaf0; }
.levels-status-banner.error { border-color: #f1d0cc; color: #a94540; background: #fff5f3; }
.levels-settings-panel, .levels-admin-panel { margin-bottom: 15px; }
.levels-status-pill { padding: 5px 9px; border-radius: 999px; color: #218460; background: #eaf8f1; font-size: 8px; font-weight: 700; }
.levels-status-pill.disabled { color: #bf596a; background: #fff0f1; }
.levels-config-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.levels-config-grid > label, .levels-member-form > label { min-width: 0; display: grid; align-content: start; gap: 6px; color: var(--muted-dark); font-size: 9px; font-weight: 600; }
.levels-config-grid input:not([type="checkbox"]), .levels-config-grid select, .levels-member-form input { width: 100%; min-width: 0; height: 36px; padding: 0 10px; outline: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 10px; }
.levels-config-grid input:focus, .levels-config-grid select:focus, .levels-member-form input:focus { border-color: var(--theme-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 15%, transparent); }
.levels-levelup-message-setting { grid-column: span 2; }
.levels-config-grid label > small { color: var(--muted); font-size: 8px; font-weight: 400; }
.levels-enabled-setting { display: flex !important; align-items: center; gap: 9px !important; }
.levels-enabled-setting input { width: 16px; height: 16px; accent-color: var(--theme-accent); }
.levels-enabled-setting strong, .levels-enabled-setting small { display: block; }
.levels-enabled-setting strong { color: var(--ink); font-size: 10px; }
.levels-enabled-setting small { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 400; }
.levels-config-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.primary-button { min-height: 35px; padding: 0 13px; border: 1px solid var(--theme-accent-strong); border-radius: 6px; color: #fff; background: var(--theme-accent-strong); font-size: 9px; font-weight: 700; }
.primary-button:hover { filter: brightness(1.08); }
.levels-config-feedback { min-height: 15px; margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.levels-policy-note { margin: 13px 0 0; color: var(--muted); font-size: 8px; line-height: 1.6; }
.levels-policy-note code { padding: 2px 4px; border-radius: 3px; color: var(--theme-accent-strong); background: var(--theme-accent-tint); }
.levels-member-form { display: grid; grid-template-columns: 1.35fr 1fr auto 1fr auto; align-items: end; gap: 9px; }
.levels-member-form .primary-button, .levels-member-form .outline-button { height: 36px; white-space: nowrap; }
.levels-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 15px; }
.levels-list-panel { min-width: 0; overflow: hidden; }
.levels-list-panel .panel-heading > strong { color: var(--theme-accent-strong); font: 700 16px "Manrope", sans-serif; }
.levels-table { min-width: 100%; }
.levels-table th, .levels-table td { padding: 9px 10px; }
.levels-table .table-member strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-progress { min-width: 100px; display: grid; gap: 4px; }
.level-progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--canvas); }
.level-progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--theme-accent-light), var(--theme-accent)); }
.level-progress small { color: var(--muted); font-size: 7px; }
.sample-caption { padding: 5px 7px; border: 1px solid #edf0f4; border-radius: 4px; color: #969eac; font-size: 8px; white-space: nowrap; }
.table-panel { padding-bottom: 4px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 13px 12px 9px; border-bottom: 1px solid #edf0f4; color: #99a2b0; font-size: 8px; font-weight: 700; letter-spacing: .55px; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid #f0f2f5; color: #677286; font-size: 9px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.table-member { display: flex; align-items: center; gap: 8px; }
.table-member .member-avatar { width: 28px; height: 28px; flex-basis: 28px; }
.table-member strong { color: #445064; font-size: 9px; font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 4px; color: #288b68; background: #eff9f4; font-size: 8px; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: #3ab184; }
.status-pill.new { color: #7a68d7; background: #f2efff; }
.status-pill.new i { background: #8979e9; }
.voice-status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #dcefe7; border-radius: 6px; color: #4e8d75; background: #f4fbf7; font-size: 9px; }
.voice-status-badge > span { width: 6px; height: 6px; }
.voice-detail-chart { margin-bottom: 15px; }
.voice-detail-bars { height: 174px; display: flex; align-items: stretch; gap: 13px; margin: 21px 8px 0; padding-bottom: 23px; border-bottom: 1px solid #edf0f4; }
.detail-bar-group { min-width: 0; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.detail-bar-value { color: #8a92a1; font-size: 8px; }
.detail-bar { width: min(36px, 68%); min-height: 7px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #b2a7f8, #7660e3); }
.detail-bar-group span:last-child { position: absolute; margin-top: 178px; color: #959eac; font-size: 8px; }
.voice-chart-note { margin: 0 8px 12px; color: var(--muted); font-size: 8px; text-align: center; }
.voice-ranking, .channel-panel { min-height: 300px; }
.voice-member-list { margin-top: 13px; }
.voice-rank-row { display: grid; grid-template-columns: 18px 27px minmax(0, 1fr) auto; grid-template-rows: auto 5px; align-items: center; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f5; }
.voice-rank-row:last-child { border-bottom: 0; }
.rank-number { width: 18px; color: #9da5b3; font: 700 10px "Manrope", sans-serif; text-align: center; }
.voice-rank-row > .rank-number, .voice-rank-row > .member-avatar { grid-row: 1 / span 2; }
.voice-rank-row > .member-info { min-width: 0; grid-column: 3; grid-row: 1; }
.voice-rank-row .member-info strong { overflow: visible; overflow-wrap: anywhere; white-space: normal; line-height: 1.35; }
.voice-rank-meta { grid-column: 4; grid-row: 1 / span 2; color: #9ca5b2; font-size: 8px; text-align: right; white-space: nowrap; }
.rank-bar-track { height: 5px; grid-column: 3; grid-row: 2; overflow: hidden; border-radius: 8px; background: #f0eff7; }
.rank-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b78ed, #b7adfa); }
.channel-list { margin-top: 14px; }
.channel-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f0f2f5; }
.channel-row:last-child { border-bottom: 0; }
.channel-hash { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: #8d7ce2; background: #f1effc; font-size: 15px; font-weight: 600; }
.channel-info { flex: 1; }
.channel-info strong, .channel-info small { display: block; }
.channel-info strong { color: #536074; font-size: 9px; font-weight: 600; }
.channel-info small { margin-top: 3px; color: #a0a8b4; font-size: 8px; }
.channel-count { color: #667286; font-size: 9px; font-weight: 600; }
.channel-count small { color: #a3aab5; font-size: 8px; font-weight: 400; }

.log-overview-strip { display: grid; grid-template-columns: repeat(3, 1fr) minmax(200px, 1.15fr); gap: 10px; margin-bottom: 15px; }
.log-overview-strip > div { min-height: 66px; display: flex; flex-direction: column; justify-content: center; padding: 10px 14px; border: 1px solid #e9edf2; border-radius: 7px; background: #fff; }
.log-overview-strip > div > strong { color: #273247; font: 700 17px "Manrope", sans-serif; }
.log-overview-strip > div > span { margin-top: 3px; color: #9099a8; font-size: 9px; }
.log-overview-strip .log-retention { flex-direction: row; align-items: center; justify-content: flex-start; gap: 9px; border-color: #eee8ff; background: #fbfaff; }
.retention-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: #8674e2; background: #f0edff; font-size: 18px; }
.log-overview-strip .log-retention > span:last-child { margin: 0; color: #665a9a; font-size: 9px; line-height: 1.45; }
.log-retention small { color: #a29bb8; font-size: 8px; }
.log-panel { padding: 0; }
.log-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 17px; border-bottom: 1px solid #edf0f4; }
.log-toolbar-copy h2 { margin: 0; color: #293448; font: 700 12px/1.45 "Manrope", sans-serif; }
.log-toolbar-copy p { margin: 4px 0 0; color: #9aa2af; font-size: 8px; }
.log-controls { display: flex; align-items: center; gap: 8px; }
.log-member-profile-link { padding: 4px 2px; border: 0; background: transparent; cursor: pointer; white-space: nowrap; }
.search-control, .filter-control { height: 32px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid #e6eaf0; border-radius: 5px; background: #fff; }
.search-control { width: 186px; }
.search-control svg, .filter-control > svg:first-child { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: #9aa3b0; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.search-control input { width: 100%; min-width: 0; outline: 0; border: 0; color: #465166; background: transparent; font-size: 9px; }
.search-control input::placeholder { color: #adb4bf; }
.filter-control { gap: 6px; }
.filter-control select { width: 94px; appearance: none; outline: 0; border: 0; color: #687487; background: transparent; font-size: 9px; cursor: pointer; }
.filter-control select option { color: #293448; background-color: #fff; }
.user-filter-control select { width: 128px; }
.filter-chevron { width: 11px; height: 11px; }
.log-table-scroll { min-height: 370px; }
.log-table th { padding-top: 11px; padding-bottom: 10px; background: #fcfcfd; }
.log-table th:first-child, .log-table td:first-child { padding-left: 17px; }
.log-table th:last-child, .log-table td:last-child { padding-right: 17px; text-align: right; }
.log-table td { padding-top: 10px; padding-bottom: 10px; }
.log-event { display: flex; align-items: center; gap: 8px; }
.event-icon { width: 25px; height: 25px; display: grid; flex: 0 0 25px; place-items: center; border-radius: 7px; font-size: 11px; font-weight: 600; }
.event-label { display: block; color: #485468; font-size: 9px; font-weight: 600; }
.event-category { display: block; margin-top: 3px; color: #a1a9b6; font-size: 8px; }
.actor-cell { display: flex; align-items: center; gap: 6px; color: #687487; }
.actor-avatar { width: 21px; height: 21px; display: grid; flex: 0 0 21px; place-items: center; border-radius: 50%; color: #fff; font-size: 7px; font-weight: 700; }
.actor-avatar-image { object-fit: cover; }
.actor-avatar-fallback { background: linear-gradient(135deg, var(--theme-accent-light), var(--theme-accent)); }
.actor-cell.system-actor { color: #8d75d4; }
.details-cell { max-width: 270px; overflow: hidden; color: #8992a0; text-overflow: ellipsis; }
.log-time { color: #8c96a5; font-size: 8px; }
.event-icon.moderation, .activity-icon.moderation { color: #ce6372; background: #fff0f1; }
.event-icon.member, .activity-icon.member { color: #3981c9; background: #edf5ff; }
.event-icon.message, .activity-icon.message { color: #259773; background: #eaf8f2; }
.event-icon.voice, .activity-icon.voice { color: #826bd8; background: #f1efff; }
.event-icon.role, .activity-icon.role { color: #bf873c; background: #fff6e9; }
.event-icon.channel, .activity-icon.channel { color: #458b99; background: #eaf7f8; }
.event-icon.server, .activity-icon.server { color: #738195; background: #f0f3f7; }
.event-icon.integration, .activity-icon.integration { color: #5e80bc; background: #eef4ff; }
.event-icon.automation, .activity-icon.automation { color: #8561bc; background: #f5effc; }
.log-table-footer { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 17px; border-top: 1px solid #edf0f4; color: #9ba4b1; font-size: 8px; }
.live-note { display: inline-flex; align-items: center; gap: 6px; }
.live-note i { width: 6px; height: 6px; border-radius: 50%; background: #44c593; }
.message-action-cell { text-align: center; }
.log-message-cell { max-width: 270px; display: flex; align-items: center; gap: 7px; }
.log-message-preview { min-width: 0; overflow: hidden; color: var(--muted-dark); text-overflow: ellipsis; white-space: nowrap; }
.log-message-unavailable { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.message-preview-button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--theme-accent-strong); background: var(--surface); font-size: 9px; font-weight: 600; }
.message-preview-button:hover { border-color: var(--theme-accent); background: var(--theme-accent-tint); }
.message-preview-dialog { width: min(520px, calc(100vw - 32px)); max-width: none; max-height: min(80vh, 640px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 70px rgb(15 23 42 / 25%); }
.message-preview-dialog::backdrop { background: rgb(13 19 31 / 55%); backdrop-filter: blur(2px); }
.message-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.message-preview-heading .eyebrow { margin-bottom: 6px; }
.message-preview-heading h2 { margin: 0; font: 700 16px/1.35 "Manrope", sans-serif; }
.message-preview-heading p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.message-preview-close { width: 30px; height: 30px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }
.message-preview-close:hover { background: var(--canvas); }
.discord-message { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px; }
.discord-message-avatar, .discord-message-avatar-fallback { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; }
.discord-message-avatar { object-fit: cover; }
.discord-message-avatar-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--theme-accent-light), var(--theme-accent)); font-size: 13px; font-weight: 700; }
.discord-message-body { min-width: 0; flex: 1; }
.discord-message-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 1px 0 5px; }
.discord-message-meta strong { color: var(--ink); font-size: 12px; font-weight: 700; }
.discord-message-meta span { color: var(--muted); font-size: 9px; }
.discord-message-body > p { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-edit-comparison { display: grid; gap: 8px; padding: 0 22px 18px 74px; }
.message-edit-comparison > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); }
.message-edit-comparison small { color: var(--muted); font-size: 9px; font-weight: 700; }
.message-edit-comparison p { margin: 5px 0 0; color: var(--ink); font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-preview-note { margin: 0 22px 18px 74px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.empty-state { padding: 45px 15px; color: #9ba3b0; text-align: center; }
.empty-state > span { display: block; margin-bottom: 8px; color: #a398e6; font-size: 22px; }
.empty-state strong { color: #5e697c; font-size: 11px; }
.empty-state p { margin: 5px 0 0; font-size: 9px; }
.category-note { margin: 13px 0 0; padding: 10px 12px; border-left: 2px solid #d5cefa; color: #8791a0; background: #f1f0f9; font-size: 9px; line-height: 1.5; }
.category-note strong { color: #656086; }

.toast { max-width: min(340px, calc(100vw - 32px)); position: fixed; right: 22px; bottom: 20px; z-index: 60; padding: 11px 15px; border: 1px solid #353d50; border-radius: 7px; color: #f7f7fb; background: #20283a; box-shadow: 0 8px 24px rgb(15 23 42 / 20%); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.mobile-overlay { display: none; }
html { scrollbar-width: thin; scrollbar-color: #aab2c0 #f0f2f6; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #f0f2f6; }
::-webkit-scrollbar-thumb { border: 2px solid #f0f2f6; border-radius: 8px; background: #aab2c0; }
::-webkit-scrollbar-thumb:hover { background: #7e899b; }

@media (min-width: 1500px) {
  .page-content { padding-right: 46px; padding-left: 46px; }
  .metric-card { padding-right: 19px; padding-left: 19px; }
}
@media (max-width: 1150px) {
  .sidebar { width: 224px; }
  .main-content { margin-left: 224px; }
  .topbar { padding-right: 25px; padding-left: 25px; }
  .page-content { padding-right: 25px; padding-left: 25px; }
  .metrics-grid { gap: 9px; }
  .metric-card { padding-right: 11px; padding-left: 11px; }
  .metric-value { font-size: 19px; }
  .overview-grid { grid-template-columns: minmax(0, 1.2fr) minmax(270px, .9fr); gap: 10px; }
  .chart-legend { gap: 7px; }
}
@media (max-width: 900px) {
  .sidebar { width: 245px; visibility: hidden; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { visibility: visible; transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu { width: 31px; height: 31px; display: grid; place-items: center; margin-right: 10px; border: 0; border-radius: 6px; color: #647086; background: transparent; }
  .mobile-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .breadcrumb { margin-right: auto; }
  .topbar { justify-content: flex-start; }
  .mobile-overlay.visible { display: block; position: fixed; inset: 0; z-index: 15; background: rgb(17 24 39 / 38%); }
  .overview-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, .83fr); }
  .metric-foot { font-size: 8px; }
  .levels-member-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .levels-member-form > label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .topbar { height: 57px; padding: 0 15px; }
  .breadcrumb { gap: 6px; font-size: 10px; }
  .breadcrumb > span:first-child { max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 10px; }
  .data-badge { padding: 5px 6px; font-size: 8px; }
  .topbar-date, .topbar-divider { display: none; }
  .page-content { padding: 14px 14px 0; }
  .data-banner { align-items: flex-start; margin-bottom: 19px; padding: 9px; }
  .data-banner p { font-size: 9px; line-height: 1.5; }
  .page-heading { align-items: flex-start; margin-bottom: 16px; }
  h1 { font-size: 22px; }
  .page-subtitle { max-width: 250px; font-size: 10px; line-height: 1.5; }
  .eyebrow { margin-bottom: 6px; font-size: 7px; }
  .period-select-wrap { height: 31px; gap: 5px; padding: 0 7px; }
  .period-select-wrap select { width: 82px; font-size: 9px; }
  .period-select-wrap > svg:first-of-type { width: 12px; height: 12px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .metric-card, .three-metrics .metric-card { min-height: 111px; padding: 11px; }
  .metric-label { font-size: 9px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-icon svg { width: 13px; height: 13px; }
  .metric-value { gap: 5px; margin-top: 10px; font-size: 18px; }
  .metric-change { padding: 3px 4px; font-size: 8px; }
  .metric-foot { min-height: 21px; font-size: 8px; }
  .levels-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .levels-enabled-setting, .levels-config-actions { grid-column: 1 / -1; }
  .levels-member-form { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
  .levels-member-form > label:first-child { grid-column: 1 / -1; }
  .levels-member-form > label:not(:first-child) { min-width: 0; }
  .levels-member-form .primary-button, .levels-member-form .outline-button { padding: 0 9px; }
  .levels-two-column { grid-template-columns: 1fr; gap: 10px; }
  .mini-sparkline { width: 46px; flex-basis: 46px; }
  .overview-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
  .panel { padding: 14px; }
  .activity-panel, .voice-panel { min-height: initial; }
  .chart-wrap { height: 195px; margin-top: 10px; }
  .chart-legend { font-size: 7px; }
  .chart-legend span { gap: 4px; }
  .voice-chart { height: 92px; }
  .lower-grid .panel { min-height: 0; }
  .page-footer { padding-bottom: 13px; font-size: 7px; }
  .three-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-metrics .metric-card:last-child { grid-column: 1 / -1; }
  .outline-button { height: 31px; padding: 0 8px; font-size: 8px; white-space: nowrap; }
  .outline-button svg { width: 12px; height: 12px; }
  .member-chart-panel .chart-wrap { height: 170px; }
  .table-panel .panel-heading { align-items: center; }
  th { padding: 10px 9px 8px; font-size: 7px; }
  td { padding: 9px; }
  .voice-detail-bars { height: 155px; gap: 6px; margin-right: 1px; margin-left: 1px; }
  .detail-bar-group span:last-child { margin-top: 157px; }
  .voice-status-badge { padding: 6px 7px; font-size: 8px; }
  .voice-rank-meta { width: 71px; font-size: 7px; }
  .log-overview-strip { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .log-overview-strip > div { min-height: 57px; padding: 8px; }
  .log-overview-strip > div > strong { font-size: 15px; }
  .log-overview-strip > div > span { font-size: 8px; }
  .log-overview-strip .log-retention { grid-column: 1 / -1; min-height: 49px; }
  .log-toolbar { align-items: flex-start; flex-direction: column; padding: 13px; }
  .log-controls { width: 100%; }
  .search-control { flex: 1; width: auto; }
  .filter-control select { width: 85px; }
  .user-filter-control select { width: 105px; }
  .log-table-scroll { min-height: 280px; }
  .log-table th:nth-child(3), .log-table td:nth-child(3) { display: none; }
  .log-table th, .log-table td { padding-right: 8px; padding-left: 8px; }
  .log-table th:first-child, .log-table td:first-child { padding-left: 12px; }
  .log-table th:last-child, .log-table td:last-child { padding-right: 12px; }
  .log-table-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 9px 12px; }
  .category-note { font-size: 8px; }
  .member-search-results { top: 139px; right: 14px; left: 14px; }
  .member-profile-header { align-items: flex-start; flex-wrap: wrap; }
  .member-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .member-profile-id { margin-left: 66px; }
  .member-journey-item { gap: 8px; padding: 9px; }
  .journey-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .member-journey-details { display: grid; gap: 3px; }
  .log-message-cell { max-width: 130px; }
  .log-message-preview { max-width: 78px; }
}
@media (max-width: 370px) {
  .topbar { padding-right: 10px; padding-left: 10px; }
  .breadcrumb > span:first-child { max-width: 88px; }
  .topbar-actions { gap: 5px; }
  .page-content { padding-right: 10px; padding-left: 10px; }
  .metric-card { padding: 9px; }
  .metric-value { font-size: 16px; }
  .metric-change { font-size: 7px; }
}

body[data-theme="ocean"] {
  --canvas: #eaf3f8;
  --surface: #fafdff;
  --line: #d7e5ee;
  --ink: #1b3140;
  --sidebar: #102638;
  --sidebar-raised: #1a3b52;
  --theme-accent: #2587b7;
  --theme-accent-strong: #17668f;
  --theme-accent-soft: #21475e;
  --theme-accent-light: #8bc4e7;
  --theme-accent-tint: #e4f2f9;
}
body[data-theme="forest"] {
  --canvas: #edf4ee;
  --surface: #fcfefb;
  --line: #dce8dd;
  --ink: #22352a;
  --sidebar: #1b3026;
  --sidebar-raised: #284536;
  --theme-accent: #31875d;
  --theme-accent-strong: #236744;
  --theme-accent-soft: #254637;
  --theme-accent-light: #88c69f;
  --theme-accent-tint: #e7f3e9;
}
body[data-theme="sunset"] {
  --canvas: #fbf0e9;
  --surface: #fffdfa;
  --line: #efded3;
  --ink: #3b2b25;
  --sidebar: #34251f;
  --sidebar-raised: #4a332a;
  --theme-accent: #d56845;
  --theme-accent-strong: #ae4c31;
  --theme-accent-soft: #52372e;
  --theme-accent-light: #f1ad91;
  --theme-accent-tint: #fce8dd;
}
body[data-theme="violet"] {
  --canvas: #f5f2fb;
  --surface: #fff;
  --line: #e9e5f2;
  --ink: #24213b;
  --sidebar: #1b1a32;
  --sidebar-raised: #292641;
  --theme-accent: #7862e8;
  --theme-accent-strong: #5943cb;
  --theme-accent-soft: #312d53;
  --theme-accent-light: #ab9cf6;
  --theme-accent-tint: #f0edff;
}
body[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0c111a;
  --surface: #151c27;
  --line: #283344;
  --ink: #edf1f8;
  --sidebar: #090e16;
  --sidebar-raised: #171f2c;
  --theme-accent: #a493ff;
  --theme-accent-strong: #9883ff;
  --theme-accent-soft: #2a2347;
  --theme-accent-light: #b6aaff;
  --theme-accent-tint: #211d35;
  --muted: #9aa8bb;
  --muted-dark: #c1ccda;
}
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .theme-option,
body[data-theme="dark"] .period-select-wrap,
body[data-theme="dark"] .search-control,
body[data-theme="dark"] .filter-control,
body[data-theme="dark"] .outline-button,
body[data-theme="dark"] .log-overview-strip > div {
  color: var(--ink);
  background-color: var(--surface);
}
body[data-theme="dark"] .breadcrumb strong,
body[data-theme="dark"] .panel-heading h2,
body[data-theme="dark"] .metric-value,
body[data-theme="dark"] .metric-label,
body[data-theme="dark"] .member-info strong,
body[data-theme="dark"] .activity-text strong,
body[data-theme="dark"] .table-member strong,
body[data-theme="dark"] .theme-option-copy strong,
body[data-theme="dark"] .language-panel h2,
body[data-theme="dark"] .log-toolbar-copy h2,
body[data-theme="dark"] .log-overview-strip > div > strong,
body[data-theme="dark"] .event-label {
  color: var(--ink);
}
body[data-theme="dark"] .page-subtitle,
body[data-theme="dark"] .panel-heading p,
body[data-theme="dark"] .metric-foot,
body[data-theme="dark"] .breadcrumb,
body[data-theme="dark"] .log-toolbar-copy p,
body[data-theme="dark"] .language-panel p,
body[data-theme="dark"] .channel-info strong,
body[data-theme="dark"] .member-activity-value,
body[data-theme="dark"] .log-time {
  color: #a1afc2;
}
body[data-theme="dark"] .data-banner { color: #d3caff; }
body[data-theme="dark"] .log-table th { background: #111823; }
body[data-theme="dark"] th { color: #9eacc0; }
body[data-theme="dark"] td { color: #bbc6d5; }
body[data-theme="dark"] .table-member strong,
body[data-theme="dark"] .event-label { color: #e1e7f0; }
body[data-theme="dark"] .search-control input,
body[data-theme="dark"] .filter-control select,
body[data-theme="dark"] .period-select-wrap select { color: #d8e0ec; }
body[data-theme="dark"] .filter-control select option { color: #edf1f8; background-color: #151c27; }
body[data-theme="dark"] .search-control input::placeholder { color: #8492a7; }
body[data-theme="dark"] .theme-preview { background: #202a39; }
body[data-theme="dark"] .theme-preview i { background: #344153; }
body[data-theme="dark"] .theme-dark i:last-child { background: #a493ff; }
body[data-theme="dark"] .channel-hash,
body[data-theme="dark"] .metric-icon.purple { color: var(--theme-accent-light); background: var(--theme-accent-tint); }
body[data-theme="dark"] .voice-current,
body[data-theme="dark"] .compact-member-row,
body[data-theme="dark"] .activity-row,
body[data-theme="dark"] .voice-rank-row,
body[data-theme="dark"] .channel-row,
body[data-theme="dark"] td,
body[data-theme="dark"] th { border-color: #273244; }
body[data-theme="dark"] .log-overview-strip .log-retention { background: #211d35; }
body[data-theme="dark"] .log-retention small { color: #a79dce; }
body[data-theme="dark"] .log-retention > span:last-child { color: #d0c8ef; }
body[data-theme="dark"] .status-pill { color: #7ed4b0; background: #17352b; }
body[data-theme="dark"] .status-pill.new { color: #c1b6ff; background: #292344; }
body[data-theme="dark"] .metric-change.positive { color: #7ed4b0; background: #17352b; }
body[data-theme="dark"] .sample-caption { border-color: var(--line); color: #a1afc2; }
body[data-theme="dark"] .category-note { border-color: #6254a6; color: #b5bed0; background: #1b2030; }
body[data-theme="dark"] .category-note strong { color: #d8d1ff; }
body[data-theme="dark"] .connection-setup,
body[data-theme="dark"] .connection-warning { color: #aab7ca; }
body[data-theme="dark"] ::-webkit-scrollbar-track { background: #111823; }
body[data-theme="dark"] ::-webkit-scrollbar-thumb { border-color: #111823; background: #39465a; }
body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #53627a; }
.brand-mark { color: var(--theme-accent-light); }
.chart-line-members { stroke: var(--theme-accent); }
.voice-bar { background: linear-gradient(180deg, var(--theme-accent-light), var(--theme-accent)); }
.voice-bar.peak { background: linear-gradient(180deg, var(--theme-accent-light), var(--theme-accent-strong)); }
.detail-bar { background: linear-gradient(180deg, var(--theme-accent-light), var(--theme-accent)); }
.nav-link.active .nav-count { background: color-mix(in srgb, var(--theme-accent) 35%, transparent); }
.data-banner button { color: var(--theme-accent); }
.search-control, .filter-control { border-color: var(--line); background: var(--surface); }
.outline-button, .theme-option { border-color: var(--line); background: var(--surface); }
.theme-option.selected { border-color: var(--theme-accent); }
.log-overview-strip > div { border-color: var(--line); background: var(--surface); }
.log-overview-strip .log-retention { border-color: color-mix(in srgb, var(--theme-accent) 24%, var(--line)); background: var(--theme-accent-tint); }
.log-table th { background: color-mix(in srgb, var(--surface) 85%, var(--canvas)); }
.metric-card, .panel, .topbar { transition: background-color .18s ease, border-color .18s ease; }

.language-toggle {
  width: 100%; min-height: 36px; display: flex; align-items: center; gap: 9px;
  margin-bottom: 10px; padding: 0 10px; border: 1px solid #343e51; border-radius: 7px;
  color: #c4cad6; background: var(--sidebar-raised); text-align: left; font-size: 10px;
}
.language-toggle:hover { border-color: #505a6e; color: #fff; background: #252f42; }
.language-toggle svg { width: 15px; height: 15px; fill: none; stroke: #9da8ba; stroke-width: 1.6; stroke-linecap: round; }
.language-label { flex: 1; }
.language-name { color: var(--theme-accent-light); font-weight: 600; }

.settings-panel { max-width: 780px; padding: 20px; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 20px; }
.theme-option {
  min-height: 75px; position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px; border: 1px solid #e8ebf1; border-radius: 8px; background: #fff;
  text-align: left; transition: border-color .16s, box-shadow .16s;
}
.theme-option:hover { border-color: #d4d0ee; }
.theme-option.selected { border-color: var(--theme-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent) 12%, transparent); }
.theme-preview { width: 62px; height: 46px; display: flex; flex: 0 0 62px; flex-direction: column; justify-content: center; gap: 4px; padding: 7px; border-radius: 6px; background: #f4f5f8; }
.theme-preview i { height: 5px; display: block; border-radius: 4px; background: #dfe3eb; }
.theme-preview i:first-child { width: 75%; }
.theme-preview i:nth-child(2) { width: 100%; }
.theme-preview i:last-child { width: 56%; }
.theme-violet i:last-child { background: #7862e8; }
.theme-ocean i:last-child { background: #2587b7; }
.theme-forest i:last-child { background: #31875d; }
.theme-sunset i:last-child { background: #d56845; }
.theme-dark { background: #101722; }
.theme-dark i { background: #273243; }
.theme-dark i:last-child { background: #a493ff; }
.theme-option-copy { min-width: 0; display: grid; gap: 4px; }
.theme-option-copy strong { color: #394559; font-size: 10px; }
.theme-option-copy small { color: #959eac; font-size: 8px; }
.theme-check { width: 17px; height: 17px; display: grid; place-items: center; margin-left: auto; border: 1px solid #e3e7ed; border-radius: 50%; color: transparent; font-size: 10px; }
.theme-option.selected .theme-check { border-color: var(--theme-accent); color: #fff; background: var(--theme-accent); }
.avatar-visibility-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.avatar-visibility-setting h3 { margin: 0; color: var(--ink); font-size: 10px; font-weight: 700; }
.avatar-visibility-setting p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.avatar-visibility-toggle { min-width: 92px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 4px 0; border: 0; color: var(--theme-accent-strong); background: transparent; font-size: 9px; font-weight: 600; }
.avatar-switch-track { width: 30px; height: 17px; position: relative; flex: 0 0 30px; border-radius: 10px; background: #aab2c0; transition: background .16s; }
.avatar-switch-track i { width: 13px; height: 13px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 18%); transition: transform .16s; }
.avatar-visibility-toggle[aria-checked="true"] .avatar-switch-track { background: var(--theme-accent); }
.avatar-visibility-toggle[aria-checked="true"] .avatar-switch-track i { transform: translateX(13px); }
.language-panel { max-width: 780px; display: flex; align-items: center; gap: 13px; margin-top: 13px; padding: 16px 18px; }
.language-panel-icon { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; border-radius: 8px; color: var(--theme-accent); background: var(--theme-accent-tint); }
.language-panel-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.language-panel > div:nth-child(2) { flex: 1; }
.language-panel h2 { margin: 0; color: #293448; font: 700 11px "Manrope", sans-serif; }
.language-panel p { margin: 4px 0 0; color: #9099a8; font-size: 9px; line-height: 1.5; }

.connection-panel { max-width: 780px; margin-bottom: 13px; padding: 18px 20px; }
.connection-heading { display: flex; align-items: flex-start; gap: 12px; }
.connection-icon { width: 35px; height: 35px; display: grid; flex: 0 0 35px; place-items: center; border-radius: 9px; color: var(--theme-accent); background: var(--theme-accent-tint); }
.connection-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.connection-copy { min-width: 0; flex: 1; }
.connection-eyebrow { color: var(--theme-accent); font-size: 7px; font-weight: 700; letter-spacing: 1px; }
.connection-copy h2 { margin: 5px 0 0; color: var(--ink); font: 700 12px "Manrope", sans-serif; }
.connection-copy p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.connection-status { flex: 0 0 auto; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--canvas); font-size: 8px; }
.connection-status.connected { border-color: #b8e3d1; color: #21855f; background: #eff9f4; }
.connection-actions { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.connect-discord-button { min-height: 35px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 0; border-radius: 6px; color: #fff; background: #5865f2; font-size: 9px; font-weight: 600; }
.connect-discord-button:hover { background: #4752c4; }
.connect-discord-button svg { width: 17px; height: 17px; }
.disconnect-button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: #bf5965; background: var(--surface); font-size: 9px; }
.connection-setup { padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; color: #768398; background: var(--canvas); font-size: 9px; line-height: 1.6; }
.connection-setup > strong { color: var(--ink); font-size: 9px; }
.connection-setup ol { display: grid; gap: 5px; margin: 8px 0; padding-inline-start: 18px; }
.connection-setup a { color: var(--theme-accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.connection-setup code { padding: 2px 4px; border-radius: 3px; color: var(--theme-accent-strong); background: var(--theme-accent-tint); font-size: 8px; }
.connection-setup p { margin: 8px 0 0; color: #9a8190; font-size: 8px; }
.connection-warning { margin-top: 12px; padding: 9px 11px; border: 1px solid #f1d0cc; border-radius: 6px; color: #a94540; background: #fff5f3; font-size: 9px; line-height: 1.5; }
.server-avatar-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: white; background: linear-gradient(140deg, var(--theme-accent), var(--theme-accent-strong)); font: 700 17px "Manrope", sans-serif; }
body[data-theme="dark"] .connection-status.connected { border-color: #2c5a48; color: #84dab5; background: #17352b; }
body[data-theme="dark"] .connection-warning { border-color: #68403e; color: #ffc0b8; background: #382321; }

body[dir="rtl"] { font-family: "DM Sans", Tahoma, Arial, sans-serif; }
body[dir="rtl"] .sidebar { right: 0; left: auto; }
body[dir="rtl"] .main-content { margin-right: 252px; margin-left: 0; }
body[dir="rtl"] .nav-link.active { box-shadow: inset -2px 0 var(--theme-accent-light); }
body[dir="rtl"] .nav-link svg { transform: scaleX(-1); }
body[dir="rtl"] .page-footer, body[dir="rtl"] .page-heading, body[dir="rtl"] .panel-heading,
body[dir="rtl"] .log-toolbar, body[dir="rtl"] .log-table-footer { direction: rtl; }
body[dir="rtl"] .log-controls { direction: ltr; }
body[dir="rtl"] .filter-control select { direction: ltr; text-align: left; }
body[dir="rtl"] .log-table th, body[dir="rtl"] .log-table td { text-align: right; }
body[dir="rtl"] .log-table th:last-child, body[dir="rtl"] .log-table td:last-child { text-align: left; }
body[dir="rtl"] .log-table th:first-child, body[dir="rtl"] .log-table td:first-child { padding-right: 17px; padding-left: 12px; }
body[dir="rtl"] .log-table th:last-child, body[dir="rtl"] .log-table td:last-child { padding-left: 17px; padding-right: 12px; }
body[dir="rtl"] .metric-value, body[dir="rtl"] .voice-summary { direction: rtl; }
body[dir="rtl"] .voice-current strong { margin-right: auto; margin-left: 0; }
body[dir="rtl"] .mobile-menu { margin-right: 0; margin-left: 10px; }
body[dir="rtl"] .breadcrumb { direction: rtl; }
body[dir="rtl"] .toast { right: auto; left: 22px; }

@media (max-width: 1150px) {
  body[dir="rtl"] .main-content { margin-right: 224px; }
}
@media (max-width: 900px) {
  body[dir="rtl"] .sidebar { right: 0; left: auto; visibility: hidden; transform: translateX(100%); }
  body[dir="rtl"] .sidebar.open { visibility: visible; transform: translateX(0); }
  body[dir="rtl"] .main-content { margin-right: 0; }
}
@media (max-width: 680px) {
  .theme-options { grid-template-columns: 1fr; gap: 8px; }
  .settings-panel { padding: 14px; }
  .language-panel { align-items: flex-start; flex-wrap: wrap; padding: 13px; }
  .connection-panel { padding: 14px; }
  .connection-heading { flex-wrap: wrap; }
  .connection-status { margin-inline-start: 47px; }
  .auth-brand { top: 18px; left: 18px; }
  .auth-card { padding: 24px 19px; }
  .language-panel .outline-button { margin-inline-start: 47px; }
  body[dir="rtl"] .toast { right: auto; left: 16px; }
}
