:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --ink: #17202a;
  --muted: #6f7b88;
  --line: #e3e7eb;
  --blue: #2867e8;
  --blue-soft: #eaf1ff;
  --green: #179d69;
  --green-soft: #e8f7f0;
  --amber: #b4770b;
  --amber-soft: #fff5de;
  --red: #c84051;
  --red-soft: #fff0f2;
  --sidebar: #111923;
  --sidebar-muted: #8e9bab;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --shadow: 0 20px 55px rgba(24, 35, 48, 0.09);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 140ms;
  --base: 240ms;
  --slow: 380ms;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, rgba(40, 103, 232, 0.12), transparent 32rem), var(--bg); }
.login-card { width: min(100%, 410px); padding: 34px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.logo-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #3979f3, #1f59cf); box-shadow: 0 8px 20px rgba(40, 103, 232, 0.23); color: #fff; font-weight: 850; }
.login-card .logo-mark { margin-bottom: 24px; }
.login-card h1 { margin: 3px 0 8px; font-size: 29px; letter-spacing: -0.035em; }
.login-card > p:not(.eyebrow) { margin-bottom: 25px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-card .button + label { margin-top: 16px; }
.login-card .button + .button { margin-top: 10px; }
.login-card .button { width: 100%; }
.form-error { display: block; min-height: 18px; margin-top: 10px; color: var(--red); font-size: 12px; }

.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 242px; flex-direction: column; padding: 24px 16px 17px; background: var(--sidebar); color: #eef3fa; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.sidebar-brand div { display: flex; flex-direction: column; }
.sidebar-brand strong { font-size: 16px; }
.sidebar-brand div span { margin-top: 2px; color: var(--sidebar-muted); font-size: 11px; }
.sidebar-close { display: none; width: 40px; height: 40px; margin-left: auto; place-items: center; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 11px; background: rgba(255, 255, 255, 0.04); color: #eef3fa; font-size: 23px; line-height: 1; cursor: pointer; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 11px; background: transparent; color: var(--sidebar-muted); text-align: left; cursor: pointer; transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.nav-item:hover { background: rgba(255, 255, 255, 0.055); color: #dce6f2; }
.nav-item.is-active { background: rgba(73, 126, 238, 0.15); color: #fff; }
.nav-item:active { transform: translateY(1px); }
.nav-icon { color: #8393a6; font-size: 18px; text-align: center; }
.nav-item.is-active .nav-icon { color: #76a0ff; }
.nav-count { min-width: 22px; padding: 2px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); font-size: 10px; text-align: center; }
.sidebar-footer { display: grid; gap: 13px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.server-indicator { display: flex; align-items: center; gap: 10px; }
.server-indicator > span { width: 8px; height: 8px; border-radius: 50%; background: #37ca8b; box-shadow: 0 0 0 4px rgba(55, 202, 139, 0.11); }
.server-indicator div { display: flex; flex-direction: column; }
.server-indicator strong { font-size: 12px; }
.server-indicator small { margin-top: 2px; color: var(--sidebar-muted); font-size: 10px; }
.quiet-button { padding: 7px 0; border: 0; background: transparent; color: var(--sidebar-muted); font-size: 12px; text-align: left; cursor: pointer; }

.content { min-height: 100vh; margin-left: 242px; padding: 30px clamp(22px, 4vw, 54px) 60px; }
.content-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1440px; margin: 0 auto 28px; }
.content-header h1 { margin: 4px 0 0; font-size: 31px; letter-spacing: -0.04em; }
.eyebrow { margin: 0; color: #8a95a1; font-size: 10px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.updated-at { color: var(--muted); font-size: 11px; }
.icon-button, .mobile-menu { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; transition: background var(--fast) var(--ease), transform var(--fast) var(--ease); }
.icon-button:hover, .mobile-menu:hover { background: var(--surface-soft); }
.icon-button:active, .mobile-menu:active { transform: scale(0.97); }
.mobile-menu { display: none; }

.view { display: none; max-width: 1440px; margin: 0 auto; animation: viewIn var(--base) var(--ease-premium); }
.view.is-active { display: block; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 13px; }
.metric-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-top span:first-child { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 15px; }
.metric-card[data-tone="green"] .metric-icon { background: var(--green-soft); color: var(--green); }
.metric-card[data-tone="amber"] .metric-icon { background: var(--amber-soft); color: var(--amber); }
.metric-card[data-tone="red"] .metric-icon { background: var(--red-soft); color: var(--red); }
.metric-value { display: block; margin-top: 14px; font-size: 29px; line-height: 1; letter-spacing: -0.04em; }
.metric-value { min-width: 0; overflow-wrap: anywhere; }
.system-summary .metric-value { font-size: 20px; line-height: 1.15; letter-spacing: -0.025em; }
.metric-caption { display: block; margin-top: 7px; overflow: hidden; color: #97a1ac; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr); gap: 13px; margin-bottom: 13px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 1px 1px rgba(17, 25, 35, 0.01); }
.activity-panel, .quick-panel, .recent-panel, .form-panel, .history-panel { padding: 21px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: -0.025em; }
.live-label { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 720; }
.live-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.chart { display: flex; height: 175px; align-items: end; gap: clamp(3px, 0.55vw, 8px); padding-top: 14px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(33.333% - 1px), #eef1f3 33.333%); }
.chart-bar { flex: 1; min-width: 3px; height: var(--height); border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #6e9dff, #3572ed); opacity: 0.88; transform-origin: bottom; animation: barIn 500ms var(--ease-premium) both; animation-delay: var(--delay); }
.chart-bar:hover { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; padding-top: 8px; color: #9ca5af; font-size: 9px; }
.revenue-grid { align-items: stretch; }
.revenue-chart-panel, .revenue-breakdown-panel, .revenue-table-panel { padding: 21px; }
.revenue-chart {
  position: relative;
  display: flex;
  height: 260px;
  align-items: end;
  gap: clamp(4px, 0.6vw, 9px);
  padding: 22px 8px 0;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(40, 103, 232, .07), transparent 65%),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #edf1f5 25%);
  overflow: hidden;
}
.revenue-line { position: absolute; inset: 18px 8px 0; width: calc(100% - 16px); height: calc(100% - 18px); pointer-events: none; }
.revenue-line polyline { fill: none; stroke: rgba(40,103,232,.62); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.revenue-bar {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 4px;
  height: var(--height);
  border: 0;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #58a2ff, #2867e8 72%, #164fbd);
  box-shadow: 0 8px 20px rgba(40,103,232,.16);
  transform-origin: bottom;
  animation: barIn 520ms var(--ease-premium) both;
  animation-delay: var(--delay);
  cursor: help;
}
.revenue-bar span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  padding: 4px 7px;
  border-radius: 8px;
  background: #111923;
  color: #fff;
  font-size: 9px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
  pointer-events: none;
}
.revenue-bar:hover span, .revenue-bar:focus-visible span { opacity: 1; transform: translate(-50%, 0); }
.revenue-axis { padding-inline: 8px; }
.breakdown-list { display: grid; gap: 10px; }
.breakdown-item { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); animation: viewIn var(--base) var(--ease-premium) both; animation-delay: var(--delay); }
.breakdown-top, .breakdown-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.breakdown-top strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-top span { color: var(--blue); font-size: 10px; font-weight: 800; }
.breakdown-bar { height: 7px; margin: 10px 0 8px; overflow: hidden; border-radius: 999px; background: #e7ecf2; }
.breakdown-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2867e8, #56b2ff); }
.breakdown-meta { color: var(--muted); font-size: 10px; }
.revenue-table { min-width: 680px; }
.revenue-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(130px, 1fr) minmax(120px, .8fr) minmax(150px, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 11px; }
.revenue-row:last-child { border-bottom: 0; }
.revenue-head { background: var(--surface-soft); color: #89949f; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.payment-chip { display: inline-flex; width: max-content; align-items: center; padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 750; }
.payment-chip.is-bonus { background: var(--amber-soft); color: var(--amber); }
.operations-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .75fr); }
.operations-panel { padding: 21px; }
.audit-timeline { display: grid; gap: 9px; max-height: 680px; overflow: auto; padding-right: 3px; }
.audit-timeline.compact { max-height: 520px; }
.audit-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.audit-item.compact { padding: 10px; }
.audit-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #9aa7b5; box-shadow: 0 0 0 4px rgba(154,167,181,.13); }
.audit-item[data-tone="success"] .audit-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(23,157,105,.13); }
.audit-item[data-tone="warning"] .audit-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(180,119,11,.13); }
.audit-item[data-tone="danger"] .audit-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(200,64,81,.13); }
.audit-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.audit-top strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.audit-top span { flex: 0 0 auto; color: #97a1ac; font-size: 9px; }
.audit-item p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.audit-item b { align-self: center; padding: 5px 8px; border-radius: 99px; background: #edf1f4; color: #687582; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.audit-item[data-tone="success"] b { background: var(--green-soft); color: var(--green); }
.audit-item[data-tone="warning"] b { background: var(--amber-soft); color: var(--amber); }
.audit-item[data-tone="danger"] b { background: var(--red-soft); color: var(--red); }
.audit-checks { display: grid; gap: 4px; margin-top: 9px; }
.audit-checks span { padding: 6px 8px; border-radius: 9px; background: #fff; color: #6c7784; font-size: 9px; line-height: 1.3; overflow-wrap: anywhere; }
.attention-list, .compact-list, .broadcast-list { display: grid; gap: 8px; }
.attention-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border-radius: 12px; background: var(--surface-soft); }
.attention-item div { min-width: 0; }
.attention-item strong, .attention-item span { display: block; }
.attention-item strong { margin-bottom: 3px; font-size: 13px; }
.attention-item span { color: var(--muted); font-size: 10px; }
.attention-value { color: var(--amber); font-size: 16px; font-weight: 800; }
.link-button { padding: 5px; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; }
.compact-row { display: grid; grid-template-columns: 36px minmax(130px, 1fr) minmax(130px, 1fr) minmax(110px, 0.7fr) auto; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; transition: background var(--fast) var(--ease); }
.compact-row:hover { background: var(--surface-soft); }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; overflow: hidden; border-radius: 11px; background: var(--avatar, #dbe6f8); color: #315177; font-size: 12px; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.row-primary, .row-secondary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-primary { font-size: 12px; font-weight: 720; }
.row-secondary { margin-top: 3px; color: var(--muted); font-size: 10px; }
.profile-link { color: var(--blue); font-weight: 750; text-decoration: none; }
.profile-link:hover { text-decoration: underline; }
.status-badge { display: inline-flex; width: max-content; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; background: #edf1f4; color: #687582; font-size: 10px; font-weight: 720; }
.status-badge[data-status="active"], .status-badge[data-status="trial"], .status-badge[data-status="online"] { background: var(--green-soft); color: var(--green); }
.status-badge[data-status="pending"] { background: var(--amber-soft); color: var(--amber); }
.status-badge[data-status="blocked"] { background: var(--red-soft); color: var(--red); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.search { display: flex; width: min(100%, 430px); height: 42px; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: #8e99a5; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.segmented { display: flex; overflow-x: auto; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); scrollbar-width: none; }
.segmented button { padding: 8px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 720; white-space: nowrap; cursor: pointer; }
.segmented button.is-active { background: var(--blue-soft); color: var(--blue); }
.users-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 3px 10px; }
.result-summary { color: var(--muted); font-size: 10px; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #cddbf7; border-radius: 14px; background: #f5f8ff; box-shadow: 0 8px 24px rgba(40, 103, 232, 0.07); animation: viewIn var(--base) var(--ease-premium); }
.bulk-bar[hidden] { display: none; }
.bulk-count strong, .bulk-count span { display: block; }
.bulk-count strong { color: #285fca; font-size: 12px; }
.bulk-count span { margin-top: 3px; color: #7a8798; font-size: 9px; }
.bulk-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.bulk-bar.is-busy { opacity: 0.65; pointer-events: none; }
.quiet-link { min-height: 36px; padding: 0 8px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.user-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 11px; }
.user-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: transform var(--base) var(--ease-premium), box-shadow var(--base) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.user-card:hover { border-color: #cfd7e0; box-shadow: 0 12px 32px rgba(26, 39, 55, 0.07); transform: translateY(-2px); }
.user-card.is-selected { border-color: #91b1f4; background: #f8faff; box-shadow: 0 0 0 2px rgba(53, 116, 239, 0.08); }
.user-card-top { display: grid; grid-template-columns: 22px 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.user-select { display: grid; width: 22px; height: 42px; place-items: center; cursor: pointer; }
.user-select input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.user-select span { width: 18px; height: 18px; border: 1.5px solid #c4ced9; border-radius: 6px; background: #fff; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.user-select input:checked + span { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px #fff; }
.user-select input:focus-visible + span { box-shadow: 0 0 0 3px rgba(40, 103, 232, 0.16); }
.user-card .avatar { width: 42px; height: 42px; border-radius: 13px; }
.user-card-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.user-card-body span, .user-card-body strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-body span { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.user-card-body strong { font-size: 11px; }
.empty-block { padding: 34px; color: var(--muted); font-size: 12px; text-align: center; }

.table-panel { overflow: hidden; border-radius: var(--radius-md); }
.connection-table { min-width: 760px; }
.connection-map-panel { margin-bottom: 16px; overflow: hidden; }
.map-count { padding: 5px 9px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 750; }
.map-stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: -4px 0 14px; }
.map-stat { padding: 10px 12px; border: 1px solid rgba(40,103,232,.11); border-radius: 13px; background: linear-gradient(180deg, #f9fbff, #f2f6ff); }
.map-stat span, .map-stat strong { display: block; }
.map-stat span { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.map-stat strong { margin-top: 4px; font-size: 17px; letter-spacing: -.03em; }
.map-shell { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: stretch; }
.connection-map {
  position: relative;
  width: 100%;
  height: clamp(320px, 46vw, 560px);
  min-height: 320px;
  overflow: hidden;
  border-radius: 18px;
  background: #071225;
  box-shadow: inset 0 0 0 1px rgba(109, 154, 240, .2), inset 0 -90px 120px rgba(0,0,0,.18), 0 18px 45px rgba(7,18,37,.14);
  isolation: isolate;
}
.connection-map.leaflet-container { font-family: inherit; background: #071225; }
.connection-map .leaflet-tile { filter: saturate(.84) contrast(1.02) brightness(.93); }
.connection-map .leaflet-control-zoom { overflow: hidden; border: 0; border-radius: 12px; box-shadow: 0 10px 28px rgba(7,18,37,.22); }
.connection-map .leaflet-control-zoom a { width: 34px; height: 34px; border: 0; background: rgba(255,255,255,.94); color: #17202a; font: 700 18px/34px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.connection-map .leaflet-control-zoom a:hover { background: #fff; color: var(--blue); }
.connection-map .leaflet-control-attribution { border-radius: 10px 0 0 0; background: rgba(255,255,255,.9); color: #66717d; font-size: 9px; }
.connection-map .leaflet-control-attribution a { color: var(--blue); }
.connection-map .leaflet-popup-content-wrapper { border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(7,18,37,.95); box-shadow: 0 18px 40px rgba(0,0,0,.28); color: #eaf2ff; }
.connection-map .leaflet-popup-tip { background: rgba(7,18,37,.95); }
.connection-map .leaflet-popup-content { margin: 10px 12px; }
.map-popup { display: grid; gap: 4px; min-width: 150px; }
.map-popup strong { color: #fff; font-size: 12px; }
.map-popup span, .map-popup small { color: #aebbd1; font-size: 10px; }
.connection-map.is-empty .leaflet-pane { filter: grayscale(.15) brightness(.76); }
.map-side-panel { display: flex; min-height: 260px; flex-direction: column; padding: 16px; border: 1px solid rgba(40,103,232,.1); border-radius: 18px; background: linear-gradient(180deg, #fbfcff, #f3f6fb); }
.map-side-panel h3 { margin: 4px 0 12px; font-size: 16px; letter-spacing: -.02em; }
.map-point-list { display: grid; gap: 8px; overflow: auto; padding-right: 2px; }
.map-point-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.map-point-card.online { border-color: #ccebdc; background: #f4fbf7; }
.map-point-card div { min-width: 0; }
.map-point-card strong, .map-point-card span, .map-point-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-point-card strong { font-size: 11px; }
.map-point-card span, .map-point-card small { color: var(--muted); font-size: 9px; }
.map-point-card b { color: var(--blue); font-size: 13px; }
.map-point-card small { grid-column: 1 / -1; }
.compact-empty { padding: 22px 8px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; background: #5f82ba; box-shadow: 0 0 0 3px rgba(95,130,186,.14); }
.map-legend i.online { background: #2fc47c; box-shadow: 0 0 0 3px rgba(47,196,124,.14); }
.map-empty { position: absolute; z-index: 650; inset: 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, rgba(7,18,37,.2), rgba(7,18,37,.58)); color: #d7e6ff; font-size: 12px; text-align: center; pointer-events: none; }
.connection-header, .connection-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(130px, 0.9fr) minmax(140px, 1fr) minmax(150px, 1fr) 90px; gap: 12px; align-items: center; padding: 11px 15px; }
.connection-header { border-bottom: 1px solid var(--line); background: var(--surface-soft); color: #89949f; font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.connection-row { border-bottom: 1px solid #edf0f2; font-size: 11px; }
.connection-row:last-child { border-bottom: 0; }
.connection-row:hover { background: #fafbfc; }

.form-layout { display: grid; grid-template-columns: minmax(400px, 1fr) minmax(300px, 0.72fr); gap: 13px; }
.form-panel label, dialog label, .login-card label { display: grid; gap: 7px; margin-bottom: 15px; }
.form-panel label > span, dialog label > span, .login-card label > span { color: #5f6c79; font-size: 11px; font-weight: 680; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #fff; color: var(--ink); transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
input, select { height: 42px; padding: 0 12px; }
textarea { min-height: 130px; padding: 11px 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #7aa2f2; box-shadow: 0 0 0 3px rgba(40, 103, 232, 0.1); }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.button { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; cursor: pointer; transition: filter var(--fast) var(--ease), transform var(--fast) var(--ease); }
.button.primary { background: linear-gradient(135deg, #3574ef, #2867e8); box-shadow: 0 8px 22px rgba(40, 103, 232, 0.19); color: #fff; }
.button.secondary { border-color: var(--line); background: var(--surface); color: #44515e; }
.button.danger { background: var(--red-soft); color: var(--red); }
.button:hover { filter: brightness(1.04); }
.button:active { transform: translateY(1px); }
.broadcast-item { padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; }
.broadcast-item strong { display: block; margin-bottom: 4px; font-size: 12px; }
.broadcast-item p { display: -webkit-box; overflow: hidden; margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.broadcast-meta { display: flex; justify-content: space-between; color: #929ca6; font-size: 9px; }
.payment-provider-panel, .settings-form { max-width: 760px; }
.payment-provider-panel { margin-bottom: 13px; padding: 21px; }
.provider-current { padding: 6px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 800; }
.provider-description { max-width: 610px; margin: -3px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.provider-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.provider-option { display: grid; min-width: 0; grid-template-columns: 38px minmax(0, 1fr) 16px; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease); }
.provider-option:hover:not(:disabled) { border-color: #bdb8f5; box-shadow: 0 8px 22px rgba(67,61,151,.08); transform: translateY(-1px); }
.provider-option.is-active { border-color: #8780ec; background: #f7f6ff; box-shadow: 0 0 0 3px rgba(108,99,243,.08); }
.provider-option:disabled { cursor: not-allowed; opacity: .52; }
.provider-option > span:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.provider-option strong { font-size: 12px; }
.provider-option small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.provider-option i { width: 15px; height: 15px; border: 1px solid #cfd3dc; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px #fff; }
.provider-option.is-active i { border-color: #6c63e9; background: #6c63e9; }
.provider-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; font-size: 13px; font-weight: 900; }
.provider-mark.yookassa { background: #211f20; color: #fff; }
.provider-mark.lava { background: #ff533d; color: #fff; }
.provider-option.hybrid { grid-column: 1 / -1; }
.provider-mark.hybrid { background: linear-gradient(135deg, #211f20 0 48%, #ff533d 52% 100%); color: #fff; }
.provider-methods { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 9px; }
.provider-methods b { padding: 5px 8px; border-radius: 7px; background: var(--surface-soft); color: #4b5260; font-size: 9px; }
.form-actions { display: flex; justify-content: flex-end; }

@media (max-width: 650px) {
  .provider-switch { grid-template-columns: 1fr; }
}

.scrim { position: fixed; z-index: 40; inset: 0; background: rgba(15, 23, 32, 0.32); opacity: 0; backdrop-filter: blur(2px); transition: opacity var(--base) var(--ease); }
.scrim.is-visible { opacity: 1; }
.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(100%, 480px); padding: 23px; overflow-y: auto; background: var(--surface); box-shadow: -24px 0 70px rgba(22, 31, 42, 0.15); transform: translateX(102%); transition: transform var(--slow) var(--ease-premium); }
.drawer.is-open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.drawer-header h2 { margin: 4px 0 0; font-size: 22px; }
.drawer-profile { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 13px; align-items: center; padding: 15px; border-radius: 16px; background: var(--surface-soft); }
.drawer-profile .avatar { width: 54px; height: 54px; border-radius: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 17px 0; }
.detail-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.detail-card span, .detail-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-card span { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.detail-card strong { font-size: 11px; }
.drawer-section { margin-top: 20px; }
.drawer-section h3 { margin: 0 0 9px; font-size: 12px; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.device-row:last-child { border-bottom: 0; }
.device-row div { min-width: 0; }
.device-row strong, .device-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-row strong { font-size: 11px; }
.device-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.drawer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.drawer-actions .full { grid-column: 1 / -1; }
.device-remove { flex: 0 0 auto; min-height: 32px; padding: 0 10px; border: 1px solid #f0c7c7; border-radius: 9px; background: #fff7f7; color: #a63b3b; font-family: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
.button.compact { min-height: 38px; padding: 0 14px; white-space: nowrap; }
.system-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.system-list { display: grid; gap: 8px; }
.backup-panel { margin-bottom: 13px; padding: 21px; }
.backup-panel .panel-heading { margin-bottom: 10px; }
.backup-intro { max-width: 760px; margin: 0 0 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.backup-overall { padding: 6px 9px; border-radius: 8px; background: #edf1f4; color: var(--muted); font-size: 10px; font-weight: 760; }
.backup-overall[data-status="ok"] { background: var(--green-soft); color: var(--green); }
.backup-overall[data-status="warning"] { background: var(--amber-soft); color: var(--amber); }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.backup-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.backup-card[data-status="ok"] { border-color: rgba(23, 157, 105, .24); background: rgba(23, 157, 105, .045); }
.backup-card[data-status="warning"], .backup-card[data-status="stale"], .backup-card[data-status="missing"] { border-color: rgba(180, 119, 11, .24); background: rgba(180, 119, 11, .045); }
.backup-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.backup-card-head div { min-width: 0; }
.backup-card-head small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.backup-card-head h3 { margin: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.backup-card-head > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 9px; font-weight: 760; }
.backup-card[data-status="ok"] .backup-card-head > span { background: var(--green-soft); color: var(--green); }
.backup-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 14px 0 12px; }
.backup-meta div { min-width: 0; padding: 8px; border-radius: 10px; background: var(--surface); }
.backup-meta dt, .backup-meta dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-meta dt { margin-bottom: 4px; color: var(--muted); font-size: 8px; }
.backup-meta dd { margin: 0; font-size: 10px; font-weight: 720; }
.backup-checks { display: grid; gap: 6px; }
.backup-checks span { position: relative; min-height: 26px; padding: 7px 8px 7px 27px; border-radius: 9px; background: rgba(255, 255, 255, .72); color: var(--muted); font-size: 9px; line-height: 1.35; }
.backup-checks span::before { position: absolute; top: 8px; left: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); content: ""; }
.backup-checks span[data-ok="true"]::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.backup-security-note { margin: 14px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.5; }
.system-nodes-panel { margin-bottom: 13px; }
.vpn-node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.vpn-node-card { padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.vpn-node-card[data-status="online"] { border-color: rgba(55, 202, 139, .3); background: rgba(55, 202, 139, .055); }
.vpn-node-card[data-status="offline"] { border-color: rgba(225, 82, 82, .25); background: rgba(225, 82, 82, .045); }
.vpn-node-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.vpn-node-head > span { font-size: 25px; }
.vpn-node-head div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.vpn-node-head strong { font-size: 13px; }
.vpn-node-head small { color: var(--muted); font-size: 10px; }
.vpn-node-head b { padding: 5px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 9px; }
.vpn-node-card[data-status="online"] .vpn-node-head b { background: rgba(55, 202, 139, .12); color: #18845a; }
.vpn-node-card[data-status="offline"] .vpn-node-head b { background: rgba(225, 82, 82, .1); color: #b83f3f; }
.vpn-node-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.vpn-node-meta span { min-width: 0; padding: 8px; border-radius: 10px; background: var(--surface); }
.vpn-node-meta small, .vpn-node-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpn-node-meta small { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.vpn-node-meta strong { font-size: 10px; }
.system-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.system-item:last-child { border-bottom: 0; }
.system-item strong, .system-item small { display: block; }
.system-item strong { font-size: 11px; }
.system-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.system-item b { color: var(--muted); font-size: 9px; }
.system-dot { width: 8px; height: 8px; border-radius: 50%; background: #d75a5a; box-shadow: 0 0 0 4px #fbeaea; }
.system-dot.ok { background: #36a269; box-shadow: 0 0 0 4px #e7f6ed; }
.system-logs { margin-top: 16px; }
.system-logs pre { max-height: 340px; overflow: auto; margin: 0; padding: 14px; border-radius: 12px; background: #111820; color: #d7e1eb; font: 10px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

dialog { width: min(calc(100% - 32px), 420px); padding: 0; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 90px rgba(15, 23, 32, 0.22); }
dialog::backdrop { background: rgba(15, 23, 32, 0.34); backdrop-filter: blur(2px); }
dialog form { padding: 23px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 21px; }

.toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; max-width: 380px; padding: 12px 15px; border: 1px solid #cdebdc; border-radius: 12px; background: #f1fbf6; box-shadow: var(--shadow); color: #187a55; font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--base) var(--ease), transform var(--base) var(--ease-premium); }
.toast[data-tone="error"] { border-color: #f1cbd1; background: #fff4f5; color: var(--red); }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes barIn { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 0.88; } }

@media (max-width: 1120px) { .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .user-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); } }
@media (max-width: 880px) {
  .sidebar { z-index: 60; width: min(82vw, 300px); padding-top: max(20px, env(safe-area-inset-top)); transform: translateX(-102%); box-shadow: none; transition: transform var(--slow) var(--ease-premium), box-shadow var(--slow) var(--ease); will-change: transform; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 24px 0 70px rgba(4, 10, 18, 0.28); }
  .sidebar-close { display: grid; }
  .sidebar nav { gap: 7px; }
  .nav-item { min-height: 48px; color: #b8c3d0; font-size: 14px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  html.nav-open { overflow: hidden; }
  .content { margin-left: 0; padding: 22px 18px 50px; }
  .mobile-menu { display: grid; }
  .content-header > div:first-of-type { margin-right: auto; }
  .dashboard-grid, .form-layout, .operations-grid { grid-template-columns: 1fr; }
  .map-shell { grid-template-columns: 1fr; }
  .map-side-panel { min-height: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .system-summary { grid-template-columns: 1fr 1fr; }
  .backup-grid { grid-template-columns: 1fr; }
  .vpn-node-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .content-header h1 { font-size: 26px; }
  .updated-at { display: none; }
  .metrics-grid, .user-grid, .two-fields { grid-template-columns: 1fr; }
  .users-summary-row { align-items: flex-start; }
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-buttons .quiet-link { grid-column: 1 / -1; }
  .compact-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .compact-row > :nth-child(3), .compact-row > :nth-child(4) { display: none; }
  .table-panel { overflow-x: auto; }
  .map-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .revenue-chart { height: 220px; }
  .connection-map { height: 300px; min-height: 240px; }
  .drawer { padding: 19px; }
  .drawer-actions { grid-template-columns: 1fr; }
  .drawer-actions .full { grid-column: auto; }
  .backup-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { right: 16px; bottom: 16px; left: 16px; }
  .audit-item { grid-template-columns: 12px minmax(0, 1fr); }
  .audit-item b { grid-column: 2; width: max-content; }
  .audit-top { align-items: flex-start; flex-direction: column; gap: 3px; }
  .vpn-node-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } }

/* 2026 dashboard refresh — adapted from the referenced ByEWind UI kit. */
:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #181b25;
  --muted: #7c8192;
  --line: #eceef4;
  --blue: #6c63f3;
  --blue-soft: #efedff;
  --green: #1fa878;
  --green-soft: #eaf8f2;
  --amber: #c9831f;
  --amber-soft: #fff4dc;
  --red: #db5c6e;
  --red-soft: #fff0f2;
  --sidebar: #ffffff;
  --sidebar-muted: #777d8d;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 16px 40px rgba(37, 39, 55, 0.07);
}

body { background: var(--bg); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(108, 99, 243, .2); outline-offset: 2px; }

.admin-shell { background: var(--bg); }
.sidebar {
  width: 232px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.sidebar-brand { gap: 11px; padding: 0 8px 26px; }
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #171923;
  box-shadow: 0 7px 16px rgba(20, 22, 31, .15);
  font-size: 15px;
}
.sidebar-brand strong { color: #171923; font-size: 15px; letter-spacing: -.02em; }
.sidebar-brand div span { color: #a2a6b1; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar nav::before {
  content: "Рабочее пространство";
  padding: 0 12px 8px;
  color: #b2b5bf;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.sidebar nav { gap: 4px; }
.nav-item {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  color: #797e8e;
  font-size: 11px;
  font-weight: 650;
}
.nav-item:hover { background: #f6f6fa; color: #252834; }
.nav-item.is-active { background: #efedff; color: #5d54df; }
.nav-icon { display: grid; color: currentColor; place-items: center; }
.nav-icon svg, .icon-button svg, .global-search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item.is-active .nav-icon { color: #6259e8; }
.nav-count { min-width: 21px; background: #f0f1f5; color: #777c89; }
.nav-item.is-active .nav-count { background: #fff; color: #5d54df; }
.sidebar-footer { gap: 12px; padding: 15px 8px 0; border-color: var(--line); }
.server-indicator > span { width: 7px; height: 7px; background: #2eb982; box-shadow: 0 0 0 4px rgba(46,185,130,.1); }
.server-indicator strong { color: #333642; font-size: 11px; }
.server-indicator small, .quiet-button { color: #a0a4b0; }
.quiet-button { transition: color var(--fast) var(--ease); }
.quiet-button:hover { color: var(--red); }
.sidebar-close { border-color: var(--line); background: #f6f7fa; color: #454956; }

.content { margin-left: 232px; padding: 0 clamp(22px, 3.4vw, 48px) 56px; }
.content-header {
  position: sticky;
  z-index: 20;
  top: 0;
  max-width: none;
  min-height: 78px;
  margin: 0 calc(clamp(22px, 3.4vw, 48px) * -1) 27px;
  padding: 13px clamp(22px, 3.4vw, 48px);
  border-bottom: 1px solid rgba(232,234,241,.88);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px);
}
.page-heading { flex: 0 0 auto; }
.content-header h1 { margin-top: 3px; font-size: 24px; font-weight: 760; letter-spacing: -.045em; }
.eyebrow { color: #a0a4b0; font-size: 8px; letter-spacing: .13em; }
.global-search {
  display: flex;
  width: min(35vw, 400px);
  height: 38px;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 0 10px 0 12px;
  border: 1px solid #e7e9ef;
  border-radius: 10px;
  background: #f8f9fb;
  color: #9ba0ad;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.global-search:focus-within { border-color: #aaa4f7; background: #fff; box-shadow: 0 0 0 3px rgba(108,99,243,.08); }
.global-search input { height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 11px; }
.global-search input:focus { border: 0; box-shadow: none; }
.global-search kbd { margin-left: auto; padding: 3px 6px; border: 1px solid #e2e4ea; border-radius: 5px; background: #fff; color: #9b9faa; font: 8px/1.2 Inter, sans-serif; white-space: nowrap; }
.header-actions { gap: 8px; }
.updated-at { font-size: 9px; }
.icon-button, .mobile-menu { width: 36px; height: 36px; border-color: #e7e9ef; border-radius: 10px; color: #777c8a; box-shadow: 0 1px 2px rgba(22,25,35,.02); }
.operator-chip { display: flex; align-items: center; gap: 8px; margin-left: 2px; padding-left: 9px; border-left: 1px solid var(--line); }
.operator-chip > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: #f0efff; color: #6259e8; font-size: 11px; font-weight: 850; }
.operator-chip div { display: flex; flex-direction: column; }
.operator-chip strong { font-size: 10px; }
.operator-chip small { margin-top: 2px; color: #a1a5b0; font-size: 8px; }

.view { max-width: 1480px; }
.metrics-grid { gap: 11px; margin-bottom: 14px; }
.metric-card {
  position: relative;
  min-height: 122px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #eceef4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(35,37,52,.025);
}
.metric-card:nth-child(4n + 1) { border-color: #e4e1ff; background: linear-gradient(145deg, #f8f7ff, #fff 64%); }
.metric-card:nth-child(4n + 2) { border-color: #dcefed; background: linear-gradient(145deg, #f1fbf9, #fff 64%); }
.metric-card:nth-child(4n + 3) { border-color: #f2e8cf; background: linear-gradient(145deg, #fff9ec, #fff 64%); }
.metric-card:nth-child(4n + 4) { border-color: #e1ebf7; background: linear-gradient(145deg, #f3f8ff, #fff 64%); }
.metric-top span:first-child { color: #737888; font-size: 10px; }
.metric-icon { width: 29px; height: 29px; border-radius: 9px; background: rgba(108,99,243,.1); color: #665de8; }
.metric-value { margin-top: 13px; font-size: 27px; font-weight: 770; }
.metric-caption { margin-top: 8px; color: #a2a6b1; font-size: 9px; }
.system-summary .metric-card { min-height: 106px; }

.dashboard-grid { grid-template-columns: minmax(0, 1.7fr) minmax(270px, .72fr); gap: 14px; margin-bottom: 14px; }
.panel { border-color: #e9ebf1; border-radius: 16px; box-shadow: 0 4px 18px rgba(35,37,52,.025); }
.activity-panel, .quick-panel, .recent-panel, .form-panel, .history-panel,
.revenue-chart-panel, .revenue-breakdown-panel, .revenue-table-panel, .operations-panel { padding: 19px; }
.panel-heading { margin-bottom: 16px; }
.panel-heading h2 { font-size: 16px; font-weight: 740; letter-spacing: -.025em; }
.live-label { padding: 5px 8px; border-radius: 999px; background: #edf9f4; font-size: 9px; }
.chart { height: 188px; gap: clamp(4px,.5vw,8px); border-color: #eceef3; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(33.333% - 1px), #f0f1f5 33.333%); }
.chart-bar { border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #a8a2ff, #7067ed); }
.attention-item { border: 1px solid #eff0f4; border-radius: 11px; background: #fafbfc; }
.attention-item strong { font-size: 11px; }
.attention-value { color: #c47b25; font-size: 14px; }
.compact-row { border-bottom: 1px solid #f0f1f4; border-radius: 0; }
.compact-row:last-child { border-bottom: 0; }
.compact-row:hover { background: #fafaff; }
.avatar { border-radius: 50%; }
.status-badge, .payment-chip, .map-count { border-radius: 7px; }
.link-button { color: #6259e8; }

.toolbar { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.search, .segmented { border-color: #e8eaf0; background: #f9fafc; }
.segmented button.is-active { background: #fff; color: #5e55df; box-shadow: 0 1px 4px rgba(38,40,55,.08); }
.user-grid { gap: 12px; }
.user-card { border-color: #e9ebf1; box-shadow: 0 3px 12px rgba(35,37,52,.025); }
.user-card:hover { border-color: #cfcaf9; box-shadow: 0 14px 32px rgba(69,63,150,.08); }
.breakdown-item, .audit-item, .vpn-node-card { border-color: #eceef3; background: #fafbfc; }
.button { border-radius: 9px; }
.button.primary { background: #6860e8; box-shadow: 0 8px 20px rgba(104,96,232,.18); }
.button.primary:hover { background: #5e56de; }
input:focus, textarea:focus, select:focus { border-color: #9e98ef; box-shadow: 0 0 0 3px rgba(108,99,243,.09); }
.drawer { border-left: 1px solid var(--line); box-shadow: -22px 0 60px rgba(28,30,43,.1); }
.system-logs pre { background: #191b25; }

@media (max-width: 1180px) {
  .global-search { width: min(30vw, 310px); }
  .operator-chip div { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .sidebar { width: min(82vw, 286px); }
  .content { margin-left: 0; padding: 0 18px 50px; }
  .content-header { margin-inline: -18px; padding-inline: 18px; }
  .content-header .page-heading { margin-right: 0; }
  .global-search { width: min(36vw, 280px); margin-left: auto; }
  .operator-chip { display: none; }
  .dashboard-grid, .form-layout, .operations-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .content-header { min-height: 68px; gap: 10px; }
  .page-heading .eyebrow, .updated-at, .global-search kbd { display: none; }
  .content-header h1 { margin: 0; font-size: 21px; }
  .global-search { display: none; }
  .header-actions { margin-left: auto; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 108px; }
}

/* Operations workspace: quick actions, support inbox and IP tools. */
.nav-count.is-alert { background: #fff0f2; color: #cf5266; }
.nav-item.is-active .nav-count.is-alert { background: #fff; color: #cf5266; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.quick-actions button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e9eaf0;
  border-radius: 13px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.quick-actions button:hover { transform: translateY(-1px); border-color: #cdc9f7; box-shadow: 0 10px 24px rgba(57,52,133,.07); }
.quick-actions button > span { display: grid; grid-row: 1 / 3; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #f0efff; color: #635ae6; font-size: 15px; }
.quick-actions strong { overflow: hidden; align-self: end; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quick-actions small { overflow: hidden; align-self: start; color: #a0a4af; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.support-toolbar { align-items: center; }
.support-summary { display: flex; align-items: center; gap: 9px; color: #9b9fac; font-size: 9px; }
.support-summary strong { color: #484c58; font-size: 10px; }
.support-layout {
  display: grid;
  grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  min-height: min(720px, calc(100vh - 178px));
  gap: 14px;
}
.ticket-list-panel, .ticket-conversation { min-height: 0; overflow: hidden; }
.ticket-list { height: 100%; max-height: min(720px, calc(100vh - 178px)); overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.ticket-list-item {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.ticket-list-item + .ticket-list-item { margin-top: 2px; }
.ticket-list-item:hover { background: #f8f8fc; }
.ticket-list-item.is-active { border-color: #dfdcfb; background: #f3f2ff; }
.ticket-list-item.needs-reply:not(.is-active) { background: #fffafb; }
.ticket-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #eceaff; color: #635ae6; font-size: 11px; font-weight: 800; }
.ticket-list-item.needs-reply .ticket-avatar { background: #fff0f2; color: #cd5367; }
.ticket-list-copy { display: grid; min-width: 0; gap: 5px; }
.ticket-list-copy > span:first-child, .ticket-meta { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.ticket-list-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ticket-list-copy time { flex: 0 0 auto; color: #a6a9b2; font-size: 8px; }
.ticket-preview { overflow: hidden; color: #7f8491; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.ticket-meta b { color: #2f9b72; font-size: 8px; }
.needs-reply .ticket-meta b { color: #cf586b; }
.ticket-meta i { color: #b3b6bf; font-size: 8px; font-style: normal; }
.ticket-empty { margin: 12px; }

.ticket-conversation { display: grid; grid-template-rows: auto minmax(240px, 1fr) auto; }
.ticket-header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.ticket-header h2 { margin: 4px 0 2px; font-size: 15px; }
.ticket-header h2 a { color: inherit; text-decoration: none; }
.ticket-header h2 a:hover { color: #635ae6; }
.ticket-header > div > span { color: #9095a1; font-size: 9px; }
.ticket-messages { display: flex; min-height: 0; flex-direction: column; gap: 8px; overflow-y: auto; padding: 18px; background: linear-gradient(180deg, #fafbfe, #f7f8fc); scrollbar-width: thin; }
.ticket-message { width: fit-content; max-width: min(76%, 640px); padding: 10px 12px; border: 1px solid #e8eaf0; border-radius: 13px 13px 13px 4px; background: #fff; box-shadow: 0 3px 10px rgba(35,37,52,.025); }
.ticket-message.from-operator { align-self: flex-end; border-color: #dedafb; border-radius: 13px 13px 4px 13px; background: #efedff; }
.ticket-message > span { display: block; margin-bottom: 4px; color: #7a70e6; font-size: 8px; font-weight: 800; }
.ticket-message.from-user > span { color: #68707f; }
.ticket-message p { margin: 0; color: #333744; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.ticket-message time { display: block; margin-top: 5px; color: #a2a6b0; font-size: 8px; text-align: right; }
.ticket-reply { padding: 13px 15px 14px; border-top: 1px solid var(--line); background: #fff; }
.ticket-reply > label { display: block; margin-bottom: 7px; color: #626774; font-size: 9px; font-weight: 750; }
.ticket-reply textarea { min-height: 68px; resize: vertical; }
.ticket-reply > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.ticket-reply > div > span { color: #a5a9b2; font-size: 8px; }

.connection-ip { display: flex; min-width: 0; align-items: center; gap: 7px; }
.connection-ip > span { min-width: 0; }
.connection-ip button { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border: 1px solid #e6e8ee; border-radius: 7px; background: #fff; color: #858a96; cursor: pointer; }
.connection-ip button:hover { border-color: #c9c5f5; color: #6259e8; }
.map-legend a { margin-left: auto; color: #8d92a0; font-size: 8px; text-decoration: none; }
.map-legend a:hover { color: #6259e8; text-decoration: underline; }

@media (max-width: 1180px) {
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .support-layout { grid-template-columns: 1fr; min-height: auto; }
  .ticket-list { max-height: 280px; }
  .ticket-conversation { min-height: 560px; }
}
@media (max-width: 650px) {
  .quick-actions { grid-template-columns: 1fr; }
  .support-toolbar { align-items: stretch; flex-direction: column; }
  .support-summary { justify-content: space-between; }
  #connectionFilters { width: 100%; }
  #connectionFilters button { flex: 1; }
  .ticket-conversation { min-height: 520px; }
  .ticket-header { align-items: flex-start; padding: 13px; }
  .ticket-message { max-width: 88%; }
  .ticket-messages { padding: 12px; }
  .ticket-reply > div > span { display: none; }
  .ticket-reply > div { justify-content: flex-end; }
  .map-legend { flex-wrap: wrap; }
  .map-legend a { width: 100%; margin-left: 0; }
}
