@charset "UTF-8";

:root {
  --canvas: #f5f7f9;
  --surface: #ffffff;
  --ink: #1c3039;
  --muted: #79868e;
  --subtle: #52646d;
  --line: #e7ecef;
  --teal: #168679;
  --teal-dark: #106e63;
  --teal-soft: #edf8f5;
  --navy: #112a35;
  --red: #c54748;
  --red-soft: #fff1f0;
  --amber: #a87927;
  --amber-soft: #fff7e8;
  --blue: #557db3;
  --blue-soft: #edf3fc;
  --radius: 12px;
  --shadow: 0 4px 22px rgba(25, 48, 58, .035);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, h4 { line-height: 1.4; }
svg { display: inline-block; vertical-align: middle; }
code, pre, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", monospace; }
code { font-size: .9em; }
button { border: 0; }
[hidden] { display: none !important; }
::selection { background: #c8ebe3; color: #123c34; }
:focus-visible { outline: 3px solid #5baea0; outline-offset: 3px; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 10px 20px; color: white; background: var(--teal); border-radius: 6px; }
.skip-link:focus { top: 12px; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--subtle); font-size: 13px; font-weight: 500; line-height: 1.5; transition: background .16s, border-color .16s, box-shadow .16s; white-space: nowrap; }
.button:hover:not(:disabled) { border-color: #b9cbc9; background: #f7faf9; color: var(--ink); }
.button.primary { color: white; border-color: var(--teal); background: var(--teal); box-shadow: 0 3px 7px #16867912; }
.button.primary:hover:not(:disabled) { background: var(--teal-dark); border-color: var(--teal-dark); }
.button.danger { color: white; background: var(--red); border-color: var(--red); }
.button.danger:hover:not(:disabled) { color: white; background: #ac3839; border-color: #ac3839; }
.button.small { min-height: 31px; padding: 5px 10px; font-size: 12px; }
.button .icon { width: 16px; height: 16px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 500; }
.text-button:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 4px; }
.text-button .icon { width: 14px; height: 14px; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; width: 33px; height: 33px; flex-shrink: 0; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 6px; }
.icon-button:hover:not(:disabled) { color: var(--teal); border-color: #d5e6e0; background: var(--teal-soft); }
.icon-button.danger:hover:not(:disabled) { color: var(--red); background: var(--red-soft); border-color: #f4d8d4; }
.icon-button .icon { width: 16px; height: 16px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-up { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.break-word { overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: var(--subtle); }
.boot-screen .brand-mark { width: 54px; height: 54px; }
.boot-screen .spinner { color: var(--teal); }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 232px; display: flex; flex-direction: column; padding: 30px 18px 18px; color: #b3c1c9; background: var(--navy); overflow-y: auto; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: #f5fafa; }
.brand-mark { display: flex; justify-content: center; align-items: center; width: 39px; height: 43px; flex-shrink: 0; color: #a7e4d8; border: 1px solid #72baab45; border-radius: 11px; background: linear-gradient(145deg, #27776a, #174d48); box-shadow: inset 0 1px 0 #ffffff1a; }
.brand-mark .icon { width: 29px; height: 29px; stroke-width: 1.3; }
.brand-name { display: block; font-size: 23px; font-weight: 650; letter-spacing: 1px; line-height: 1.3; }
.brand-name > span { font-size: 14px; letter-spacing: -.2px; font-weight: 500; }
.brand-name small { display: block; margin-top: 7px; color: #8299a3; font-size: 10px; font-weight: 400; letter-spacing: 1.4px; }
.workspace-label { margin: 34px 1px 25px; padding: 12px 10px; display: flex; align-items: center; gap: 10px; border: 1px solid #ffffff0d; border-radius: 8px; background: #ffffff03; }
.workspace-avatar { display: grid; place-items: center; width: 30px; height: 32px; border-radius: 5px; background: #ffffff0a; color: #c0d5d9; font-size: 13px; }
.workspace-label strong { display: block; font-size: 12px; font-weight: 500; color: #d0dce1; }
.workspace-label small { display: block; font-size: 10px; color: #7a929e; }
.workspace-label > .icon { width: 13px; height: 13px; margin-left: auto; color: #657d89; }
.nav-section-label { margin: 0 12px 10px; color: #708792; font-size: 10px; letter-spacing: 1.5px; }
.navigation { display: flex; flex-direction: column; gap: 5px; }
.navigation a { position: relative; min-height: 44px; display: flex; align-items: center; gap: 13px; padding: 11px 15px; border-radius: 6px; color: #a1b5be; font-size: 13px; transition: background .15s, color .15s; }
.navigation a .icon { width: 18px; height: 18px; }
.navigation a:hover { color: white; background: #ffffff06; }
.navigation a[aria-current="page"] { color: #d7f3eb; background: #23433f; }
.navigation a[aria-current="page"]::after { content: ""; position: absolute; right: 14px; width: 5px; height: 5px; border-radius: 50%; background: #7ad6b9; }
.navigation a[aria-current="page"] .icon { color: #7ad6b9; }
.sidebar-bottom { margin-top: auto; padding-top: 42px; }
.sidebar-note { margin: 0 6px 22px; padding: 16px 14px; border: 1px solid #7397981c; border-radius: 8px; background: linear-gradient(140deg, #1b3a40, #15313a); }
.sidebar-note > .icon { width: 18px; height: 18px; margin-right: 5px; color: #72b6a6; }
.sidebar-note strong { font-size: 12px; font-weight: 500; color: #c4d9d7; }
.sidebar-note p { margin-top: 10px; font-size: 11px; line-height: 1.9; color: #8ca9ad; }
.sidebar-note a { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-top: 11px; border-top: 1px solid #ffffff08; font-size: 10px; color: #a7d0c7; }
.sidebar-note a .icon { width: 13px; height: 13px; }
.logout-button { display: flex; align-items: center; gap: 11px; width: 100%; color: #8da3af; background: transparent; padding: 10px 16px; border-radius: 6px; font-size: 12px; }
.logout-button:hover { background: #ffffff06; color: #f4f8fa; }
.logout-button .icon { width: 17px; height: 17px; }
.sidebar-footnote { display: flex; justify-content: space-between; margin: 19px 6px 0; padding-top: 14px; border-top: 1px solid #ffffff08; font-size: 9px; color: #58747f; }
.workspace { margin-left: 232px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 72px; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fff; }
.breadcrumb { display: flex; align-items: center; gap: 15px; font-size: 12px; }
.breadcrumb-root { color: var(--muted); }
.breadcrumb-arrow { width: 11px; height: 11px; color: #b3bdc3; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.help-link { display: inline-flex; gap: 7px; align-items: center; color: #7c8992; font-size: 11px; }
.help-link:hover { color: var(--teal); }
.help-link .icon { width: 15px; height: 15px; }
.topbar-divider { width: 1px; height: 22px; background: var(--line); }
.account { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.account-avatar { width: 30px; height: 30px; display: grid; place-items: center; background: #edf1f3; color: #607482; border: 1px solid #e2e8ec; border-radius: 50%; font-size: 11px; }
.account-role { color: #94a0a7; font-size: 10px; }
.main-content { flex: 1; width: 100%; max-width: 1580px; margin: 0 auto; padding: 31px 36px 36px; outline: none; }
.main-content > * { animation: fade-up .25s ease both; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 19px 36px; border-top: 1px solid var(--line); color: #9aa6ad; font-size: 10px; }
.footer-dot { margin: 0 6px; }
.nav-toggle, .nav-close { display: none; }
.nav-backdrop { position: fixed; inset: 0; z-index: 39; background: #0b233f66; backdrop-filter: blur(2px); }

/* Common page elements */
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { color: #243943; font-size: 25px; font-weight: 650; letter-spacing: -.7px; }
.page-heading p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.page-date { display: flex; align-items: center; gap: 7px; margin-right: 4px; color: #85929a; font-size: 11px; }
.page-date .icon { width: 14px; height: 14px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 22px; border-bottom: 1px solid #edf1f3; }
.panel-header h2, .panel-header h3 { font-size: 14px; font-weight: 600; letter-spacing: .1px; }
.panel-header p { margin-top: 4px; font-size: 11px; color: var(--muted); }
.panel-body { padding: 22px; }
.panel-heading-icon { display: flex; align-items: center; gap: 8px; }
.panel-heading-icon > .icon { width: 17px; height: 17px; color: var(--teal); }
.count-label { margin-left: 7px; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 1px 6px; color: #8a969e; background: #f2f5f6; border-radius: 4px; font-size: 10px; font-weight: 500; vertical-align: middle; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid transparent; border-radius: 4px; font-size: 10px; line-height: 1.5; font-weight: 500; white-space: nowrap; }
.badge.teal { color: var(--teal); background: var(--teal-soft); border-color: #dcefe9; }
.badge.blue { color: var(--blue); background: var(--blue-soft); border-color: #e0e9f6; }
.badge.amber { color: var(--amber); background: var(--amber-soft); border-color: #f6ead0; }
.badge.red { color: var(--red); background: var(--red-soft); border-color: #f6dfdc; }
.badge.gray { color: #829099; background: #f2f5f7; border-color: #e7ecef; }
.status-dot { width: 5px; height: 5px; display: inline-block; border-radius: 50%; background: currentColor; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 22px; padding: 13px 16px; border: 1px solid #dcece8; border-radius: 8px; background: #f1f9f6; color: #548477; font-size: 12px; line-height: 1.8; }
.notice > .icon { width: 17px; height: 17px; margin-top: 3px; }
.notice strong { font-weight: 600; color: #326c5c; }
.notice.neutral { background: #f5f8fa; border-color: #e4ebef; color: #71838e; }
.notice.warning { background: var(--amber-soft); border-color: #f3e7ce; color: #936e31; }
.notice.warning strong { color: #936e31; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; justify-content: space-between; padding: 17px 21px; }
.search-field { position: relative; width: 260px; }
.search-field .icon { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: #99a5ab; }
.search-field input { padding-left: 35px; min-height: 37px; font-size: 12px; background: #fbfcfd; }
.toolbar-info { color: var(--muted); font-size: 11px; }
.section-gap { margin-top: 22px; }
.inline-message { padding: 11px 14px; margin-bottom: 18px; border: 1px solid #f3d9d5; border-radius: 7px; background: var(--red-soft); color: #aa4546; font-size: 12px; white-space: pre-line; overflow-wrap: anywhere; }
.inline-message.success { background: var(--teal-soft); border-color: #d8eae4; color: var(--teal-dark); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 24px; text-align: center; }
.empty-state .empty-icon { width: 55px; height: 55px; margin-bottom: 18px; display: grid; place-items: center; color: #9aaeb7; background: #f1f5f7; border: 1px solid #e9eef1; border-radius: 14px; }
.empty-state .empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.empty-state p { max-width: 420px; color: var(--muted); font-size: 12px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
.empty-state .button { margin-top: 19px; }
.loading-state { padding: 65px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; color: #87959c; font-size: 12px; }
.loading-state .spinner { width: 25px; height: 25px; color: var(--teal); }
.error-state .empty-icon { color: #b27d51; background: #fff6ed; border-color: #f6eadd; }
.refresh-caption { color: #97a3a9; font-size: 10px; }

/* Overview */
.welcome-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; margin-bottom: 24px; padding: 22px 25px; border: 1px solid #dceae5; border-radius: 10px; background: linear-gradient(105deg, #edf7f2, #f5faf6 65%, #edf5f1); }
.welcome-banner::after { content: ""; position: absolute; width: 280px; height: 280px; right: -10px; top: -102px; border: 1px solid #c4ded854; border-radius: 50%; box-shadow: 0 0 0 31px #d1e6df22, 0 0 0 63px #c9e0d51c; pointer-events: none; }
.welcome-icon { display: grid; place-items: center; width: 47px; height: 49px; flex-shrink: 0; background: #e0f0e8; border: 1px solid #cce3d7; border-radius: 13px; color: #5c9478; transform: rotate(-3deg); }
.welcome-icon .icon { width: 26px; height: 26px; }
.welcome-banner h2 { font-size: 16px; font-weight: 600; color: #355a4b; }
.welcome-banner p { margin-top: 5px; font-size: 11px; color: #7c9787; }
.welcome-banner > .button { margin-left: auto; z-index: 1; color: #517e68; border-color: #c9e0d3; background: #ffffff70; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 23px; }
.metric-card { padding: 19px 20px 16px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #75848c; font-size: 12px; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: var(--teal-soft); color: #6da592; }
.metric-icon .icon { width: 17px; height: 17px; }
.metric-card.blue .metric-icon { background: #edf3fb; color: #7697bf; }
.metric-card.amber .metric-icon { background: #fff7e9; color: #c8a263; }
.metric-card.purple .metric-icon { background: #f3f0fa; color: #a393bf; }
.metric-value { display: flex; align-items: baseline; gap: 5px; margin: 6px 0 12px; color: #273d48; font-size: 32px; font-weight: 600; letter-spacing: -.9px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.metric-value small { font-size: 12px; font-weight: 400; letter-spacing: 0; color: #91a0a7; margin-left: 2px; }
.metric-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; padding-top: 12px; border-top: 1px solid #f0f3f5; font-size: 10px; color: #96a2a9; }
.metric-foot > span:first-child { color: #6b9b86; }
.overview-middle { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(270px, 1fr); gap: 22px; margin-bottom: 23px; }
.chart-panel .panel-header { border-bottom: 0; padding-bottom: 6px; }
.chart-period { display: flex; align-items: center; gap: 7px; padding: 5px 9px; background: #f8fafb; color: #7c8b94; border: 1px solid #e7edef; border-radius: 5px; font-size: 10px; }
.chart-period .icon { width: 12px; height: 12px; }
.chart-legend { display: flex; gap: 17px; flex-wrap: wrap; padding: 10px 22px 0; font-size: 10px; color: #8b989f; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: #72ae9b; }
.legend-dot.blue { background: #8ba9c8; }
.legend-dot.amber { background: #d9b27d; }
.chart-wrap { position: relative; margin: 10px 17px 6px; }
.chart-svg { width: 100%; height: 225px; overflow: visible; }
.chart-svg text { fill: #9aa6ad; font-size: 10px; font-family: inherit; }
.chart-gridline { stroke: #edf1f3; stroke-dasharray: 3 5; stroke-width: 1; }
.chart-empty-message { position: absolute; top: 43%; left: 50%; transform: translate(-50%, -50%); padding: 9px 17px; border-radius: 6px; color: #8a9c9d; background: #fbfdfde6; font-size: 11px; text-align: center; white-space: nowrap; }
.chart-footnote { display: flex; align-items: center; gap: 5px; padding: 0 23px 15px; color: #a0acb1; font-size: 10px; }
.chart-footnote .icon { width: 12px; height: 12px; }
.chart-data { margin: 0 22px 17px; color: var(--muted); font-size: 10px; }
.chart-data summary { width: fit-content; cursor: pointer; }
.chart-data table { margin-top: 10px; width: 100%; border-collapse: collapse; }
.chart-data th, .chart-data td { padding: 5px 7px; text-align: left; border-bottom: 1px solid var(--line); font-size: 10px; }
.resources-panel .panel-header { padding-bottom: 17px; }
.resource-item { display: flex; align-items: center; gap: 12px; padding: 17px 0; border-bottom: 1px solid #edf1f3; }
.resource-item:last-child { border-bottom: 0; }
.resource-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #e9eeef; border-radius: 8px; color: #8fa5ad; background: #fafcfc; }
.resource-icon .icon { width: 17px; height: 17px; }
.resource-info { flex: 1; }
.resource-info strong { display: block; font-size: 12px; font-weight: 500; }
.resource-info small { display: block; margin-top: 1px; font-size: 10px; color: #a0a9af; }
.resource-value { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.resource-item > .icon { width: 12px; height: 12px; color: #b0bdc2; margin-left: 2px; }
.resource-item:hover .resource-info strong { color: var(--teal); }
.resources-panel .panel-body { padding: 0 22px; }
.gateway-address { margin: 9px 22px 20px; padding: 12px; border: 1px solid #e9eff1; background: #f8fafb; border-radius: 6px; }
.gateway-address span { color: #82939c; display: block; font-size: 10px; }
.gateway-address code { display: block; margin-top: 4px; font-size: 10px; color: #657c86; overflow-wrap: anywhere; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 12px; }
.data-table thead { background: #f9fbfc; }
.data-table th { height: 43px; padding: 12px 20px; color: #8b979e; font-weight: 400; font-size: 11px; border-top: 1px solid #edf1f3; border-bottom: 1px solid #edf1f3; }
.data-table td { height: 64px; padding: 14px 20px; border-bottom: 1px solid #f0f3f5; color: #60727d; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfdfd; }
.data-table td strong { display: block; color: #344d59; font-size: 12px; font-weight: 500; }
.data-table td small { display: block; margin-top: 3px; color: #9aa7ae; font-size: 10px; }
.data-table .mono { font-size: 11px; color: #748793; }
.data-table .cell-numeric { font-variant-numeric: tabular-nums; }
.table-name { display: flex; align-items: center; gap: 9px; }
.table-name > .icon { width: 15px; height: 15px; color: #95b6ad; }
.table-actions { display: flex; align-items: center; gap: 5px; }
.table-footer { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 14px; padding: 15px 22px; border-top: 1px solid var(--line); color: #99a5ab; font-size: 10px; }
.table-footer > span { display: inline-flex; align-items: center; gap: 6px; }
.table-footer .icon { width: 12px; height: 12px; }
.pagination { display: flex; align-items: center; gap: 11px; font-size: 11px; }
.pagination .button { min-height: 29px; padding: 4px 9px; font-size: 11px; }
.pagination .previous .icon { transform: rotate(180deg); }
.logs-status-filter { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: #f1f5f6; border: 1px solid #eaf0f1; border-radius: 7px; }
.filter-button { padding: 6px 12px; border-radius: 5px; background: transparent; color: #82939b; font-size: 11px; }
.filter-button[aria-pressed="true"] { color: #336e60; background: white; box-shadow: 0 1px 4px #213a4010; }
.cell-wrap { white-space: normal; max-width: 220px; overflow-wrap: anywhere; }
.rule-name-list { display: block; margin-top: 4px; max-width: 170px; white-space: normal; color: #8e9ba2; font-size: 10px; }

/* Channels, rules and key management */
.channels-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.channel-card { overflow: hidden; }
.channel-card-content { padding: 23px; }
.channel-card-top { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 21px; }
.channel-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #eff5f5; color: #67988e; }
.channel-card-top h2 { font-size: 15px; overflow-wrap: anywhere; }
.channel-card-top p { color: #9ba8af; font-size: 10px; margin-top: 3px; }
.channel-card-top > .badge { margin-left: auto; }
.channel-url-label { font-size: 10px; color: #93a1a9; margin-bottom: 6px; }
.channel-url { display: block; padding: 11px 12px; border: 1px solid #eaf0f2; background: #f8fafb; border-radius: 6px; font-size: 11px; color: #68808b; overflow-wrap: anywhere; }
.channel-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 17px; font-size: 10px; color: #96a5ab; }
.channel-meta span { display: inline-flex; gap: 5px; align-items: center; }
.channel-meta .icon { width: 12px; height: 12px; }
.channel-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 19px; background: #fcfdfd; border-top: 1px solid #edf1f2; }
.switch-group { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: #90a098; }
.switch { position: relative; width: 30px; height: 17px; padding: 0; border-radius: 12px; background: #c5ced3; border: 1px solid transparent; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: white; box-shadow: 0 1px 2px #0002; transition: transform .15s; }
.switch[aria-checked="true"] { background: #6fae97; }
.switch[aria-checked="true"]::after { transform: translateX(13px); }
.rules-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.rules-list { display: flex; flex-direction: column; }
.rule-card { padding: 21px 22px; border-bottom: 1px solid var(--line); }
.rule-card:last-child { border-bottom: 0; }
.rule-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rule-card-top h3 { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.rule-card-top > .table-actions { margin-left: auto; }
.rule-card .pattern { display: block; margin-top: 14px; padding: 10px 12px; color: #6f828f; background: #f6f8fa; border: 1px solid #eaf0f2; border-radius: 5px; font-size: 11px; white-space: pre-wrap; word-break: break-all; max-height: 112px; overflow: auto; }
.rule-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 13px; color: #97a4ab; font-size: 10px; }
.rule-card-bottom .rule-replacement { max-width: 72%; overflow-wrap: anywhere; }
.rule-disabled { background: #fcfdfd; }
.rule-disabled .rule-card-top h3 { color: #a0aab0; }
.preview-panel { position: sticky; top: 20px; }
.preview-panel .panel-header { padding: 18px; }
.preview-panel .panel-body { padding: 18px; }
.preview-panel textarea { font-size: 12px; min-height: 153px; line-height: 1.8; }
.preview-panel .button { width: 100%; }
.preview-note { color: #9aa7ae; font-size: 10px; margin-top: 12px; line-height: 1.9; }
.preview-result { margin-top: 19px; padding-top: 18px; border-top: 1px solid var(--line); }
.preview-result-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 11px; }
.preview-output { min-height: 80px; max-height: 320px; overflow: auto; padding: 12px; border: 1px solid #dcebe6; border-radius: 6px; background: #f3f9f6; color: #5c7a6d; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.action-guide { padding: 18px; border-top: 1px solid var(--line); }
.action-guide h3 { font-size: 11px; color: #80929a; font-weight: 500; margin-bottom: 12px; }
.action-guide-item + .action-guide-item { margin-top: 13px; }
.action-guide-item p { margin-top: 4px; color: #99a5ab; font-size: 10px; line-height: 1.85; }
.code-example { margin-top: 23px; }
.code-example .panel-header { padding: 17px 22px; }
.code-example pre { margin: 0; padding: 22px; color: #7890a0; background: #f9fbfc; font-size: 11px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 0 0 var(--radius) var(--radius); }
.key-prefix { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #f3f6f8; font-size: 11px; color: #7b8f9c; }
.secret-block { width: 100%; min-height: 92px; padding: 15px; border: 1px solid #b9daca; background: #f0f8f3; color: #3e7360; border-radius: 7px; resize: none; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.8; }
.key-success-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; background: #e6f4ec; color: #4c9676; border-radius: 50%; }
.key-success-icon .icon { width: 26px; height: 26px; }

/* Forms and dialogs */
.field { margin-bottom: 19px; }
.field > label, .field-label { display: block; margin-bottom: 7px; color: #506571; font-size: 12px; font-weight: 500; }
.required-mark { color: #b96e66; margin-left: 3px; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 41px; padding: 10px 12px; border: 1px solid #dde5e9; border-radius: 6px; background: #fff; color: #3c5561; line-height: 1.5; outline: none; transition: border-color .15s, box-shadow .15s; }
input:not([type="checkbox"]):focus, select:focus, textarea:focus { border-color: #6da99a; box-shadow: 0 0 0 3px #1686790b; }
input::placeholder, textarea::placeholder { color: #b0bcc3; }
textarea { resize: vertical; min-height: 100px; }
input[readonly] { background: #f6f8f9; color: #82949d; }
.field-hint { display: block; margin-top: 7px; color: #98a5ac; font-size: 10px; line-height: 1.85; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: #607680; margin: 9px 0 20px; }
input[type="checkbox"] { margin: 4px 0 0; width: 15px; height: 15px; accent-color: var(--teal); flex-shrink: 0; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-toggle { position: absolute; top: 6px; right: 6px; }
.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid #e5ecec; border-radius: 13px; color: var(--ink); box-shadow: 0 22px 100px #0c263840; overflow-y: auto; overscroll-behavior: contain; }
.modal[open] { animation: fade-up .18s ease; }
.modal::backdrop { background: #102a3b66; backdrop-filter: blur(3px); }
.modal.large { width: min(620px, calc(100vw - 32px)); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 21px 24px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 23px 24px 6px; }
.modal-description { margin: 0 0 21px; font-size: 12px; line-height: 1.9; color: #7c8e98; overflow-wrap: anywhere; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 23px -24px 0; padding: 17px 24px; background: #fafcfc; border-top: 1px solid var(--line); }
.modal-warning-icon { width: 43px; height: 43px; display: grid; place-items: center; margin-bottom: 17px; background: var(--red-soft); color: var(--red); border-radius: 10px; }
.modal-context { padding: 11px 13px; margin-bottom: 18px; background: #f6f8f9; border: 1px solid #e9eff1; border-radius: 6px; font-size: 12px; color: #607783; overflow-wrap: anywhere; }
.toast-region { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: min(410px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 14px 17px; border: 1px solid #d4e8de; border-radius: 9px; background: #f8fffb; color: #527864; box-shadow: 0 8px 30px #19362c1a; font-size: 12px; animation: fade-up .2s ease; pointer-events: auto; overflow-wrap: anywhere; }
.toast > .icon { width: 17px; height: 17px; margin-top: 2px; }
.toast.error { color: #a85c54; border-color: #eddbd7; background: #fffafa; }
.toast button { width: 22px; height: 22px; }
.toast button .icon { width: 13px; height: 13px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 23px; align-items: start; }
.settings-layout .panel + .panel { margin-top: 22px; }
.settings-layout .panel-body { padding: 25px; }
.settings-layout .field-hint { font-size: 11px; }
.settings-intro { color: #8d9ca4; font-size: 12px; line-height: 1.9; margin-bottom: 22px; }
.help-steps { counter-reset: help-step; padding: 0; margin: 0; list-style: none; }
.help-steps li { position: relative; padding-left: 39px; margin-bottom: 22px; }
.help-steps li:last-child { margin-bottom: 0; }
.help-steps li::before { counter-increment: help-step; content: counter(help-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 25px; height: 25px; background: #eff7f3; border: 1px solid #deede6; border-radius: 7px; color: #649480; font-size: 11px; }
.help-steps strong { font-size: 12px; font-weight: 550; }
.help-steps p { margin-top: 5px; color: #929fa7; font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; }
.help-steps a { color: var(--teal); }
.scope-list { margin: 0; padding: 0; list-style: none; }
.scope-list li { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; color: #84959e; font-size: 11px; line-height: 1.9; }
.scope-list li:last-child { margin-bottom: 0; }
.scope-list .icon { width: 15px; height: 15px; margin-top: 3px; color: #82aa9c; }
.scope-list strong { color: #5b7681; font-weight: 550; }
.connection-line { display: flex; align-items: center; gap: 12px; }
.connection-line code { flex: 1; font-size: 12px; overflow-wrap: anywhere; color: #687f89; }

/* Login */
.login-screen { min-height: 100dvh; display: grid; grid-template-columns: 1.03fr 1fr; }
.login-story { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 42px 48px 26px; color: #dae7e5; background-color: #112f39; background-image: linear-gradient(#a7d3c704 1px, transparent 1px), linear-gradient(90deg, #a7d3c704 1px, transparent 1px), radial-gradient(ellipse at 55% 62%, #22615a60, transparent 58%); background-size: 44px 44px, 44px 44px, 100% 100%; }
.login-brand { padding: 0; }
.login-brand .brand-name { font-size: 24px; }
.login-story-content { width: 100%; max-width: 490px; margin: auto; padding: 55px 0 40px; }
.eyebrow { margin-bottom: 15px; color: #8da59f; font-size: 10px; font-weight: 500; letter-spacing: 2px; }
.eyebrow.light { display: flex; align-items: center; gap: 9px; color: #7db6a8; }
.tiny-line { display: inline-block; width: 18px; height: 1px; background: #63aa96; }
.login-story h1 { font-size: clamp(32px, 3.4vw, 50px); line-height: 1.6; font-weight: 450; letter-spacing: 2px; }
.story-description { margin-top: 21px; color: #83a4aa; font-size: 13px; line-height: 2; }
.privacy-visual { position: relative; height: 270px; margin: 32px 0 0; display: flex; align-items: center; justify-content: space-between; }
.orbit { position: absolute; left: 50%; top: 49%; width: 210px; height: 210px; transform: translate(-50%, -50%); border: 1px solid #8dccb71a; border-radius: 50%; }
.orbit-two { width: 290px; height: 290px; border-style: dashed; border-color: #8dccb710; }
.visual-node { position: relative; z-index: 1; width: 74px; height: 76px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-direction: column; border: 1px solid #7bab9c2e; border-radius: 12px; background: #1b3e46; color: #92b1b2; box-shadow: 0 7px 25px #09212940; }
.visual-node .icon { width: 23px; height: 23px; }
.visual-node span { font-size: 10px; }
.visual-core { position: absolute; left: 50%; top: 49%; z-index: 2; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; width: 100px; height: 112px; color: #a3d7bc; border: 1px solid #73b59c75; border-radius: 24px; background: linear-gradient(150deg, #396c59, #1b4d46); box-shadow: 0 0 0 9px #85d5b405, 0 0 40px #6bba9d0d; }
.visual-core .icon { width: 42px; height: 42px; stroke-width: 1; }
.visual-core span { font-size: 13px; letter-spacing: 4px; margin-left: 4px; }
.visual-connection { position: absolute; top: 49%; height: 1px; width: 30%; background-image: linear-gradient(90deg, #6fa99444 50%, transparent 50%); background-size: 8px 1px; }
.connection-one { left: 55px; }
.connection-two { right: 55px; }
.visual-caption { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; font-size: 10px; color: #6b9c8f; white-space: nowrap; }
.story-features { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 40px; padding-top: 23px; border-top: 1px solid #ffffff0a; }
.story-features span { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; color: #81a39e; }
.story-features .icon { width: 14px; height: 14px; }
.story-footer { display: flex; justify-content: space-between; gap: 12px; color: #557d84; font-size: 9px; }
.login-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 70px 48px 95px; background: #fafcfc; }
.login-form-wrap { width: 100%; max-width: 365px; }
.login-emblem { width: 43px; height: 45px; margin-bottom: 26px; display: grid; place-items: center; color: #6d9f8a; border: 1px solid #dbeae2; background: #eff6f1; border-radius: 11px; }
.login-emblem .icon { width: 23px; height: 23px; }
.login-form-wrap .eyebrow { margin-bottom: 9px; font-size: 10px; color: #9caea8; }
.login-form-wrap h2 { font-size: 27px; font-weight: 600; letter-spacing: -.5px; }
.login-subtitle { margin-top: 10px; margin-bottom: 30px; color: #97a4ab; font-size: 12px; }
.login-form-wrap .field { margin-bottom: 21px; }
.login-form-wrap .field > label { color: #657b85; font-size: 12px; }
.login-form-wrap input { min-height: 45px; font-size: 12px; }
.login-submit { width: 100%; justify-content: space-between; min-height: 44px; padding: 12px 16px; margin-top: 5px; font-size: 12px; }
.bootstrap-hint { display: flex; align-items: flex-start; gap: 10px; margin-top: 27px; padding: 14px; border: 1px solid #e8edf0; background: #f4f7f8; border-radius: 7px; font-size: 11px; color: #91a0a9; }
.bootstrap-hint > .icon { width: 15px; height: 15px; margin-top: 3px; color: #9baeb7; }
.bootstrap-hint strong { display: block; color: #758b95; font-size: 11px; font-weight: 500; margin-bottom: 4px; }
.bootstrap-hint p { font-size: 10px; line-height: 1.95; }
.credential-path { display: block; font-size: 9px; color: #7a929e; padding: 6px 0; overflow-wrap: anywhere; }
.login-privacy { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 23px; color: #a6b4b7; font-size: 9px; }
.login-privacy .icon { width: 12px; height: 12px; }
.login-footer { position: absolute; bottom: 23px; left: 20px; right: 20px; color: #acb7bd; font-size: 9px; text-align: center; }
.login-footer span { margin: 0 6px; }
.noscript-message { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 30px; background: white; color: var(--ink); }

/* Responsive layout */
@media (min-width: 1600px) {
  .main-content { padding-top: 39px; }
  .overview-middle { grid-template-columns: 2.1fr 1fr; }
  .chart-svg { height: 255px; }
}
@media (max-width: 1240px) {
  .sidebar { width: 211px; padding-left: 14px; padding-right: 14px; }
  .workspace { margin-left: 211px; }
  .main-content { padding: 27px 25px 30px; }
  .topbar { padding: 0 25px; }
  .app-footer { padding-left: 25px; padding-right: 25px; }
  .channels-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid { gap: 12px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 29px; }
  .rules-layout { grid-template-columns: minmax(0, 1fr) 285px; gap: 17px; }
  .overview-middle { gap: 17px; grid-template-columns: minmax(0, 1.6fr) minmax(245px, 1fr); }
  .page-date { display: none; }
  .brand-name { font-size: 22px; }
  .brand-name > span { font-size: 12px; }
}
@media (max-width: 1020px) {
  .sidebar { width: 195px; padding-left: 10px; padding-right: 10px; }
  .workspace { margin-left: 195px; }
  .sidebar .brand { gap: 9px; }
  .sidebar .brand-mark { width: 32px; height: 37px; border-radius: 8px; }
  .sidebar .brand-name { font-size: 21px; }
  .sidebar .brand-name > span { font-size: 11px; }
  .brand-name small { font-size: 9px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-value { margin-top: 0; }
  .overview-middle { grid-template-columns: minmax(0, 1fr); }
  .resources-panel .panel-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
  .resource-item { border-bottom: 0; gap: 8px; }
  .resource-item > .icon { display: none; }
  .resource-icon { width: 30px; height: 30px; }
  .resource-info small { font-size: 9px; }
  .resource-value { font-size: 17px; }
  .gateway-address { margin-top: 0; }
  .rules-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-panel { position: static; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-layout > div { min-width: 0; }
  .welcome-banner { padding: 19px; gap: 12px; }
  .welcome-banner h2 { font-size: 14px; }
  .welcome-banner p { font-size: 10px; }
  .welcome-banner > .button { padding: 7px 10px; font-size: 11px; }
  .login-story { padding: 34px 30px 24px; }
  .login-panel { padding-left: 34px; padding-right: 34px; }
  .story-features { gap: 10px; }
}
@media (max-width: 760px) {
  .sidebar { width: 244px; padding: 25px 18px 18px; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .sidebar .brand-mark { width: 37px; height: 41px; }
  .sidebar .brand-name { font-size: 22px; }
  .sidebar .brand-name > span { font-size: 13px; }
  .nav-toggle { display: inline-flex; margin-left: -5px; }
  .nav-close { position: absolute; display: inline-flex; top: 6px; right: 6px; color: #72939f; }
  .topbar { height: 61px; padding: 0 19px; }
  .breadcrumb { gap: 10px; }
  .topbar-right { gap: 13px; }
  .help-link span, .account-role { display: none; }
  .topbar-divider { height: 18px; }
  .main-content { padding: 23px 19px 28px; }
  .app-footer { padding: 15px 19px; font-size: 9px; }
  .app-footer > span:last-child { display: none; }
  .page-heading { gap: 12px; margin-bottom: 21px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading p { max-width: 290px; font-size: 11px; }
  .page-actions { gap: 7px; }
  .page-actions .button { padding: 8px 11px; font-size: 11px; }
  .welcome-banner { padding: 18px; }
  .welcome-banner > .button { display: none; }
  .welcome-banner p { line-height: 1.9; }
  .metric-card { padding: 15px 16px; }
  .metric-value { font-size: 30px; }
  .metric-foot { gap: 3px; }
  .channels-grid { gap: 15px; }
  .channel-card-content { padding: 19px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-story { padding: 23px 26px; }
  .login-story-content, .story-footer { display: none; }
  .login-brand .brand-mark { width: 34px; height: 37px; }
  .login-brand .brand-name { font-size: 22px; }
  .login-brand .brand-name small { font-size: 9px; margin-top: 4px; }
  .login-panel { min-height: calc(100dvh - 89px); padding: 38px 26px 75px; }
  .login-form-wrap { max-width: 390px; }
  .login-emblem { margin-bottom: 20px; }
  .login-subtitle { margin-bottom: 25px; }
}
@media (max-width: 480px) {
  .main-content { padding: 20px 15px 25px; }
  .topbar { padding: 0 15px; }
  .breadcrumb-root, .breadcrumb-arrow { display: none; }
  .account { gap: 7px; }
  .account-avatar { width: 27px; height: 27px; }
  .page-heading { flex-wrap: wrap; align-items: flex-start; gap: 15px; }
  .page-heading p { max-width: none; }
  .page-heading .page-actions { margin-left: auto; }
  .metrics-grid { gap: 10px; margin-bottom: 17px; }
  .metric-card { padding: 14px 12px 12px; }
  .metric-top { font-size: 11px; }
  .metric-icon { width: 26px; height: 26px; }
  .metric-icon .icon { width: 15px; height: 15px; }
  .metric-value { font-size: 27px; margin-bottom: 7px; }
  .metric-foot { padding-top: 9px; flex-direction: column; font-size: 9px; }
  .welcome-banner { padding: 16px 13px; gap: 12px; margin-bottom: 17px; }
  .welcome-icon { width: 37px; height: 41px; border-radius: 9px; }
  .welcome-banner h2 { font-size: 13px; }
  .welcome-banner p { font-size: 9px; }
  .panel-header { padding: 17px; }
  .panel-header h2 { font-size: 13px; }
  .resources-panel .panel-body { display: block; padding: 0 18px; }
  .resource-item { padding: 13px 0; border-bottom: 1px solid var(--line); gap: 12px; }
  .resource-value { margin-left: auto; }
  .resource-item > .icon { display: block; }
  .gateway-address { margin: 10px 17px 17px; }
  .channels-grid { grid-template-columns: 1fr; }
  .toolbar { padding: 15px 17px; }
  .search-field { width: 100%; }
  .logs-status-filter { width: 100%; }
  .filter-button { flex: 1; padding: 6px 10px; }
  .toolbar-info { font-size: 10px; }
  .table-footer { padding: 14px 17px; }
  .table-footer .pagination { width: 100%; justify-content: flex-end; }
  .rule-card { padding: 18px; }
  .rule-card-top { gap: 7px; }
  .rule-card-top .table-actions { gap: 0; }
  .rule-card-bottom .rule-replacement { max-width: 100%; }
  .rule-card-bottom { align-items: flex-start; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .modal-header { padding: 17px 19px; }
  .modal-body { padding: 20px 19px 5px; }
  .modal-footer { margin-left: -19px; margin-right: -19px; padding-left: 19px; padding-right: 19px; }
  .notice { font-size: 11px; padding: 12px; }
  .settings-layout .panel-body { padding: 20px; }
  .toast-region { bottom: 16px; right: 16px; }
  .chart-svg { height: 200px; }
  .chart-legend { gap: 14px; padding-left: 18px; }
  .chart-wrap { margin-left: 9px; margin-right: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner { animation: spin 2s linear infinite; }
}
