:root {
  --ink: #17223b;
  --ink-soft: #61708f;
  --muted: #8793aa;
  --line: #e8ecf5;
  --surface: #ffffff;
  --canvas: #f4f6fb;
  --primary: #5266f5;
  --primary-deep: #4052dc;
  --violet: #8d5fee;
  --green: #18a874;
  --orange: #ef8b32;
  --red: #e64e60;
  --blue: #3d84ee;
  --cyan: #19a8b5;
  --shadow: 0 18px 50px rgba(39, 53, 103, 0.08);
  --shadow-soft: 0 8px 24px rgba(53, 65, 112, 0.07);
  --radius: 20px;
  --sidebar-width: 246px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(82, 102, 245, 0.2);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.svg-icon { width: 19px; height: 19px; display: inline-block; vertical-align: middle; }
.svg-icon svg { display: block; width: 100%; height: 100%; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--ink-soft);
  background: radial-gradient(circle at 50% 35%, #fff 0, #f4f6fb 58%, #eef1f9 100%);
}
.boot-screen p { margin: 0; font-size: 14px; }
.boot-pulse { width: 72px; height: 3px; border-radius: 3px; background: #e4e8f4; overflow: hidden; }
.boot-pulse::after {
  content: ""; display: block; width: 32px; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #9a61ee); animation: pulse-run 1.1s ease-in-out infinite;
}
@keyframes pulse-run { 0% { transform: translateX(-35px); } 100% { transform: translateX(80px); } }

.brand-mark {
  width: 43px; height: 43px; flex: 0 0 43px; border-radius: 14px;
  display: grid; place-items: center; color: white; font-weight: 800; font-size: 22px;
  background: linear-gradient(145deg, #4a5bf5 5%, #7859ef 57%, #ae5ee8);
  box-shadow: 0 10px 22px rgba(93, 91, 235, 0.3);
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 2px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22); background: linear-gradient(160deg, rgba(255,255,255,.22), transparent 45%);
}
.brand-mark span { position: relative; z-index: 1; transform: translateY(-1px); }
.brand-mark--large { width: 62px; height: 62px; border-radius: 20px; flex-basis: 62px; font-size: 31px; }
.brand-mark--light { background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); backdrop-filter: blur(12px); }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(480px, 1.12fr) minmax(430px, .88fr); background: #f7f8fc; }
.login-visual {
  min-height: 100vh; padding: 55px 7vw; color: white; position: relative; overflow: hidden;
  display: flex; flex-direction: column; background:
    radial-gradient(circle at 12% 95%, rgba(85,204,239,.36), transparent 31%),
    radial-gradient(circle at 89% 10%, rgba(182,114,247,.52), transparent 34%),
    linear-gradient(145deg, #1f2c62 0%, #4e54dc 48%, #7651d5 100%);
}
.login-grid {
  position: absolute; inset: 0; opacity: .09;
  background-image: linear-gradient(rgba(255,255,255,.8) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.8) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom right, black, transparent 75%);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(2px); border: 1px solid rgba(255,255,255,.14); }
.login-orb--one { width: 440px; height: 440px; right: -190px; top: 18%; background: rgba(255,255,255,.035); }
.login-orb--two { width: 250px; height: 250px; left: -90px; bottom: -60px; background: rgba(85,204,239,.12); }
.login-brand { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 19px; letter-spacing: .02em; position: relative; z-index: 1; }
.login-copy { margin: auto 0; position: relative; z-index: 1; max-width: 610px; }
.eyebrow { display: inline-flex; align-items: center; font-size: 11px; line-height: 1; letter-spacing: .16em; font-weight: 800; color: var(--primary); }
.eyebrow--light { color: rgba(255,255,255,.68); }
.login-copy h1 { margin: 24px 0 24px; font-size: clamp(38px, 4.3vw, 66px); line-height: 1.19; letter-spacing: -.045em; font-weight: 800; }
.login-copy p { font-size: 17px; line-height: 1.8; color: rgba(255,255,255,.7); max-width: 490px; }
.login-feature-row { display: flex; gap: 54px; padding: 28px 0 9px; position: relative; z-index: 1; }
.login-feature-row div { display: flex; flex-direction: column; gap: 7px; }
.login-feature-row strong { font-size: 23px; }
.login-feature-row span { font-size: 12px; color: rgba(255,255,255,.57); }
.login-domain { position: relative; z-index: 1; margin: 25px 0 0; font-size: 11px; letter-spacing: .12em; color: rgba(255,255,255,.35); }

.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 6vw; position: relative; }
.login-form { width: min(410px, 100%); }
.login-heading { margin-bottom: 37px; }
.login-heading h2 { font-size: 34px; letter-spacing: -.035em; margin: 15px 0 8px; }
.login-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 21px; }
.field-label { font-size: 13px; font-weight: 700; color: #4b5874; }
.input-shell {
  height: 53px; display: flex; align-items: center; gap: 11px; padding: 0 16px;
  border: 1px solid #e1e6f1; border-radius: 13px; background: white;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-shell:focus-within { border-color: #8492f7; box-shadow: 0 0 0 4px rgba(82,102,245,.08); }
.input-shell input, .input-shell select, .input-shell textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px;
}
.input-shell input::placeholder, .input-shell textarea::placeholder { color: #aab3c5; }
.input-icon { display: grid; place-items: center; width: 18px; height: 18px; color: #9aa5ba; }
.input-icon .svg-icon { width: 18px; height: 18px; }
.password-toggle { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: #9ba5b8; cursor: pointer; border-radius: 8px; }
.password-toggle:hover { color: var(--primary); background: #f4f6ff; }
.captcha-box { display: flex; align-items: flex-end; gap: 14px; }
.field--captcha { flex: 1; }
.field--captcha .input-shell { padding-left: 8px; }
.captcha-question { padding: 8px 11px; background: #eef1ff; border-radius: 8px; font-size: 13px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.field--captcha input { max-width: 72px; text-align: center; }
.text-button { border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0 0 17px; white-space: nowrap; }
.login-options { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 25px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--primary); }
.secure-note { display: flex; align-items: center; gap: 5px; color: #95a0b4; font-size: 11px; }
.secure-note .svg-icon { width: 14px; height: 14px; }
.form-error { padding: 11px 13px; color: #bc3a4a; background: #fff1f3; border: 1px solid #ffd9df; border-radius: 10px; font-size: 12px; line-height: 1.6; margin: -10px 0 16px; }
.primary-button, .secondary-button, .danger-button {
  min-height: 42px; border: 0; border-radius: 12px; padding: 0 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 13px; font-weight: 700;
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.primary-button {
  color: white; background: linear-gradient(135deg, var(--primary), #735af0 60%, #9458ea);
  box-shadow: 0 10px 24px rgba(83, 95, 232, .24);
}
.primary-button--wide { width: 100%; min-height: 53px; border-radius: 14px; font-size: 14px; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(83, 95, 232, .3); }
.secondary-button { color: #46536f; background: #f1f3f9; }
.secondary-button:hover:not(:disabled) { background: #e9edf6; }
.danger-button { color: white; background: var(--red); box-shadow: 0 8px 18px rgba(230,78,96,.18); }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .55; cursor: wait; transform: none; }
.login-help { text-align: center; margin: 18px 0 0; font-size: 11px; color: #9ba5b8; line-height: 1.7; }
.login-copyright { position: absolute; bottom: 25px; font-size: 11px; color: #b1b9c9; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 27px 18px 20px;
  background: #fff; border-right: 1px solid #e9edf5; display: flex; flex-direction: column;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 29px; }
.sidebar-brand > div:last-child { display: flex; flex-direction: column; gap: 3px; }
.sidebar-brand strong { font-size: 17px; letter-spacing: -.02em; }
.sidebar-brand span { font-size: 10px; color: var(--muted); letter-spacing: .13em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-caption { padding: 0 13px 9px; color: #a5aec0; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.nav-caption--second { margin-top: 20px; }
.nav-item {
  width: 100%; height: 46px; border: 0; background: transparent; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; padding: 0 14px; font-size: 13px; color: #6b7894; text-align: left;
  transition: .2s ease;
}
.nav-item .svg-icon { width: 18px; height: 18px; color: #8995ac; }
.nav-item:hover { color: var(--ink); background: #f6f7fb; }
.nav-item.is-active { background: linear-gradient(105deg, #eef0ff, #f6f1ff); color: var(--primary-deep); font-weight: 700; position: relative; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -18px; top: 12px; bottom: 12px; width: 3px; background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-item.is-active .svg-icon { color: var(--primary); }
.sidebar-status {
  margin-top: auto; border-radius: 15px; padding: 14px; display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(140deg, #f2faf7, #f6f9ff); border: 1px solid #e7f2ee;
}
.sidebar-status div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sidebar-status strong { font-size: 11px; }
.sidebar-status span:last-child { font-size: 9px; color: #8895ad; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 4px; border-radius: 50%; background: #1eb17d; box-shadow: 0 0 0 4px rgba(30,177,125,.1); }
.sidebar-user { margin-top: 15px; border-top: 1px solid #eef1f6; padding: 16px 4px 0; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 37px; height: 37px; flex: 0 0 37px; border-radius: 12px; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(145deg, #6373f3, #9c63e8);
}
.avatar--small { width: 33px; height: 33px; flex-basis: 33px; border-radius: 10px; font-size: 12px; }
.sidebar-user-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.sidebar-user-copy strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy span { font-size: 10px; color: var(--muted); }
.icon-button {
  width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid transparent;
  border-radius: 11px; background: transparent; color: #7b879e; cursor: pointer; transition: .18s;
}
.icon-button:hover { background: #f2f4f9; color: var(--primary); }
.icon-button--dark { width: 33px; height: 33px; color: #8994a9; }
.icon-button--dark:hover { background: #f6f1f6; color: var(--red); }
.icon-button .svg-icon { width: 18px; height: 18px; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  height: 78px; padding: 0 34px; background: rgba(250,251,254,.88); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(230,234,242,.92); display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #99a3b5; }
.breadcrumb b { font-weight: 400; color: #c4cbd7; }
.breadcrumb strong { color: #4d5870; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.server-badge { height: 31px; padding: 0 11px; border-radius: 20px; display: flex; align-items: center; gap: 8px; background: #f1faf6; border: 1px solid #e0f2ea; font-size: 10px; color: #4b7568; }
.server-badge .live-dot { margin: 0; width: 6px; height: 6px; flex-basis: 6px; box-shadow: none; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding-left: 9px; border-left: 1px solid #e6e9f0; }
.topbar-user > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.topbar-user strong { font-size: 11px; }
.topbar-user span { font-size: 9px; color: var(--muted); }
.menu-button { display: none; }

.view { padding: 29px 34px 45px; max-width: 1640px; margin: 0 auto; }
.page-loading { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); font-size: 12px; }
.spinner { width: 25px; height: 25px; border: 2px solid #e2e6f2; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 7px; font-size: 26px; letter-spacing: -.04em; }
.page-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.page-head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.muted { color: var(--muted); }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.dashboard-hero {
  min-height: 164px; border-radius: 22px; padding: 28px 31px; color: #fff; overflow: hidden; position: relative;
  background:
    radial-gradient(circle at 84% 18%, rgba(197,147,255,.55), transparent 25%),
    radial-gradient(circle at 72% 105%, rgba(77,204,232,.31), transparent 35%),
    linear-gradient(115deg, #384bcb, #6752e6 58%, #7a51d8);
  box-shadow: 0 18px 40px rgba(70, 78, 197, .22);
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.dashboard-hero::after {
  content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
  right: -48px; top: -74px; box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 68px rgba(255,255,255,.02);
}
.dashboard-hero-copy { position: relative; z-index: 1; }
.dashboard-hero h2 { font-size: 24px; margin: 11px 0 8px; letter-spacing: -.035em; }
.dashboard-hero p { margin: 0; color: rgba(255,255,255,.66); font-size: 12px; }
.dashboard-hero-meta { display: flex; align-items: center; gap: 21px; position: relative; z-index: 1; }
.hero-mini { padding: 0 20px; border-left: 1px solid rgba(255,255,255,.16); display: flex; flex-direction: column; gap: 5px; }
.hero-mini strong { font-size: 25px; }
.hero-mini span { font-size: 10px; color: rgba(255,255,255,.58); }
.hero-quick-button {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.15); color: white; cursor: pointer; backdrop-filter: blur(8px);
}

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric-card {
  min-height: 119px; border-radius: 18px; padding: 19px 18px 16px; background: #fff; border: 1px solid rgba(232,236,245,.9);
  box-shadow: var(--shadow-soft); display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.metric-card::after { content: ""; position: absolute; width: 55px; height: 55px; border-radius: 50%; right: -22px; top: -22px; background: var(--metric-tint, #f0f2ff); opacity: .65; }
.metric-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.metric-label { font-size: 11px; color: #8290a8; }
.metric-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--metric-color, var(--primary)); background: var(--metric-tint, #f0f2ff); }
.metric-icon .svg-icon { width: 15px; height: 15px; }
.metric-value { margin-top: auto; font-size: 28px; line-height: 1; font-weight: 800; letter-spacing: -.045em; position: relative; z-index: 1; }
.metric-note { margin-top: 8px; font-size: 9px; color: #a0a9ba; display: flex; align-items: center; gap: 5px; }
.metric-note b { color: var(--green); font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 20px; margin-bottom: 20px; }
.panel { background: #fff; border: 1px solid rgba(232,236,245,.9); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.panel-header { min-height: 67px; padding: 20px 22px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-title { display: flex; flex-direction: column; gap: 5px; }
.panel-title h2 { margin: 0; font-size: 15px; }
.panel-title p { margin: 0; font-size: 10px; color: var(--muted); }
.panel-content { padding: 5px 22px 22px; }
.trend-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.trend-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.trend-chart { width: 100%; height: 180px; display: block; overflow: visible; }
.chart-empty { min-height: 180px; display: grid; place-items: center; color: #a6afbf; font-size: 11px; }
.quick-actions { display: grid; gap: 10px; padding-top: 3px; }
.quick-action {
  width: 100%; border: 1px solid #edf0f6; background: #fbfcfe; border-radius: 13px; padding: 12px 13px;
  display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; transition: .18s;
}
.quick-action:hover { transform: translateY(-1px); border-color: #dfe3ff; background: #f8f8ff; box-shadow: 0 6px 16px rgba(45,57,106,.05); }
.quick-action-icon { width: 34px; height: 34px; border-radius: 10px; background: #eef1ff; color: var(--primary); display: grid; place-items: center; flex: 0 0 34px; }
.quick-action-icon .svg-icon { width: 17px; height: 17px; }
.quick-action-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.quick-action-copy strong { font-size: 11px; }
.quick-action-copy span { font-size: 9px; color: var(--muted); }
.quick-action > .svg-icon { color: #b5bdcc; width: 15px; height: 15px; }
.recent-list { display: grid; }
.recent-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f2f7; }
.recent-item:last-child { border-bottom: 0; }
.recent-dot { width: 31px; height: 31px; flex: 0 0 31px; border-radius: 10px; background: #f2f4fa; color: #71809c; display: grid; place-items: center; }
.recent-dot .svg-icon { width: 14px; height: 14px; }
.recent-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.recent-copy strong { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-copy span { font-size: 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { font-size: 9px; color: #a5aebe; white-space: nowrap; }

.toolbar { padding: 17px 19px; background: #fff; border: 1px solid rgba(232,236,245,.9); border-radius: 17px; display: flex; gap: 11px; align-items: center; margin-bottom: 14px; box-shadow: var(--shadow-soft); }
.search-box { min-width: 210px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #e4e8f1; border-radius: 10px; background: #fbfcfe; flex: 1; }
.search-box .svg-icon { color: #9ca7b9; width: 16px; height: 16px; }
.search-box input { border: 0; background: transparent; outline: 0; width: 100%; font-size: 11px; }
.select-shell { height: 38px; min-width: 120px; position: relative; }
.select-shell select {
  appearance: none; width: 100%; height: 100%; border: 1px solid #e4e8f1; border-radius: 10px; background: #fbfcfe;
  padding: 0 31px 0 11px; color: #56637c; font-size: 11px; outline: 0;
}
.select-shell::after { content: ""; position: absolute; right: 12px; top: 15px; width: 6px; height: 6px; border-right: 1.5px solid #96a1b5; border-bottom: 1.5px solid #96a1b5; transform: rotate(45deg); pointer-events: none; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-input { height: 38px; border: 1px solid #e4e8f1; border-radius: 10px; background: #fbfcfe; color: #66728a; padding: 0 9px; font-size: 10px; width: 124px; }

.table-panel { background: #fff; border: 1px solid rgba(232,236,245,.9); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; min-width: 900px; }
.data-table th {
  padding: 13px 16px; text-align: left; background: #f8f9fc; border-bottom: 1px solid #eceff5;
  font-size: 9px; color: #8995aa; font-weight: 700; letter-spacing: .035em; white-space: nowrap;
}
.data-table th[data-sort] { cursor: pointer; user-select: none; }
.data-table th[data-sort]:hover { color: var(--primary); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #f0f2f7; font-size: 10px; color: #596680; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table .primary-cell { color: var(--ink); font-weight: 700; }
.key-value { color: #394761; letter-spacing: .01em; white-space: nowrap; }
.table-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.table-button {
  height: 28px; border: 0; border-radius: 8px; padding: 0 8px; font-size: 9px; cursor: pointer;
  background: #f4f6fb; color: #61708a;
}
.table-button:hover { color: var(--primary); background: #eef1ff; }
.table-button--danger:hover { color: var(--red); background: #fff0f2; }
.table-button--success:hover { color: var(--green); background: #edfaf5; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 9px; border-radius: 20px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { color: #159567; background: #eaf9f3; }
.status-unactivated { color: #6680a8; background: #f0f4fa; }
.status-expired { color: #d47a21; background: #fff4e8; }
.status-disabled { color: #d84e61; background: #fff0f2; }
.role-badge { display: inline-flex; padding: 5px 9px; border-radius: 7px; font-size: 9px; font-weight: 700; }
.role-superadmin { color: #7951d5; background: #f1ecff; }
.role-operator { color: #3979d8; background: #ecf4ff; }
.role-support { color: #1498a3; background: #e9fafb; }
.admin-cell { display: flex; align-items: center; gap: 9px; }
.admin-cell .avatar { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; font-size: 10px; }
.admin-cell div { display: flex; flex-direction: column; gap: 2px; }
.admin-cell strong { font-size: 10px; }
.admin-cell span { font-size: 8px; color: var(--muted); }
.empty-state { padding: 65px 20px; text-align: center; }
.empty-state-icon { width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 18px; display: grid; place-items: center; background: #f1f3ff; color: var(--primary); }
.empty-state-icon .svg-icon { width: 26px; height: 26px; }
.empty-state h3 { margin: 0 0 7px; font-size: 14px; }
.empty-state p { margin: 0 auto 18px; max-width: 340px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.pagination { height: 61px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f0f2f7; }
.pagination-info { color: var(--muted); font-size: 9px; }
.pagination-buttons { display: flex; align-items: center; gap: 5px; }
.page-button { min-width: 29px; height: 29px; border: 1px solid #e5e9f1; border-radius: 8px; background: #fff; color: #65728a; font-size: 9px; cursor: pointer; }
.page-button:hover:not(:disabled) { border-color: #cfd6ff; color: var(--primary); background: #f8f9ff; }
.page-button.is-active { border-color: var(--primary); color: #fff; background: var(--primary); }
.page-button:disabled { opacity: .4; cursor: default; }

.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan-card { background: #fff; border: 1px solid #e9edf5; border-radius: 20px; box-shadow: var(--shadow-soft); padding: 20px; position: relative; overflow: hidden; }
.plan-card::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -36px; top: -36px; background: var(--plan-tint, #f0f2ff); }
.plan-card-head { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.plan-card-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--plan-color, var(--primary)); background: var(--plan-tint, #f0f2ff); }
.plan-card-icon .svg-icon { width: 19px; height: 19px; }
.plan-price { margin: 19px 0 2px; font-size: 27px; font-weight: 800; letter-spacing: -.05em; }
.plan-price small { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan-duration { font-size: 10px; color: var(--muted); }
.plan-meta { display: flex; justify-content: space-between; padding: 16px 0; margin-top: 12px; border-top: 1px solid #f0f2f7; color: var(--muted); font-size: 9px; }
.plan-card-footer { display: flex; gap: 7px; }
.plan-card-footer button { flex: 1; }
.plan-note { margin: 10px 0 0; min-height: 29px; font-size: 9px; color: #8994aa; line-height: 1.6; }

.log-action { display: inline-flex; padding: 5px 8px; border-radius: 7px; font-size: 8px; font-weight: 700; background: #eef2fb; color: #5c6c88; }
.log-action-green { color: #138960; background: #e9f9f2; }
.log-action-red { color: #d4475b; background: #fff0f2; }
.log-action-blue { color: #3d73ca; background: #eef5ff; }
.log-action-orange { color: #c67821; background: #fff4e8; }
.log-detail { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,29,55,.43); backdrop-filter: blur(5px); animation: fade-in .18s ease; }
.modal {
  width: min(570px, 100%); max-height: calc(100vh - 44px); overflow: hidden; position: relative; z-index: 1;
  background: #fff; border-radius: 23px; box-shadow: 0 30px 80px rgba(17,27,62,.25);
  display: flex; flex-direction: column; animation: modal-in .24s cubic-bezier(.2,.8,.2,1);
}
.modal--wide { width: min(760px, 100%); }
.modal--small { width: min(430px, 100%); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-header { padding: 24px 25px 15px; display: flex; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 8px 0 0; font-size: 21px; letter-spacing: -.035em; }
.modal-body { padding: 8px 25px 24px; overflow-y: auto; }
.modal-footer { padding: 15px 25px 22px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #f0f2f6; }
.modal-copy { font-size: 12px; color: #6a7790; line-height: 1.75; margin: 9px 0 4px; }
.modal-copy strong { color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .field--full { grid-column: 1 / -1; }
.modal .field { margin-bottom: 16px; }
.modal .input-shell { height: 45px; border-radius: 11px; background: #fbfcfe; }
.modal .input-shell select { appearance: none; }
.textarea-shell { min-height: 78px; height: auto; align-items: flex-start; padding-top: 11px; }
.textarea-shell textarea { resize: vertical; min-height: 54px; line-height: 1.55; }
.form-hint { font-size: 9px; color: var(--muted); line-height: 1.5; }
.form-error-inline { color: var(--red); font-size: 10px; margin: -5px 0 13px; }
.confirm-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: #fff4e8; color: var(--orange); margin-bottom: 15px; }
.confirm-icon--danger { background: #fff0f2; color: var(--red); }
.confirm-icon .svg-icon { width: 23px; height: 23px; }
.key-result { background: #f7f8ff; border: 1px solid #e7e9fc; border-radius: 14px; padding: 15px; }
.key-result textarea { width: 100%; height: 170px; border: 1px solid #e4e7f2; border-radius: 10px; padding: 12px; resize: vertical; background: #fff; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.8; color: #485574; outline: 0; }
.key-result-actions { display: flex; gap: 8px; margin-top: 10px; }
.credential-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #f7f8ff; border: 1px solid #e7e9fc; border-radius: 11px; margin: 10px 0; }
.credential-result strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; letter-spacing: .02em; }
.detail-list { display: grid; gap: 1px; background: #eff2f7; border: 1px solid #eff2f7; border-radius: 13px; overflow: hidden; }
.detail-row { display: grid; grid-template-columns: 120px 1fr; gap: 15px; padding: 11px 13px; background: #fff; font-size: 10px; }
.detail-row span:first-child { color: var(--muted); }
.detail-row strong { font-size: 10px; word-break: break-all; }
.event-list { margin-top: 18px; }
.event-list h3 { font-size: 12px; margin: 0 0 10px; }
.event-item { padding: 9px 0; border-bottom: 1px solid #f1f3f7; display: flex; justify-content: space-between; gap: 15px; font-size: 9px; color: var(--muted); }
.event-item strong { color: #53617c; font-size: 9px; }

.toast-stack { position: fixed; z-index: 200; right: 25px; top: 22px; display: grid; gap: 9px; width: min(350px, calc(100vw - 40px)); }
.toast {
  padding: 13px 15px; border-radius: 12px; background: rgba(27,37,64,.95); color: white; box-shadow: 0 14px 30px rgba(15,23,47,.2);
  font-size: 11px; line-height: 1.55; display: flex; gap: 9px; align-items: flex-start; animation: toast-in .22s ease;
}
.toast--success { background: rgba(15,123,88,.96); }
.toast--error { background: rgba(193,55,72,.96); }
.toast .svg-icon { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } }

@media (max-width: 1380px) {
  :root { --sidebar-width: 226px; }
  .view { padding-inline: 26px; }
  .topbar { padding-inline: 26px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { flex-wrap: wrap; }
  .search-box { flex-basis: 260px; }
}

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 16px 0 40px rgba(25,35,67,.13); }
  .sidebar.is-open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .menu-button { display: grid; }
  .breadcrumb { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-hero { flex-direction: column; align-items: flex-start; gap: 23px; }
  .dashboard-hero-meta { width: 100%; }
}

@media (max-width: 680px) {
  .topbar { height: 68px; padding-inline: 15px; }
  .topbar-user > div:last-child, .server-badge { display: none; }
  .view { padding: 21px 15px 35px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head-actions { width: 100%; }
  .page-head-actions > button { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-hero { padding: 23px 20px; }
  .dashboard-hero h2 { font-size: 20px; }
  .hero-mini { padding-inline: 12px; }
  .hero-mini strong { font-size: 20px; }
  .plan-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--full { grid-column: auto; }
  .toolbar { padding: 13px; }
  .search-box { flex-basis: 100%; }
  .date-range { flex: 1; }
  .date-input { flex: 1; min-width: 0; }
  .select-shell { flex: 1; }
  .modal-layer { padding: 10px; }
  .modal { border-radius: 18px; max-height: calc(100vh - 20px); }
  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .login-panel { padding-inline: 24px; }
}
