:root {
  --bg: #0e1014;
  --panel: #13161b;
  --panel-2: #181b21;
  --panel-3: #20242b;
  --border: #292e37;
  --border-soft: #22262e;
  --text: #f3f4f6;
  --muted: #929aa8;
  --muted-2: #646c79;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.13);
  --green: #43d09a;
  --amber: #f4bc63;
  --red: #ff7f8b;
  --sidebar: 224px;
  --topbar: 52px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { height: 100vh; display: grid; grid-template: var(--topbar) minmax(0, 1fr) / var(--sidebar) minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; border-bottom: 1px solid var(--border); background: #111318; z-index: 20; }
.brand { width: var(--sidebar); height: 100%; padding: 0 17px; display: flex; gap: 10px; align-items: center; border-right: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.brand > span:last-child > span { color: var(--muted); font-weight: 500; }
.brand-mark { position: relative; width: 21px; height: 21px; background: var(--text); border-radius: 6px 6px 6px 2px; transform: rotate(-8deg); display: block; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; background: #111318; border-radius: 2px; }
.brand-mark span { position: absolute; width: 6px; height: 6px; left: 1px; bottom: -3px; background: var(--text); transform: skew(-25deg); }
.database-status { height: 100%; padding: 0 18px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(244,188,99,.08); }
.database-status.online .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(67,208,154,.08); }
.database-status.offline .status-dot { background: var(--red); }
.top-actions { margin-left: auto; height: 100%; padding: 0 14px; display: flex; align-items: center; gap: 12px; }
.readonly-pill { color: var(--muted); border: 1px solid var(--border); background: var(--panel-2); padding: 5px 9px; border-radius: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.avatar { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #81a8ff, #6e5ee8); color: white; font-size: 10px; font-weight: 700; }
.account-button { min-width: 76px; height: 31px; padding: 0 11px; border: 1px solid #3a4557; border-radius: 7px; background: #1a1e25; color: #d7dce4; cursor: pointer; font-size: 11px; font-weight: 600; }
.account-button:hover { border-color: #587bc5; background: #202737; color: #edf2ff; }
.account-button.authenticated { border-color: rgba(67,208,154,.27); background: rgba(67,208,154,.08); color: #8be1bd; }
.account-button:disabled { opacity: .55; cursor: wait; }
.mobile-menu { display: none; }

.sidebar { min-height: 0; padding: 18px 10px 12px; display: flex; flex-direction: column; background: #0b0d10; border-right: 1px solid var(--border); overflow: auto; }
.home-nav-item { margin-bottom: 2px; }
.favorites-nav-item { margin-bottom: 13px; }
.favorite-nav-icon { color: #f0c782; font-size: 20px; line-height: 1; }
.sidebar-label { color: var(--muted-2); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 0 10px 9px; }
.nav-item { width: 100%; height: 42px; padding: 0 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 7px; color: #aeb5c0; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.nav-item:hover { color: var(--text); background: #16191e; }
.nav-item.active { color: var(--text); background: #20242b; box-shadow: inset 2px 0 var(--accent); }
.nav-icon { width: 17px; height: 17px; display: grid; place-items: center; color: currentColor; }
.nav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.nav-count { margin-left: auto; color: var(--muted-2); font: 10px "DM Mono", monospace; }
.nav-item.active .nav-count { color: #9cb9ff; }
.sidebar-divider { margin: 15px 8px; border-top: 1px solid var(--border-soft); }
.sidebar-note { display: flex; gap: 9px; margin: 0 7px; padding: 12px 10px; background: #12151a; border: 1px solid var(--border-soft); border-radius: 8px; }
.note-icon { flex: 0 0 auto; width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid var(--muted-2); border-radius: 50%; color: var(--muted); font: 10px serif; }
.sidebar-note p { margin: 0; font-size: 11px; line-height: 1.4; }
.sidebar-note strong { display: block; font-weight: 600; color: #c9ced6; }
.sidebar-note span { display: block; margin-top: 3px; color: var(--muted-2); }
.sidebar-footer { margin-top: auto; padding: 14px 10px 2px; display: flex; flex-direction: column; gap: 4px; color: var(--muted-2); font: 10px "DM Mono", monospace; }

.main { min-width: 0; min-height: 0; overflow: auto; background: var(--bg); }
.login-view { min-height: 100%; padding: 48px 24px; display: grid; place-items: center; background: radial-gradient(circle at 50% 20%, rgba(91,140,255,.09), transparent 34%), linear-gradient(180deg, #0e1116, #0c0e12); }
.login-card { width: min(420px, 100%); padding: 32px; border: 1px solid #2d3440; border-radius: 13px; background: linear-gradient(145deg, rgba(25,29,36,.98), rgba(17,20,25,.98)); box-shadow: 0 24px 70px rgba(0,0,0,.38); }
.login-mark { position: relative; width: 38px; height: 38px; margin-bottom: 23px; border-radius: 10px 10px 10px 4px; background: #dce7ff; transform: rotate(-7deg); }
.login-mark::after { content: ""; position: absolute; inset: 11px; border-radius: 3px; background: #171b22; }
.login-mark span { position: absolute; left: 2px; bottom: -5px; width: 10px; height: 9px; background: #dce7ff; transform: skew(-25deg); }
.login-kicker { margin-bottom: 8px; color: #86a7f3; font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.login-card h1 { font-size: 23px; }
.login-card > p { margin: 10px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 7px; color: #abb3bf; font-size: 10px; font-weight: 600; }
.login-form .input { height: 40px; background: #111419; font-size: 13px; }
.login-submit { width: 100%; height: 40px; margin-top: 2px; }
.login-submit:disabled { opacity: .62; cursor: wait; }
.login-error { min-height: 16px; margin-top: -4px; color: #ff9eaa; font-size: 11px; line-height: 1.45; }
.login-foot { margin-top: 21px; padding-top: 17px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border-soft); color: var(--muted-2); font-size: 10px; }
.login-foot .status-dot { width: 6px; height: 6px; background: var(--green); box-shadow: 0 0 0 4px rgba(67,208,154,.07); }

.view { min-height: 100%; display: flex; flex-direction: column; }
.view-header { padding: 22px 24px 17px; border-bottom: 1px solid var(--border-soft); background: #101217; }
.eyebrow { margin-bottom: 8px; display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 11px; }
.eyebrow button { padding: 0; border: 0; background: none; color: #9eb8f9; font-size: inherit; cursor: pointer; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.estimate { flex: 0 0 auto; color: var(--muted); font: 11px "DM Mono", monospace; }

.toolbar { min-height: 61px; padding: 11px 24px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--border); background: var(--panel); }
.search-box { position: relative; width: min(380px, 42vw); }
.search-box svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); stroke: var(--muted-2); fill: none; stroke-width: 2; }
.input, .select { height: 36px; border: 1px solid var(--border); border-radius: 6px; outline: none; background: #191c22; color: var(--text); font-size: 12px; }
.input { width: 100%; padding: 0 11px; }
.search-box .input { padding-left: 34px; }
.input::placeholder { color: #666e7b; }
.input:focus, .select:focus { border-color: #587bc5; box-shadow: 0 0 0 2px rgba(91,140,255,.1); }
.select { padding: 0 31px 0 10px; color: #c7ccd4; }
.button { height: 36px; padding: 0 12px; display: inline-flex; gap: 7px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; background: #1a1d23; color: #c4cad3; font-size: 12px; font-weight: 500; cursor: pointer; }
.button:hover { border-color: #3a414c; background: #20242b; color: var(--text); }
.button.primary { border-color: #4f79dd; background: #3f6edb; color: white; }
.button.active { color: #aec4ff; border-color: #4969ab; background: var(--accent-soft); }
.button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.refresh-button.refreshing svg { animation: refresh-spin .8s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
.toolbar-spacer { flex: 1; }
.sort-label { color: var(--muted-2); font-size: 11px; }
.filter-count { min-width: 17px; height: 17px; padding: 0 5px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: white; font: 9px "DM Mono", monospace; }
.metrics-control { position: relative; }
.metrics-button .chevron { margin-left: 3px; color: var(--muted-2); font-size: 13px; }
.metrics-menu { position: absolute; top: calc(100% + 7px); right: 0; z-index: 20; display: none; width: 260px; border: 1px solid #343a45; border-radius: 8px; background: #171a20; box-shadow: 0 18px 45px rgba(0,0,0,.42); overflow: hidden; }
.metrics-menu.open { display: block; }
.metrics-title { padding: 11px 12px; border-bottom: 1px solid var(--border); color: #cbd1d9; font-size: 11px; font-weight: 600; }
.metrics-options { max-height: 330px; padding: 5px; overflow-y: auto; }
.metric-option { min-height: 34px; padding: 0 8px; display: flex; align-items: center; gap: 9px; border-radius: 5px; color: #b8bec8; font-size: 11px; cursor: pointer; }
.metric-option:hover { background: #20242b; color: var(--text); }
.metric-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.metric-option input:disabled { opacity: .5; }


.active-filters { padding: 9px 24px; display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border-soft); background: #101318; }
.filter-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 7px; border: 1px solid #34466d; border-radius: 5px; background: rgba(91,140,255,.08); color: #a9bff2; font-size: 10px; }
.filter-chip button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; }

.chat-overview { padding: 14px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(120deg, rgba(91,140,255,.08), rgba(105,82,210,.05) 55%, #111419); }
.chat-overview.ready { padding-top: 16px; padding-bottom: 17px; }
.chat-overview-loading { min-height: 52px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.chat-overview-head { display: flex; align-items: center; gap: 11px; }
.chat-overview-mark { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #4d64a0; border-radius: 8px; background: rgba(91,140,255,.12); color: #a9c0ff; font-size: 15px; }
.chat-overview-kicker { display: block; margin-bottom: 4px; color: #8eaffc; font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.chat-overview-head h2 { margin: 0; color: #e3e7ef; font-size: 13px; font-weight: 600; }
.chat-overview-meta { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.chat-overview-meta span { padding: 4px 6px; border: 1px solid #343c4a; border-radius: 5px; background: rgba(16,19,24,.7); color: var(--muted); font: 8px "DM Mono", monospace; }
.chat-overview-copy { margin: 14px 0 0 43px; max-width: 980px; color: #cbd1db; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.chat-overview-foot { margin: 12px 0 0 43px; color: var(--muted-2); font-size: 8px; }
.chat-overview-status { min-height: 52px; display: flex; align-items: center; gap: 11px; }
.chat-overview-status > div { min-width: 0; }
.chat-overview-status strong { display: block; color: #d2d7df; font-size: 11px; font-weight: 600; }
.chat-overview-status p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.chat-overview-status .button { margin-left: auto; }
.chat-overview.warning { background: linear-gradient(120deg, rgba(244,188,99,.07), #111419); }
.chat-overview.warning .chat-overview-mark { border-color: rgba(244,188,99,.35); background: rgba(244,188,99,.08); color: #efc47e; }
.chat-overview.muted { background: #111419; }
.chat-overview.muted .chat-overview-mark { border-color: #343b46; background: #1a1e24; color: #7d8795; }
.chat-overview.error { background: linear-gradient(120deg, rgba(255,127,139,.06), #111419); }
.chat-overview.error .chat-overview-mark { border-color: rgba(255,127,139,.3); background: rgba(255,127,139,.07); color: #f69ca5; }

.table-wrap { min-height: 270px; overflow: auto; background: var(--panel); }
.data-table { min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; }
.data-table th { position: sticky; top: 0; z-index: 3; height: 39px; padding: 0 16px 0 8px; border-bottom: 1px solid var(--border); background: #1d2026; color: #9aa2ae; font-size: 10px; font-weight: 600; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.column-resize-handle { position: absolute; top: 0; right: -4px; z-index: 5; width: 9px; height: 100%; cursor: col-resize; touch-action: none; }
.column-resize-handle::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 4px; width: 1px; background: transparent; }
.column-resize-handle:hover::after, .column-resize-handle:focus::after, .column-resize-handle.resizing::after { background: #7198f5; }
.column-resize-handle:focus, .column-drag-handle:focus { outline: 1px solid #7198f5; outline-offset: -1px; }
.column-drag-handle { position: relative; flex: 0 0 12px; width: 12px; height: 22px; border-radius: 3px; cursor: grab; opacity: .38; }
.column-drag-handle::before { content: "⠿"; position: absolute; inset: 0; display: grid; place-items: center; color: currentColor; font-size: 13px; line-height: 1; }
.column-drag-handle:hover, .column-drag-handle:focus { background: #303640; opacity: 1; }
body.column-resizing { cursor: col-resize; user-select: none; }
body.column-dragging { cursor: grabbing; user-select: none; }
th.column-drop-before { box-shadow: inset 2px 0 #7198f5; }
th.column-drop-after { box-shadow: inset -2px 0 #7198f5; }
.data-table th.sortable-column { cursor: pointer; user-select: none; }
.data-table th.sortable-column:hover { color: #d6dbe3; background: #24282f; }
.data-table th.active-sort { color: #a8c0ff; background: #222832; }
.column-header-content { min-width: 100%; display: inline-flex; align-items: center; gap: 7px; }
.column-header-title { display: inline-flex; align-items: center; }
.column-filter-button { width: 21px; height: 21px; padding: 4px; display: inline-grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #626b78; cursor: pointer; }
.column-filter-button:hover { background: #303640; color: #d6dbe3; }
.column-filter-button.active { background: rgba(91,140,255,.14); color: #84a8ff; }
.column-filter-button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.column-filter-popover { position: fixed; z-index: 100; width: 280px; overflow: hidden; border: 1px solid #3a414e; border-radius: 8px; background: #181b21; box-shadow: 0 16px 45px rgba(0,0,0,.5); color: var(--text); font-size: 11px; letter-spacing: normal; text-align: left; text-transform: none; }
.column-filter-heading { min-height: 42px; padding: 0 11px 0 13px; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.column-filter-heading strong { font-size: 11px; font-weight: 600; }
.popover-close { margin-left: auto; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.popover-close:hover { background: #292e37; color: var(--text); }
.column-filter-body { padding: 13px; }
.column-filter-stack { display: grid; gap: 11px; }
.column-filter-range { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.column-filter-range label, .column-filter-field { display: block; color: var(--muted); font-size: 10px; }
.column-filter-range .input, .column-filter-field .select, .column-filter-field .input { width: 100%; margin-top: 6px; }
.column-filter-help { margin: 9px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.4; }
.country-select { max-height: 260px; }
.column-filter-actions { padding: 10px 13px; display: flex; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--border); background: #14171c; }
.sort-indicator { margin-left: 8px; color: #626b78; font-size: 9px; }
.data-table td { height: 51px; padding: 7px 12px; overflow: hidden; border-bottom: 1px solid var(--border-soft); color: #c9ced6; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.data-table tbody tr { background: #15181d; }
.data-table tbody tr:nth-child(even) { background: #171a20; }
.data-table tbody tr:hover { background: #1e2229; }
.data-table tr.clickable { cursor: pointer; }
.favorite-cell { min-width: 0; display: flex; align-items: center; gap: 8px; }
.favorite-button { flex: 0 0 auto; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid #363d48; border-radius: 7px; background: #1b1f25; color: #7a8492; cursor: pointer; font-size: 20px; line-height: 1; }
.favorite-button:hover { border-color: #816e3f; background: rgba(244,188,99,.08); color: #f2ca83; }
.favorite-button.active { border-color: rgba(244,188,99,.38); background: rgba(244,188,99,.1); color: #f4bc63; }
.favorite-button:disabled { opacity: .5; cursor: wait; }
.favorite-button.compact { width: 26px; height: 26px; border: 0; background: transparent; font-size: 17px; }
.favorite-button.compact:hover, .favorite-button.compact.active { background: rgba(244,188,99,.09); }
.profile-identity > .favorite-button { margin-left: auto; width: 40px; height: 40px; font-size: 23px; }
.player-with-avatar { display: flex; align-items: center; gap: 9px; }
.chat-player-link { cursor: pointer; }
.quick-filter-cell { display: inline-flex; align-items: center; gap: 5px; }
.quick-filter-button { width: 24px; height: 24px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #667181; cursor: pointer; }
.quick-filter-button:hover { background: rgba(91,140,255,.12); color: #91b1ff; }
.quick-filter-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.player-headshot-shell { position: relative; flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border: 1px solid #343a45; border-radius: 7px; background: #22262d; }
.player-headshot-fallback { color: #8f9aaa; font-size: 9px; font-weight: 700; }
.player-headshot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #22262d; }
.external-profile-link { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; color: #6397ff; text-decoration: none; }
.external-profile-link:hover { color: #a9c3ff; background: rgba(91,140,255,.12); }
.external-profile-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.location-value { display: inline-flex; align-items: center; gap: 7px; }
.country-flag { flex: 0 0 20px; width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.13); background-size: cover; }
.primary-cell { display: flex; flex-direction: column; gap: 3px; max-width: 260px; }
.primary-title-row { min-width: 0; display: flex; align-items: center; gap: 4px; }
.primary-cell strong { color: #8eb0ff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.primary-cell small { color: var(--muted-2); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.game-link { min-width: 190px; max-width: 270px; display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; vertical-align: middle; }
.game-link:not(.unavailable):hover strong { color: #bed0ff; text-decoration: underline; }
.game-link.unavailable { cursor: default; }
.game-icon-shell { position: relative; flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border: 1px solid #343a45; border-radius: 7px; background: #22262d; }
.game-icon-fallback { color: #8993a2; font-size: 11px; font-weight: 700; }
.game-icon { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #22262d; }
.game-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.game-copy strong { overflow: hidden; color: #8eb0ff; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.game-copy small { overflow: hidden; color: var(--muted-2); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stat-game { margin-top: 8px; }
.stat-game .game-link { min-width: 0; max-width: 100%; }
.mono { font-family: "DM Mono", ui-monospace, monospace; font-size: 10.5px; }
.muted { color: var(--muted-2); }
.link { padding: 0; border: 0; background: none; color: #8eaffc; cursor: pointer; font: inherit; text-decoration: none; }
.link:hover { color: #bed0ff; text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 21px; padding: 3px 7px; border-radius: 5px; border: 1px solid #303641; background: #20242b; color: #aab1bc; font-size: 10px; }
.badge.green { border-color: rgba(67,208,154,.25); background: rgba(67,208,154,.08); color: #70ddb3; }
.badge.blue { border-color: rgba(91,140,255,.26); background: rgba(91,140,255,.09); color: #9bb8ff; }
.badge.amber { border-color: rgba(244,188,99,.25); background: rgba(244,188,99,.08); color: #f0c782; }
.message-cell { max-width: 390px; overflow: hidden; color: #d8dbe0; text-overflow: ellipsis; }
.table-footer { min-height: 59px; padding: 9px 16px 9px 24px; display: flex; align-items: center; gap: 18px; border-top: 1px solid var(--border); background: #111419; color: var(--muted); font-size: 11px; }
.pagination { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pagination-pages { display: inline-flex; align-items: center; gap: 6px; }
.pagination-page, .pagination-arrow { height: 32px; min-width: 32px; padding: 0 9px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: #191c22; color: #c2c8d1; cursor: pointer; font: 11px "DM Mono", monospace; }
.pagination-arrow { min-width: 27px; padding: 0; background: transparent; color: #76808e; font-size: 19px; }
.pagination-page:hover:not(:disabled), .pagination-arrow:hover:not(:disabled) { border-color: #3a414c; background: #20242b; color: var(--text); }
.pagination-page.active { border-color: #4f79dd; background: #18223b; color: #d8e3ff; }
.pagination-page:disabled:not(.active), .pagination-arrow:disabled { opacity: .42; cursor: default; }
.pagination-ellipsis { min-width: 24px; color: var(--muted-2); text-align: center; font: 12px "DM Mono", monospace; }
.pagination-loading { color: var(--muted-2); }
.page-size-control { margin-left: 8px; }
.page-size-select { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: 6px; outline: none; background: #191c22; color: #c2c8d1; font-size: 11px; cursor: pointer; }
.page-size-select:focus { border-color: #587bc5; box-shadow: 0 0 0 2px rgba(91,140,255,.1); }
.empty-state, .error-state { min-height: 280px; padding: 45px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.empty-icon { width: 38px; height: 38px; margin-bottom: 13px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--muted-2); }
.empty-state h3, .error-state h3 { margin: 0 0 6px; color: #cdd2da; font-size: 14px; }
.empty-state p, .error-state p { max-width: 430px; margin: 0 0 15px; font-size: 12px; line-height: 1.6; }

.loading-screen { min-height: 70vh; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.spinner { width: 15px; height: 15px; border: 2px solid #303641; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.table-loading { height: 3px; overflow: hidden; background: #1c2027; }
.table-loading::after { content: ""; display: block; width: 35%; height: 100%; background: var(--accent); animation: loading 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(300%); } }

.profile-header { padding-bottom: 22px; }
.profile-identity { margin-top: 17px; display: flex; align-items: center; gap: 14px; }
.identity-mark { width: 48px; height: 48px; border: 1px solid #4767a8; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, #263b67, #171d2c); color: #bdd0ff; font-size: 15px; font-weight: 700; }
.identity-copy h1 { font-size: 20px; }
.identity-copy p { margin: 4px 0 0; color: var(--muted); font: 11px "DM Mono", monospace; }
.profile-body { padding: 18px 24px 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.stat-card { min-height: 84px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.stat-label { color: var(--muted-2); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { margin-top: 9px; color: #e9ebef; font: 16px "DM Mono", monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-card { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); overflow: hidden; }
.section-head { min-height: 46px; padding: 0 14px; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.section-head h2 { margin: 0; font-size: 12px; font-weight: 600; }
.section-head span { margin-left: auto; color: var(--muted-2); font-size: 10px; }
.details { padding: 6px 14px; display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.detail { min-width: 0; padding: 11px 8px 11px 0; }
.detail dt { margin-bottom: 5px; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.detail dd { margin: 0; color: #cbd0d7; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 12px; }
.history-grid .detail-card { min-width: 0; }
.mini-list { min-height: 150px; }
.mini-row { min-height: 54px; padding: 9px 13px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-soft); font-size: 11px; }
.mini-row:last-child { border-bottom: 0; }
.mini-main { min-width: 0; flex: 1; }
.mini-main strong { display: block; color: #cbd1da; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-main span { display: block; margin-top: 4px; color: var(--muted-2); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta { color: var(--muted); font: 9px "DM Mono", monospace; white-space: nowrap; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 380px; padding: 11px 13px; border: 1px solid #4f3940; border-radius: 7px; background: #25191d; color: #ffb6be; box-shadow: 0 12px 30px rgba(0,0,0,.3); font-size: 11px; line-height: 1.5; }

.favorites-body { padding: 20px 24px 30px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.favorites-panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); }
.favorites-list { min-height: 180px; }
.favorite-record { min-height: 70px; padding: 8px 10px 8px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-soft); }
.favorite-record:last-child { border-bottom: 0; }
.favorite-record:hover { background: #181c22; }
.favorite-record-link { min-width: 0; flex: 1; padding: 0; display: flex; align-items: center; gap: 11px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.favorite-record-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.favorite-record-copy strong, .favorite-record-copy small, .favorite-record-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-record-copy strong { color: #d7dce4; font-size: 12px; font-weight: 600; }
.favorite-record-copy small { color: #8eaffc; font: 10px "DM Mono", monospace; }
.favorite-record-copy > span { color: var(--muted-2); font-size: 9px; }
.favorite-verified { color: #8eb0ff; }
.favorite-server-mark { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #3d4d6c; border-radius: 8px; background: #1b2435; color: #9bb8ff; font-size: 10px; font-weight: 700; }
.favorites-empty { min-height: 180px; padding: 28px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted-2); }
.favorites-empty > span { margin-bottom: 9px; color: #7c8490; font-size: 28px; }
.favorites-empty strong { color: #b8bec8; font-size: 12px; }
.favorites-empty p { margin: 6px 0 0; font-size: 10px; }
.home-body { padding: 20px 24px 30px; }
.home-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.home-metric { min-width: 0; min-height: 112px; padding: 17px; border: 1px solid var(--border); border-radius: 9px; background: linear-gradient(145deg, #171b22, #12151a); }
.home-metric > span { display: block; color: var(--muted-2); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.home-metric strong { display: block; margin-top: 13px; color: #edf0f5; font: 22px "DM Mono", monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-metric small { display: block; margin-top: 8px; color: var(--muted-2); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-section-heading { margin: 25px 0 11px; display: flex; align-items: flex-end; }
.home-section-heading h2 { margin: 0; font-size: 14px; }
.home-section-heading p { margin: 5px 0 0; color: var(--muted-2); font-size: 10px; }
.home-table-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-table-card { min-width: 0; min-height: 88px; padding: 13px 14px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 16px; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: inherit; text-align: left; cursor: pointer; }
.home-table-card:hover { border-color: #3c4657; background: #181c22; }
.home-table-icon, .home-activity-icon { display: grid; place-items: center; border: 1px solid #344467; border-radius: 8px; background: rgba(91,140,255,.09); color: #8eaffc; }
.home-table-icon { width: 38px; height: 38px; }
.home-table-icon svg, .home-activity-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.home-table-copy { min-width: 0; }
.home-table-copy strong { display: block; color: #d9dde4; font-size: 12px; font-weight: 600; }
.home-table-copy small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 9px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-table-count { color: #cbd4e6; font: 13px "DM Mono", monospace; text-align: right; }
.home-table-count small { display: block; margin-top: 3px; color: var(--muted-2); font: 8px Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.home-table-arrow { color: var(--muted-2); }
.home-table-card:hover .home-table-arrow { color: #9db9ff; transform: translateX(2px); }
.home-dashboard-grid { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 12px; }
.home-panel { min-width: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); overflow: hidden; }
.home-activity-list { display: flex; flex-direction: column; }
.home-activity-row { min-height: 62px; padding: 9px 13px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.home-activity-row:last-child { border-bottom: 0; }
.home-activity-row:hover { background: #191d23; }
.home-activity-icon { width: 32px; height: 32px; border-color: var(--border); background: #1b2028; color: #829bd0; }
.home-activity-row strong { display: block; color: #cfd4dc; font-size: 11px; font-weight: 500; }
.home-activity-row small { display: block; margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.home-activity-row time { color: #91a9dc; font: 9px "DM Mono", monospace; white-space: nowrap; }
.home-coverage-list { padding: 5px 14px 15px; }
.home-coverage { padding: 13px 0 8px; }
.home-coverage > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-coverage strong { color: #cfd4dc; font-size: 11px; font-weight: 500; }
.home-coverage span { color: var(--muted-2); font-size: 9px; }
.home-coverage-track { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 4px; background: #20252d; }
.home-coverage-track span { display: block; height: 100%; border-radius: inherit; background: #668ff1; }
.home-coverage-track span.green { background: #43b98d; }

@media (max-width: 980px) {
  .favorites-body { grid-template-columns: 1fr; }
  :root { --sidebar: 196px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .history-grid { grid-template-columns: 1fr; }
  .details { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

@media (max-width: 720px) {
  :root { --sidebar: 226px; }
  body { overflow: auto; }
  .app-shell { min-height: 100vh; height: auto; grid-template: var(--topbar) minmax(calc(100vh - var(--topbar)), auto) / 1fr; }
  .brand { width: auto; border-right: 0; }
  .database-status, .readonly-pill { display: none; }
  .mobile-menu { margin-left: auto; display: block; border: 0; background: none; color: var(--text); }
  .top-actions { margin-left: 0; }
  .account-button { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar { position: fixed; inset: var(--topbar) auto 0 0; width: var(--sidebar); z-index: 15; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 35px rgba(0,0,0,.35); }
  .sidebar.open { transform: translateX(0); }
  .main { overflow: visible; }
  .view-header, .toolbar, .active-filters { padding-left: 15px; padding-right: 15px; }
  .chat-overview { padding-left: 15px; padding-right: 15px; }
  .chat-overview-head { align-items: flex-start; }
  .chat-overview-meta { display: none; }
  .chat-overview-copy, .chat-overview-foot { margin-left: 0; }
  .toolbar { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .sort-label { display: none; }
  .title-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .table-footer { padding-left: 15px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .pagination { width: 100%; margin-left: 0; padding-bottom: 2px; overflow-x: auto; }
  .profile-body { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details { grid-template-columns: 1fr; }
  .login-view { padding: 28px 15px; }
  .login-card { padding: 25px 20px; }
}

@media (max-width: 980px) {
  .home-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .home-body, .favorites-body { padding: 14px 15px 24px; }
  .home-summary-grid, .home-table-grid { grid-template-columns: 1fr; }
  .home-metric { min-height: 100px; }
  .home-table-card { grid-template-columns: 38px minmax(0, 1fr) auto 12px; }
}
