:root {
  --navy: #151c46;
  --navy-deep: #101735;
  --violet: #665ef6;
  --violet-dark: #5148ed;
  --blue: #477ce9;
  --cyan: #35cbd1;
  --coral: #ff7582;
  --green: #24b878;
  --amber: #f5ad35;
  --ink: #18213f;
  --muted: #8a91a8;
  --line: #e9eaf3;
  --surface: #fff;
  --canvas: #f5f6ff;
  --shadow: 0 10px 30px rgba(39, 46, 105, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.brand-logo { display: flex; width: 70px; height: 70px; align-items: center; justify-content: center; gap: 4px; border-radius: 20px; background: linear-gradient(145deg, #735dfb, #4f65f4); box-shadow: 0 14px 35px rgba(91, 82, 240, .28); }
.brand-logo span { display: block; width: 5px; height: 22px; border-radius: 4px; background: #fff; }
.brand-logo span:nth-child(2), .brand-logo span:nth-child(4) { height: 38px; }
.brand-logo span:nth-child(3) { height: 48px; }
.brand-logo.small { width: 44px; height: 44px; gap: 3px; border-radius: 12px; box-shadow: none; }
.brand-logo.small span { width: 3px; height: 14px; }
.brand-logo.small span:nth-child(2), .brand-logo.small span:nth-child(4) { height: 24px; }
.brand-logo.small span:nth-child(3) { height: 31px; }

.login-page { min-height: 100vh; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 10%, #253a91 0, #17265d 38%, #101735 100%); }
.login-wave { position: fixed; border: 1px solid rgba(111, 99, 255, .4); border-radius: 50%; pointer-events: none; }
.wave-a { left: -10vw; bottom: -36vh; width: 70vw; height: 70vh; box-shadow: inset 0 80px 100px rgba(83, 78, 239, .13); transform: rotate(13deg); }
.wave-b { right: -17vw; bottom: -48vh; width: 76vw; height: 78vh; box-shadow: inset 0 100px 140px rgba(48, 105, 235, .15); transform: rotate(-8deg); }
.login-card { position: relative; z-index: 2; width: min(710px, calc(100vw - 34px)); padding: 48px 54px 42px; border: 1px solid rgba(255,255,255,.6); border-radius: 24px; background: rgba(255,255,255,.985); box-shadow: 0 30px 90px rgba(5, 11, 43, .35); text-align: center; }
.login-card > .brand-logo { margin: 0 auto 24px; }
.login-card h1 { margin: 0; color: #172353; font-size: 34px; letter-spacing: .5px; }
.login-subtitle { margin: 12px 0 26px; color: #7c849e; font-size: 16px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 24px; }
.feature-grid > div { display: flex; min-height: 62px; padding: 0 14px; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; background: #f3f3ff; color: #303a64; font-size: 14px; font-weight: 650; }
.feature-grid b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: #7268fa; color: #fff; font-size: 13px; }
.login-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.login-form label { display: grid; gap: 7px; color: #616982; font-size: 13px; font-weight: 650; }
.login-form input, .settings-form input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #dfe1ed; border-radius: 10px; outline: none; background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.login-form input:focus, .settings-form input:focus { border-color: #8d87ff; box-shadow: 0 0 0 3px rgba(102, 94, 246, .11); }
.login-form .primary-button { grid-column: 1 / -1; }
.primary-button { min-height: 48px; border: 0; border-radius: 10px; background: linear-gradient(105deg, #755dfc, #5364f6); color: #fff; font-weight: 700; box-shadow: 0 10px 24px rgba(91, 82, 240, .2); }
.primary-button:hover { filter: brightness(.98); transform: translateY(-1px); }
.login-trust { margin: 22px 0 0; color: #9da3b6; font-size: 13px; }
.login-signature { position: fixed; z-index: 2; left: 42px; bottom: 32px; display: flex; align-items: center; gap: 10px; color: rgba(207, 213, 255, .68); font-size: 17px; }
.mini-wave { font-size: 27px; color: #8584ff; }
.flash { padding: 11px 14px; border-radius: 10px; font-size: 14px; text-align: left; }
.flash.error { background: #fff0f2; color: #c94f60; }
.flash.success { background: #ecfbf5; color: #18875a; }
.login-card .flash { margin: -8px 0 18px; }

.admin-page { min-width: 1180px; background: var(--canvas); }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 238px; padding: 24px 14px 18px; flex-direction: column; background: linear-gradient(165deg, #18224f 0%, #11183a 70%, #162354 100%); color: #cbd1e8; box-shadow: 8px 0 30px rgba(18, 25, 64, .09); }
.sidebar-brand { display: flex; padding: 0 10px; align-items: center; gap: 11px; color: #fff; }
.sidebar-brand strong { white-space: nowrap; font-size: 17px; }
.project-select { display: flex; width: 100%; height: 42px; margin: 20px 0 14px; padding: 0 13px; align-items: center; justify-content: space-between; border: 1px solid rgba(77, 135, 233, .52); border-radius: 9px; background: rgba(26, 38, 91, .8); color: #fff; }
.sidebar-nav { display: grid; gap: 4px; }
.sidebar-nav a { display: flex; height: 48px; padding: 0 15px; align-items: center; gap: 13px; border-radius: 9px; color: #bfc7e0; font-size: 14px; transition: .18s ease; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: linear-gradient(100deg, #6458ed, #4f55ed); color: #fff; box-shadow: 0 9px 22px rgba(63, 55, 198, .28); }
.sidebar-nav i { display: grid; width: 24px; height: 24px; place-items: center; color: #aeb8da; font-style: normal; font-size: 17px; }
.sidebar-nav a.active i { color: #fff; }
.sidebar-footer { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer p { margin: 0 0 10px; color: rgba(209,215,248,.68); font-family: cursive; font-size: 13px; }
.sidebar-footer span { color: rgba(186,193,224,.42); font-size: 11px; }

.admin-shell { min-height: 100vh; margin-left: 238px; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; height: 66px; padding: 0 24px; align-items: center; justify-content: space-between; border-bottom: 1px solid #ececf5; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.topbar > div:first-of-type { display: flex; align-items: baseline; gap: 24px; }
.topbar h1 { margin: 0; color: #121b3d; font-size: 22px; }
.topbar > div:first-of-type span { color: #8990a6; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 9px; color: #252e50; font-size: 14px; font-weight: 650; }
.notice-button { position: relative; width: 38px; height: 38px; border: 0; background: transparent; color: #57617e; font-size: 22px; }
.notice-button b { position: absolute; right: 1px; top: -1px; display: grid; min-width: 17px; height: 17px; padding: 0 4px; place-items: center; border-radius: 9px; background: #ff5967; color: #fff; font-size: 10px; }
.admin-avatar { display: grid; width: 36px; height: 36px; margin-left: 8px; place-items: center; border-radius: 50%; background: linear-gradient(145deg,#8999cf,#6574ad); color: #fff; }
.text-button { border: 0; background: transparent; color: #737b93; font-size: 13px; }
.mobile-menu { display: none; }

.workspace { padding: 16px 20px 28px; }
.flash.floating { margin-bottom: 14px; box-shadow: var(--shadow); }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; display: flex; min-width: 0; min-height: 110px; padding: 18px; align-items: center; gap: 14px; overflow: hidden; border: 1px solid #eff0f6; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.metric-card::after { position: absolute; right: -16px; bottom: -26px; width: 76px; height: 76px; border-radius: 20px; background: currentColor; content: ''; opacity: .055; transform: rotate(20deg); }
.metric-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 50%; background: currentColor; color: #fff; font-size: 22px; box-shadow: 0 8px 18px color-mix(in srgb, currentColor 28%, transparent); }
.metric-card > div:last-child { display: grid; min-width: 0; gap: 3px; }
.metric-card span { color: #2a3351; font-size: 13px; font-weight: 700; }
.metric-card strong { color: #121b3c; font-size: 26px; line-height: 1.15; white-space: nowrap; }
.metric-card small { color: #9aa1b3; font-size: 11px; white-space: nowrap; }
.metric-card.violet { color: var(--violet); }.metric-card.cyan { color: #2cbec7; }.metric-card.blue { color: #4b98ee; }.metric-card.coral { color: var(--coral); }.metric-card.indigo { color: #6659ed; }

.main-grid { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(300px, 1fr); gap: 14px; margin-top: 14px; }
.secondary-grid { display: grid; grid-template-columns: 1.15fr 1.15fr 1fr; gap: 14px; margin-top: 14px; }
.panel { min-width: 0; border: 1px solid #ebecf4; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.panel-head { display: flex; min-height: 52px; padding: 0 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid #eff0f5; }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-head a { color: var(--violet); font-size: 12px; font-weight: 650; }
.table-wrap { padding: 0 14px 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { height: 38px; color: #687089; background: #f6f7fb; font-weight: 650; text-align: left; }
th:first-child { padding-left: 12px; border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { height: 42px; border-bottom: 1px solid #eef0f5; color: #4b5470; white-space: nowrap; }
td:first-child { padding-left: 12px; }
.task-id { color: #344064; font-variant-numeric: tabular-nums; }
.status-pill { display: inline-block; min-width: 55px; padding: 5px 9px; border-radius: 14px; font-size: 11px; text-align: center; }
.status-pill.info { background: #e7f2ff; color: #3984d9; }.status-pill.warning { background: #fff3d9; color: #dc911d; }.status-pill.success { background: #e6f8ef; color: #20a76b; }.status-pill.danger { background: #ffe7e9; color: #e95463; }.status-pill.muted { background: #eff0f4; color: #777e91; }
.actions-cell { display: flex; height: 42px; align-items: center; gap: 6px; }
.actions-cell form { display: inline-flex; margin: 0; }
.table-button, .outline-button { min-width: 48px; height: 28px; padding: 0 10px; border: 1px solid #e1e2f4; border-radius: 6px; background: #f4f3ff; color: #655df2; font-size: 11px; font-weight: 650; }
.table-button.primary { border-color: #8c85fb; background: #fff; color: #5d55ed; }
.outline-button { min-width: 74px; background: #fff; }

.settings-form { display: grid; gap: 14px; padding: 14px 16px 16px; }
.settings-form > label:not(.switch-row) { display: grid; grid-template-columns: 105px 1fr; align-items: center; color: #59617a; font-size: 12px; font-weight: 650; }
.settings-form input { height: 36px; border-radius: 7px; font-size: 12px; }
.suffix-input { position: relative; }
.suffix-input input { padding-right: 36px; }
.suffix-input b { position: absolute; right: 13px; top: 10px; color: #7f869d; font-size: 12px; }
.switch-row { position: relative; display: flex; min-height: 48px; align-items: center; justify-content: space-between; }
.switch-row > span { display: grid; gap: 4px; }
.switch-row b { color: #424b68; font-size: 12px; }
.switch-row small { color: #9ca2b4; font-size: 10px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; display: block; width: 42px; height: 23px; flex: 0 0 42px; border-radius: 14px; background: #d9dce7; transition: .2s; }
.switch-row i::after { position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.18); content: ''; transition: .2s; }
.switch-row input:checked + i { background: linear-gradient(90deg,#6f5cf9,#4e67f2); }
.switch-row input:checked + i::after { transform: translateX(19px); }
.primary-button.compact { min-height: 36px; }

.service-list { padding: 0 14px 13px; font-size: 11px; }
.service-row { display: grid; min-height: 42px; grid-template-columns: 1.25fr .75fr 1fr; align-items: center; border-bottom: 1px solid #eef0f5; color: #667089; }
.service-row strong { color: #39435f; }
.service-head { min-height: 36px; margin-top: 8px; padding: 0 9px; border: 0; border-radius: 7px; background: #f5f6fa; color: #657087; font-weight: 650; }
.service-ok { display: flex; align-items: center; gap: 6px; color: #20a76b; }
.service-ok i, .healthy i { width: 7px; height: 7px; border-radius: 50%; background: #1fb473; }
.service-row time { color: #70788e; }
.message-list { padding: 0 14px 12px; }
.message-row { display: grid; min-height: 58px; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; border-bottom: 1px solid #eef0f5; }
.message-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #645df0; background: #e9e8ff; font-size: 13px; }.message-avatar.color-1 { color: #23aeb9; background: #def8f5; }.message-avatar.color-2 { color: #df5b69; background: #ffeaed; }
.message-row > div:nth-child(2) { min-width: 0; }
.message-row strong { display: flex; align-items: center; gap: 6px; color: #303a59; font-size: 12px; }
.message-row strong i { width: 6px; height: 6px; border-radius: 50%; background: #ff5967; }
.message-row p { margin: 4px 0 0; overflow: hidden; color: #7d8498; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-row form { margin: 0; }
.healthy { display: flex; padding: 5px 9px; align-items: center; gap: 6px; border-radius: 14px; background: #e7f8ef; color: #24a26d; font-size: 10px; }
.ring-grid { display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px 14px 8px; text-align: center; }
.ring-grid > div { display: grid; justify-items: center; gap: 7px; color: #606984; font-size: 11px; }
.progress-ring { display: grid; width: 72px; height: 72px; place-items: center; border-radius: 50%; background: conic-gradient(#5e91ed calc(var(--value) * 1%), #e8edf9 0); }
.progress-ring::before { grid-area: 1 / 1; width: 56px; height: 56px; border-radius: 50%; background: #fff; content: ''; }
.progress-ring strong { z-index: 1; grid-area: 1 / 1; color: #202943; font-size: 15px; }
.progress-ring.memory { background: conic-gradient(#2dbfc5 calc(var(--value) * 1%), #e8f4f6 0); }.progress-ring.disk { background: conic-gradient(#735cf2 calc(var(--value) * 1%), #edeafd 0); }
.process-state { display: grid; min-height: 49px; margin: 6px 14px 13px; padding: 0 12px; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; border: 1px solid #edf0f5; border-radius: 8px; }
.process-state strong { font-size: 12px; }.process-state small { color: #9097aa; font-size: 10px; }

.trend-panel { margin-top: 14px; padding-bottom: 12px; }
.legend { display: flex; align-items: center; gap: 7px; color: #7b8398; font-size: 10px; }
.legend span { width: 7px; height: 7px; margin-left: 12px; border-radius: 50%; }.success-dot { background: #665ef6; }.failed-dot { background: #ff7582; }
.chart-layout { display: grid; padding: 8px 18px 0; grid-template-columns: minmax(0, 4fr) minmax(210px, 1fr); align-items: center; }
.trend-chart { width: 100%; height: 170px; overflow: visible; }
.trend-chart line { stroke: #eceef5; stroke-width: 1; }.trend-chart polyline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }.success-line { stroke: #665ef6; }.failed-line { stroke: #ff7582; }
.chart-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-summary div { display: grid; gap: 9px; }.chart-summary span { color: #737b91; font-size: 11px; }.chart-summary strong { font-size: 25px; }
.chart-labels { display: grid; margin: -16px calc(20% + 24px) 0 38px; grid-template-columns: repeat(7, 1fr); color: #8e95a8; font-size: 9px; text-align: center; }

.setup-error-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #f5f6ff; }
.setup-error-card { width: min(520px, 100%); padding: 38px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.setup-error-card .brand-logo { margin: 0 auto 20px; }.setup-error-card h1 { margin: 0 0 15px; }.setup-error-card p { color: #626a82; }.setup-error-card .muted { color: #9aa1b3; font-size: 13px; }

@media (max-width: 1350px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .secondary-grid { grid-template-columns: 1fr 1fr; }
  .server-panel { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .login-card { padding: 34px 22px 30px; }
  .login-card h1 { font-size: 27px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .login-form { grid-template-columns: 1fr; }
  .login-form .primary-button { grid-column: auto; }
  .login-signature { display: none; }
}

