:root {
  --sidebar: #171b25;
  --sidebar-raised: #202634;
  --sidebar-text: #c6cbd6;
  --sidebar-muted: #788195;
  --blue: #5278f5;
  --blue-dark: #3f64dd;
  --ink: #1d2430;
  --muted: #77808f;
  --canvas: #e8eaed;
  --panel: #f7f8fa;
  --line: #cfd3d9;
  --white: #fff;
  --orange: #f1953d;
  --green: #23835f;
  --red: #c7485a;
  --shadow: 0 18px 50px rgba(22, 27, 36, .12);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-view { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; background: #151923; }
.login-ambient { position: absolute; inset: 0; background: radial-gradient(circle at 22% 15%, #314b9e 0, transparent 32%), radial-gradient(circle at 82% 80%, #1c5356 0, transparent 30%), linear-gradient(145deg, #141823, #202637); }
.login-ambient::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 28px 28px; }
.login-card { width: min(420px, calc(100vw - 34px)); padding: 42px; border-radius: 28px; background: rgba(245, 247, 250, .96); border: 1px solid rgba(255,255,255,.6); box-shadow: 0 28px 90px rgba(0,0,0,.36); position: relative; z-index: 1; }
.brand-mark { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: #171b25; color: white; font-weight: 800; border: 1px solid #171b25; box-shadow: 0 8px 24px rgba(23,27,37,.2); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 13px; font-size: 13px; background: #eff1f5; color: #171b25; border-color: rgba(255,255,255,.1); }
.login-card h1 { margin: 18px 0 8px; font-size: 26px; letter-spacing: -.04em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
.login-form label { display: grid; gap: 8px; font-size: 12px; color: #515a68; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 12px; padding: 11px 13px; outline: none; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(82,120,245,.13); }
.primary-button, .secondary-button, .danger-button { border: 1px solid transparent; border-radius: 12px; padding: 11px 16px; font-weight: 700; transition: transform .16s, background .16s, border-color .16s; }
.primary-button { background: var(--blue); color: white; box-shadow: 0 8px 20px rgba(82,120,245,.24); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.secondary-button { background: #fff; border-color: var(--line); color: var(--ink); }
.secondary-button:hover { border-color: #9fa7b4; background: #f4f5f7; }
.danger-button { background: #fff; border-color: rgba(199,72,90,.35); color: var(--red); }
.form-error { margin: 0; padding: 11px 13px; border-radius: 12px; color: #9d2e40; background: rgba(199,72,90,.1); font-size: 12px; }
.full-width { width: 100%; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; overflow-y: auto; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; border-right: 1px solid #0f131b; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-brand strong { display: block; color: #f5f6f8; font-size: 14px; }
.sidebar-brand span { display: block; color: var(--sidebar-muted); font-size: 10px; margin-top: 3px; letter-spacing: .12em; }
.sidebar-nav { padding: 14px 10px; display: grid; gap: 5px; flex: 1; }
.nav-group { border-radius: 13px; overflow: hidden; }
.nav-group-button { width: 100%; border: 0; background: transparent; color: var(--sidebar-text); display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 12px; font-weight: 700; font-size: 13px; text-align: left; }
.nav-group-button:hover { background: rgba(255,255,255,.05); color: white; }
.nav-group-button .chevron { margin-left: auto; width: 14px; height: 14px; transition: transform .2s; color: var(--sidebar-muted); }
.nav-group.open .chevron { transform: rotate(90deg); }
.nav-children { display: none; margin: 2px 0 7px 34px; border-left: 1px solid rgba(255,255,255,.11); }
.nav-group.open .nav-children { display: grid; }
.nav-item { border: 0; background: transparent; color: #8e97a9; display: flex; align-items: center; gap: 10px; padding: 11px 10px 11px 13px; text-align: left; font-size: 12px; position: relative; border-radius: 10px; }
.nav-item:hover { color: #e5e8ee; background: rgba(255,255,255,.04); }
.nav-item.active { color: white; background: var(--blue); font-weight: 700; box-shadow: 0 8px 22px rgba(44,81,197,.34); }
.nav-item .badge { margin-left: auto; background: var(--orange); color: white; border-radius: 6px; padding: 2px 7px; font-size: 10px; font-weight: 800; }
.sidebar-footer { padding: 15px 18px 20px; display: flex; align-items: center; gap: 8px; color: var(--sidebar-muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #54c490; box-shadow: 0 0 0 4px rgba(84,196,144,.09); }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 76px; padding: 14px 28px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(111,119,133,.25); background: rgba(232,234,237,.9); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.03em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.icon-button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.68); color: #586273; display: grid; place-items: center; position: relative; }
.icon-button:hover { color: var(--blue); border-color: #acb4c1; }
.notification-button span { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 8px; background: var(--orange); color: white; font-size: 10px; display: grid; place-items: center; border: 2px solid var(--canvas); }
.admin-avatar { width: 38px; height: 38px; border-radius: 13px; background: var(--sidebar); color: white; display: grid; place-items: center; font-weight: 800; }
.admin-meta { display: grid; gap: 2px; }
.admin-meta strong { font-size: 12px; }
.text-button { border: 0; background: transparent; padding: 0; color: var(--blue); font-size: 10px; text-align: left; }
.page-content { padding: 26px 28px 40px; min-width: 0; }
.mobile-only { display: none; }
.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-intro h2 { margin: 0 0 6px; font-size: 23px; letter-spacing: -.04em; }
.page-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card, .panel { background: rgba(247,248,250,.93); border: 1px solid rgba(174,181,192,.45); border-radius: 20px; box-shadow: 0 7px 28px rgba(30,36,48,.05); }
.stat-card { padding: 19px; min-height: 132px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -22px; bottom: -38px; width: 105px; height: 105px; border-radius: 50%; background: rgba(82,120,245,.08); }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-value { margin: 13px 0 7px; font-size: 27px; font-weight: 800; letter-spacing: -.05em; }
.stat-note { font-size: 11px; color: #8a93a1; }
.panel { padding: 20px; margin-top: 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-header h3 { margin: 0; font-size: 15px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.two-column { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: left; padding: 10px 11px; color: #7c8491; font-size: 10px; letter-spacing: .08em; border-bottom: 1px solid var(--line); text-transform: uppercase; }
.data-table td { padding: 12px 11px; border-bottom: 1px solid rgba(207,211,217,.64); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(82,120,245,.035); }
.name-cell strong { display: block; font-size: 12px; }
.name-cell span { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; }
.rate-stack { display: flex; gap: 7px; flex-wrap: wrap; }
.rate-pill { border-radius: 8px; padding: 5px 8px; font-size: 10px; font-weight: 800; background: #edf0f6; color: #4764b7; }
.rate-pill.team { background: #e9f5f0; color: #2d8063; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: #e9f5f0; color: var(--green); font-size: 10px; font-weight: 800; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.off { color: var(--red); background: #faecef; }
.status-pill.paused { color: #aa6b1f; background: #fdf2df; }
.action-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-button { border: 1px solid var(--line); border-radius: 9px; background: white; color: #4f5969; padding: 6px 9px; font-size: 10px; font-weight: 700; }
.mini-button:hover { color: var(--blue); border-color: #9eb0e8; }
.mini-button.danger { color: var(--red); border-color: #ecc4cb; }
.switch { width: 42px; height: 23px; border-radius: 20px; border: 0; background: #b7bdc8; position: relative; transition: background .18s; }
.switch::after { content: ""; position: absolute; width: 17px; height: 17px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: transform .18s; }
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(19px); }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.channel-card { background: #f8f9fb; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.channel-card-head { display: flex; align-items: flex-start; gap: 12px; }
.channel-icon { width: 40px; height: 40px; border-radius: 13px; background: #e8edff; color: var(--blue); display: grid; place-items: center; }
.channel-card h3 { margin: 0; font-size: 14px; }
.channel-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.channel-meta { margin-top: 15px; display: flex; gap: 8px; flex-wrap: wrap; }
.channel-actions { margin-top: 15px; display: flex; gap: 7px; flex-wrap: wrap; }
.empty-state { padding: 42px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.message-list { display: grid; gap: 10px; }
.message-item { padding: 13px 14px; border-radius: 14px; background: #f3f5f8; border: 1px solid rgba(207,211,217,.7); }
.message-item.unread { border-left: 3px solid var(--blue); }
.message-item strong { font-size: 12px; }
.message-item p { margin: 5px 0; color: var(--muted); font-size: 11px; }
.message-item time { color: #9aa2ae; font-size: 10px; }
.loading { padding: 50px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.loading::before { content: ""; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c7ccd5; border-top-color: var(--blue); animation: spin .7s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; font-size: 11px; color: var(--muted); }
.modal-root { position: fixed; inset: 0; z-index: 100; background: rgba(14,18,25,.52); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 18px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; background: #f7f8fa; border-radius: 24px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.65); }
.modal.large { width: min(760px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 21px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 10px; background: #eceef2; color: #697383; display: grid; place-items: center; }
.modal-body { padding: 20px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-field { display: grid; gap: 7px; }
.form-field label { color: #596273; font-size: 11px; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.info-box { padding: 12px 13px; border-radius: 13px; background: #e9edfa; color: #4a5e9c; font-size: 11px; line-height: 1.6; }
.help-item-card { display: grid; gap: 12px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.help-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-item-head strong { font-size: 12px; color: #596273; }
.help-item-head .action-row { display: flex; gap: 8px; }
.mini-button[disabled] { opacity: .45; cursor: not-allowed; }
.index-cell { color: #7b8894; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.access-list { display: grid; gap: 10px; }
.access-row { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.access-row div { flex: 1; }
.access-row strong { font-size: 12px; }
.access-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 13px; color: white; background: #303846; box-shadow: 0 14px 34px rgba(20,25,34,.24); font-size: 12px; animation: toast-in .22s ease-out; }
.toast.success { background: #267358; }
.toast.error { background: #a43648; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 246px; transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar::after { content: ""; position: fixed; inset: 0 0 0 246px; background: rgba(15,18,25,.35); pointer-events: none; opacity: 0; transition: opacity .2s; }
  .sidebar.open::after { opacity: 1; }
  .mobile-only { display: grid; }
  .topbar { padding: 12px 15px; }
  .topbar h1 { font-size: 17px; }
  .admin-meta { display: none; }
  .page-content { padding: 18px 14px 32px; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 15px; min-height: 116px; }
  .stat-value { font-size: 23px; }
  .panel { padding: 14px; overflow-x: auto; }
  .data-table { min-width: 720px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .toolbar input, .toolbar select { min-width: 140px; flex: 1; }
}

/* Frontend-aligned minimalist palette */
:root {
  --sidebar: #eaeaea;
  --sidebar-raised: #e4e4e4;
  --sidebar-text: #808080;
  --sidebar-muted: #a8a8a8;
  --blue: #121212;
  --blue-dark: #333333;
  --ink: #121212;
  --muted: #808080;
  --canvas: #e4e4e4;
  --panel: #eaeaea;
  --line: #949494;
  --orange: #121212;
}
body { color: #808080; }
.login-view { background: #e4e4e4; }
.login-ambient {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .95) 0, transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(168, 168, 168, .28) 0, transparent 28%),
    linear-gradient(145deg, #ededed, #d8d8d8);
}
.login-ambient::after {
  background-image:
    linear-gradient(rgba(18, 18, 18, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 18, 18, .035) 1px, transparent 1px);
}
.login-card {
  background: rgba(234, 234, 234, .96);
  border-color: rgba(148, 148, 148, .55);
  box-shadow: 0 24px 70px rgba(18, 18, 18, .14);
}
.brand-mark,
.brand-mark.small,
.admin-avatar {
  background: #121212;
  color: #ffffff;
  border-color: #121212;
  box-shadow: none;
}
.sidebar {
  background: #eaeaea;
  color: #808080;
  border-right-color: #949494;
}
.sidebar-brand { border-bottom-color: rgba(148, 148, 148, .45); }
.sidebar-brand strong { color: #121212; }
.sidebar-brand span { color: #a8a8a8; }
.nav-group-button { color: #121212; }
.nav-group-button:hover { background: #d8d8d8; color: #121212; }
.nav-group-button .chevron { color: #808080; }
.nav-children { border-left-color: rgba(148, 148, 148, .55); }
.nav-item { color: #808080; }
.nav-item:hover { color: #121212; background: #d8d8d8; }
.nav-item.active {
  color: #ffffff;
  background: #121212;
  box-shadow: none;
}
.nav-item .badge { background: #121212; color: #ffffff; }
.sidebar-footer { color: #a8a8a8; }
.status-dot { background: #121212; box-shadow: 0 0 0 4px rgba(18, 18, 18, .08); }
.topbar {
  background: rgba(234, 234, 234, .92);
  border-bottom-color: rgba(148, 148, 148, .4);
}
.icon-button {
  background: #eaeaea;
  border-color: rgba(148, 148, 148, .45);
  color: #808080;
}
.icon-button:hover { color: #121212; border-color: #949494; background: #d8d8d8; }
.notification-button span { background: #121212; border-color: #eaeaea; }
.admin-avatar { border-radius: 13px; }
.text-button { color: #121212; }
.page-intro h2,
.panel-header h3,
.stat-value { color: #121212; }
.stat-card,
.panel,
.channel-card {
  background: rgba(234, 234, 234, .94);
  border-color: rgba(148, 148, 148, .45);
  box-shadow: 0 6px 24px rgba(18, 18, 18, .045);
}
.stat-card::after { background: rgba(18, 18, 18, .055); }
.stat-label,
.stat-note,
.page-intro p,
.panel-header p { color: #808080; }
.primary-button {
  background: #121212;
  color: #ffffff;
  box-shadow: none;
}
.primary-button:hover { background: #333333; }
.secondary-button {
  background: #e4e4e4;
  border-color: rgba(148, 148, 148, .45);
  color: #808080;
}
.secondary-button:hover { color: #121212; background: #d8d8d8; border-color: #949494; }
.danger-button { background: #eaeaea; }
input,
select,
textarea {
  background: #e4e4e4;
  border-color: rgba(148, 148, 148, .45);
  color: #121212;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #121212;
  box-shadow: 0 0 0 3px rgba(18, 18, 18, .08);
}
.data-table th { color: #808080; border-bottom-color: #949494; }
.data-table td { border-bottom-color: rgba(148, 148, 148, .32); }
.data-table tbody tr:hover { background: rgba(18, 18, 18, .035); }
.rate-pill {
  background: #e4e4e4;
  color: #121212;
  border: 1px solid rgba(148, 148, 148, .35);
}
.rate-pill.team {
  background: #d8d8d8;
  color: #121212;
  border-color: rgba(148, 148, 148, .38);
}
.status-pill {
  background: #d8d8d8;
  color: #121212;
  border: 1px solid rgba(148, 148, 148, .35);
}
.status-pill.off {
  background: rgba(158, 37, 55, .1);
  color: #9e2537;
}
.status-pill.paused {
  background: rgba(128, 128, 128, .14);
  color: #595959;
}
.mini-button {
  background: #eaeaea;
  border-color: rgba(148, 148, 148, .45);
  color: #808080;
}
.mini-button:hover { color: #121212; border-color: #949494; background: #d8d8d8; }
.mini-button.danger { color: #9e2537; border-color: rgba(158, 37, 55, .35); }
.switch { background: #a8a8a8; }
.switch.on { background: #121212; }
.channel-icon { background: #e4e4e4; color: #121212; }
.message-item { background: #e4e4e4; border-color: rgba(148, 148, 148, .4); }
.message-item.unread { border-left-color: #121212; }
.modal-root { background: rgba(228, 228, 228, .72); }
.modal {
  background: #eaeaea;
  border-color: rgba(148, 148, 148, .5);
  box-shadow: 0 24px 70px rgba(18, 18, 18, .18);
}
.modal-header { border-bottom-color: rgba(148, 148, 148, .45); }
.modal-close { background: #d8d8d8; color: #808080; }
.info-box { background: #d8d8d8; color: #595959; }
.access-row { background: #eaeaea; border-color: rgba(148, 148, 148, .45); }
.toast { background: #121212; }
.toast.success { background: #121212; }
.toast.error { background: #9e2537; }

/* Whale Gray + Glow White */
:root {
  --sidebar: #303a44;
  --sidebar-raised: #3b4651;
  --sidebar-text: #d5dbe0;
  --sidebar-muted: #8f9aa4;
  --blue: #39444f;
  --blue-dark: #4a5661;
  --ink: #2f3943;
  --muted: #737e88;
  --canvas: #d9dee2;
  --panel: #f8fafb;
  --line: #aeb8c1;
  --orange: #39444f;
}
body {
  color: #737e88;
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 255, 255, .82), transparent 28%),
    linear-gradient(145deg, #d9dee2, #e8ecef 52%, #d5dbe0);
}
.login-view { background: #303a44; }
.login-ambient {
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, .24), transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(222, 229, 234, .18), transparent 28%),
    linear-gradient(145deg, #28323b, #3c4752);
}
.login-ambient::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
}
.login-card {
  background: linear-gradient(145deg, #ffffff, #eef2f5);
  border-color: rgba(255, 255, 255, .78);
  box-shadow: 0 30px 90px rgba(22, 30, 38, .34);
}
.brand-mark { background: #303a44; color: #ffffff; border-color: rgba(255, 255, 255, .18); }
.brand-mark.small,
.admin-avatar {
  background: linear-gradient(135deg, #ffffff, #e9eef2);
  color: #303a44;
  border-color: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 22px rgba(24, 32, 40, .14);
}
.sidebar {
  background: linear-gradient(180deg, #303a44, #2b343d);
  color: #d5dbe0;
  border-right-color: #202830;
}
.sidebar-brand { border-bottom-color: rgba(255, 255, 255, .1); }
.sidebar-brand strong { color: #ffffff; }
.sidebar-brand span { color: #8f9aa4; }
.nav-group-button { color: #d5dbe0; }
.nav-group-button:hover { background: rgba(255, 255, 255, .07); color: #ffffff; }
.nav-group-button .chevron { color: #8f9aa4; }
.nav-children { border-left-color: rgba(255, 255, 255, .14); }
.nav-item { color: #9da7b1; }
.nav-item:hover { color: #ffffff; background: rgba(255, 255, 255, .07); }
.nav-item.active {
  color: #2f3943;
  background: linear-gradient(135deg, #ffffff, #edf1f4);
  box-shadow: 0 10px 26px rgba(12, 18, 24, .25);
}
.nav-item .badge { background: #ffffff; color: #303a44; }
.sidebar-footer { color: #8f9aa4; }
.status-dot { background: #f7fafc; box-shadow: 0 0 0 4px rgba(247, 250, 252, .1), 0 0 14px rgba(247, 250, 252, .4); }
.topbar {
  background: rgba(248, 250, 251, .88);
  border-bottom-color: rgba(174, 184, 193, .56);
  box-shadow: 0 6px 24px rgba(47, 57, 67, .045);
}
.icon-button {
  background: linear-gradient(145deg, #ffffff, #edf1f4);
  border-color: rgba(174, 184, 193, .6);
  color: #737e88;
}
.icon-button:hover { color: #2f3943; border-color: #9ca7b1; background: #ffffff; }
.notification-button span { background: #303a44; border-color: #f8fafb; }
.text-button { color: #39444f; }
.page-intro h2,
.panel-header h3,
.stat-value { color: #2f3943; }
.stat-card,
.panel,
.channel-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(238, 242, 245, .96));
  border-color: rgba(174, 184, 193, .58);
  box-shadow: 0 12px 34px rgba(47, 57, 67, .08), inset 0 1px 0 rgba(255, 255, 255, .92);
}
.stat-card::after { background: radial-gradient(circle, rgba(255, 255, 255, .92), rgba(213, 219, 224, .24)); }
.stat-label,
.stat-note,
.page-intro p,
.panel-header p { color: #737e88; }
.primary-button {
  background: linear-gradient(135deg, #39444f, #2f3943);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(47, 57, 67, .22);
}
.primary-button:hover { background: linear-gradient(135deg, #4a5661, #39444f); }
.secondary-button {
  background: linear-gradient(145deg, #ffffff, #edf1f4);
  border-color: rgba(174, 184, 193, .65);
  color: #5f6a75;
}
.secondary-button:hover { color: #2f3943; background: #ffffff; border-color: #9ca7b1; }
input,
select,
textarea {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(174, 184, 193, .62);
  color: #2f3943;
  box-shadow: inset 0 1px 2px rgba(47, 57, 67, .035);
}
input:focus,
select:focus,
textarea:focus {
  border-color: #596570;
  box-shadow: 0 0 0 3px rgba(57, 68, 79, .1);
}
.data-table th { color: #737e88; border-bottom-color: #aeb8c1; }
.data-table td { border-bottom-color: rgba(174, 184, 193, .42); }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .5); }
.rate-pill {
  background: linear-gradient(135deg, #ffffff, #e8edf1);
  color: #39444f;
  border: 1px solid rgba(174, 184, 193, .48);
}
.rate-pill.team {
  background: linear-gradient(135deg, #f8fafb, #dfe5e9);
  color: #39444f;
  border-color: rgba(174, 184, 193, .52);
}
.status-pill {
  background: linear-gradient(135deg, #ffffff, #e4e9ed);
  color: #39444f;
  border: 1px solid rgba(174, 184, 193, .46);
}
.status-pill.off { background: rgba(158, 37, 55, .09); color: #9e2537; }
.status-pill.paused { background: rgba(115, 126, 136, .12); color: #5b6670; }
.mini-button {
  background: linear-gradient(145deg, #ffffff, #edf1f4);
  border-color: rgba(174, 184, 193, .58);
  color: #66717c;
}
.mini-button:hover { color: #2f3943; background: #ffffff; border-color: #9ca7b1; }
.switch { background: #aeb8c1; }
.switch.on { background: #303a44; box-shadow: 0 0 12px rgba(48, 58, 68, .2); }
.channel-icon { background: linear-gradient(135deg, #ffffff, #dfe5e9); color: #303a44; }
.message-item { background: linear-gradient(145deg, #ffffff, #edf1f4); border-color: rgba(174, 184, 193, .54); }
.message-item.unread { border-left-color: #303a44; }
.modal-root { background: rgba(48, 58, 68, .38); }
.modal {
  background: linear-gradient(145deg, #ffffff, #eef2f5);
  border-color: rgba(255, 255, 255, .8);
  box-shadow: 0 28px 80px rgba(22, 30, 38, .3);
}
.modal-header { border-bottom-color: rgba(174, 184, 193, .5); }
.modal-close { background: #e9edf1; color: #66717c; }
.info-box { background: linear-gradient(135deg, #edf1f4, #e0e6ea); color: #4f5a65; }
.access-row { background: linear-gradient(145deg, #ffffff, #eef2f5); border-color: rgba(174, 184, 193, .56); }
.toast { background: #303a44; }
.toast.success { background: #303a44; }
.toast.error { background: #9e2537; }
.channel-create-panel { max-width: 980px; }

/* Exact frontend palette: Whale Gray + Luminous White */
:root {
  --whale: #475061;
  --whale-dark: #38414f;
  --whale-deeper: #2a323e;
  --whale-light: #5c677c;
  --whale-tint: #7b889e;
  --luminous: #f6f5ee;
  --luminous-card: #faf9f4;
  --luminous-slot: #eceae1;
  --luminous-darker: #e2dfd3;
  --ink: #282f3b;
  --muted: #5c677c;
  --subtle: #8894a8;
  --canvas: #f6f5ee;
  --panel: #faf9f4;
  --line: rgba(71, 80, 97, .18);
  --sidebar: #475061;
  --sidebar-raised: #38414f;
  --sidebar-text: #e8eaf0;
  --sidebar-muted: #aeb7c7;
  --blue: #475061;
  --blue-dark: #38414f;
  --orange: #475061;
}
body {
  background: #f6f5ee;
  color: #5c677c;
}
.login-view { background: #f6f5ee; }
.login-ambient {
  background:
    radial-gradient(circle at 18% 14%, rgba(71, 80, 97, .12), transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(123, 136, 158, .12), transparent 28%),
    #f6f5ee;
}
.login-ambient::after {
  background-image:
    linear-gradient(rgba(71, 80, 97, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 80, 97, .045) 1px, transparent 1px);
}
.login-card {
  background: #faf9f4;
  border: 1.5px solid rgba(71, 80, 97, .16);
  box-shadow: 0 20px 60px rgba(71, 80, 97, .12);
}
.brand-mark { background: #475061; border-color: #38414f; color: #ffffff; }
.brand-mark.small,
.admin-avatar { background: #f6f5ee; color: #475061; border-color: rgba(255, 255, 255, .65); box-shadow: 0 2px 8px rgba(42, 50, 62, .18); }
.sidebar { background: #475061; color: #e8eaf0; border-right-color: #38414f; }
.sidebar-brand { border-bottom-color: rgba(255, 255, 255, .14); }
.sidebar-brand strong { color: #ffffff; }
.sidebar-brand span { color: #aeb7c7; }
.nav-group-button { color: #e8eaf0; }
.nav-group-button:hover { background: rgba(255, 255, 255, .08); color: #ffffff; }
.nav-group-button .chevron { color: #aeb7c7; }
.nav-children { border-left-color: rgba(255, 255, 255, .17); }
.nav-item { color: #bdc5d3; }
.nav-item:hover { color: #ffffff; background: rgba(255, 255, 255, .08); }
.nav-item.active {
  color: #475061;
  background: #f6f5ee;
  box-shadow: 0 8px 24px rgba(42, 50, 62, .2);
}
.nav-item .badge { background: #f6f5ee; color: #475061; }
.sidebar-footer { color: #aeb7c7; }
.status-dot { background: #f6f5ee; box-shadow: 0 0 0 4px rgba(246, 245, 238, .12), 0 0 12px rgba(246, 245, 238, .35); }
.topbar {
  background: rgba(250, 249, 244, .92);
  border-bottom: 1px solid rgba(71, 80, 97, .18);
  box-shadow: none;
}
.icon-button {
  background: #eceae1;
  border: 1px solid rgba(71, 80, 97, .22);
  color: #5c677c;
  box-shadow: 0 1px 4px rgba(71, 80, 97, .08);
}
.icon-button:hover { color: #282f3b; background: #e2dfd3; border-color: rgba(71, 80, 97, .32); }
.notification-button span { background: #475061; border-color: #faf9f4; }
.text-button { color: #475061; }
.page-intro h2,
.panel-header h3,
.stat-value { color: #282f3b; }
.stat-card,
.panel,
.channel-card {
  background: #faf9f4;
  border: 1.5px solid rgba(71, 80, 97, .16);
  box-shadow: 0 4px 20px -2px rgba(71, 80, 97, .06), 0 1px 3px -1px rgba(71, 80, 97, .04);
}
.stat-card::after { background: rgba(71, 80, 97, .06); }
.stat-label,
.stat-note,
.page-intro p,
.panel-header p { color: #5c677c; }
.primary-button {
  background: #475061;
  color: #ffffff;
  border-color: #38414f;
  box-shadow: 0 2px 8px rgba(71, 80, 97, .28), inset 0 1px 1px rgba(255, 255, 255, .25);
}
.primary-button:hover { background: #38414f; border-color: #2a323e; }
.secondary-button {
  background: #eceae1;
  color: #282f3b;
  border-color: rgba(71, 80, 97, .22);
  box-shadow: 0 1px 3px rgba(71, 80, 97, .08), inset 0 1px 1px rgba(255, 255, 255, .9);
}
.secondary-button:hover { background: #e2dfd3; color: #282f3b; border-color: rgba(71, 80, 97, .3); }
input,
select,
textarea {
  background: #eceae1;
  color: #282f3b;
  border: 1px solid rgba(71, 80, 97, .25);
  box-shadow: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #475061;
  box-shadow: 0 0 0 3px rgba(71, 80, 97, .09);
}
.data-table th { color: #282f3b; border-bottom-color: rgba(71, 80, 97, .2); }
.data-table td { border-bottom-color: rgba(71, 80, 97, .15); }
.data-table tbody tr:hover { background: rgba(236, 234, 225, .8); }
.rate-pill {
  background: #eceae1;
  color: #475061;
  border: 1px solid rgba(71, 80, 97, .18);
}
.rate-pill.team {
  background: #e2dfd3;
  color: #475061;
  border-color: rgba(71, 80, 97, .2);
}
.status-pill {
  background: #eceae1;
  color: #475061;
  border: 1px solid rgba(71, 80, 97, .18);
}
.status-pill.off { background: rgba(158, 37, 55, .09); color: #9e2537; }
.status-pill.paused { background: #e2dfd3; color: #5c677c; }
.mini-button {
  background: #eceae1;
  color: #282f3b;
  border-color: rgba(71, 80, 97, .22);
}
.mini-button:hover { background: #e2dfd3; color: #282f3b; border-color: rgba(71, 80, 97, .32); }
.switch { background: #8894a8; }
.switch.on { background: #475061; box-shadow: none; }
.channel-icon { background: #eceae1; color: #475061; }
.message-item { background: #f6f5ee; border-color: rgba(71, 80, 97, .16); }
.message-item.unread { border-left-color: #475061; }
.modal-root { background: rgba(71, 80, 97, .3); }
.modal {
  background: #faf9f4;
  border: 1.5px solid rgba(255, 255, 255, .75);
  box-shadow: 0 20px 60px rgba(42, 50, 62, .24);
}
.modal-header { border-bottom-color: rgba(71, 80, 97, .16); }
.modal-close { background: #eceae1; color: #282f3b; }
.info-box { background: #eceae1; color: #5c677c; }
.access-row { background: #faf9f4; border-color: rgba(71, 80, 97, .16); }
.toast { background: #475061; }
.toast.success { background: #475061; }
.toast.error { background: #9e2537; }

/* Sidebar spacing fix */
.sidebar-nav {
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  padding-bottom: 24px;
}
.nav-group {
  flex: none;
}
.nav-group-button {
  min-height: 48px;
  padding: 12px;
}
.nav-children {
  gap: 4px;
  padding: 4px 0;
}
.sidebar-footer {
  margin-top: auto;
}

/* Frontend tactile navigation style for sidebar */
.sidebar-nav {
  gap: 10px;
}
.nav-group {
  overflow: hidden;
  border-radius: 18px;
  background: rgba(246, 245, 238, .055);
  border: 1px solid rgba(246, 245, 238, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 2px rgba(26, 32, 40, .08);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.nav-group.open {
  padding: 4px;
  background: linear-gradient(180deg, #f8f7f1 0%, #e7e4d8 100%);
  border-color: rgba(71, 80, 97, .28);
  box-shadow: inset 0 3px 6px rgba(71, 80, 97, .16), inset 0 -1px 2px rgba(255, 255, 255, .9);
}
.nav-group-button {
  min-height: 46px;
  border-radius: 14px;
  padding: 11px 12px;
  color: #f6f5ee;
  background: transparent;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-group-button:hover {
  background: rgba(246, 245, 238, .1);
  color: #ffffff;
}
.nav-group.open .nav-group-button {
  color: #475061;
  padding: 10px;
}
.nav-group.open .nav-group-button:hover {
  background: rgba(255, 255, 255, .45);
  color: #282f3b;
}
.nav-group.open .nav-group-button .chevron {
  color: #5c677c;
}
.nav-children {
  display: none;
  margin: 3px 2px 0;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: rgba(221, 217, 203, .55);
  box-shadow: inset 0 2.5px 5px rgba(71, 80, 97, .16), inset 0 -1px 2px rgba(255, 255, 255, .78);
}
.nav-group.open .nav-children {
  display: grid;
}
.nav-item {
  min-height: 42px;
  padding: 10px 11px;
  border-radius: 11px;
  color: #5c677c;
  background: transparent;
  border: 1px solid transparent;
  transition: all .18s ease;
}
.nav-item:hover {
  color: #282f3b;
  background: rgba(246, 245, 238, .72);
  border-color: rgba(71, 80, 97, .12);
}
.nav-item.active {
  color: #f6f5ee;
  background: linear-gradient(180deg, #475061 0%, #38414f 100%);
  border-color: rgba(255, 255, 255, .35);
  box-shadow: 0 3px 8px -1px rgba(71, 80, 97, .35), 0 1px 3px rgba(42, 50, 62, .2), inset 0 1px 1.5px rgba(255, 255, 255, .35), inset 0 -1px 1.5px rgba(0, 0, 0, .2);
}
.nav-item.active:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #526077 0%, #38414f 100%);
}
.nav-item .badge {
  background: #f1953d;
  color: #ffffff;
}
