:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #14263a;
  background: #f3f6fa;
  font-synthesis: none;
  --navy: #13263b;
  --blue: #3568db;
  --line: #e0e7f0;
  --muted: #596b82;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 3vw, 38px); letter-spacing: -.045em; line-height: 1.22; }
h2 { font-size: 17px; letter-spacing: -.02em; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, input, textarea, select {
  min-height: 40px; border-radius: 9px; border: 1px solid #dbe4ef; background: #fff; color: inherit;
}
button { padding: 0 14px; font-weight: 650; font-size: 14px; transition: background .18s, border-color .18s; }
button:hover { background: #edf3fb; border-color: #c6d4e7; }
.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 3px 8px #3568db20; }
.primary:hover { background: #2b58c1; border-color: #2b58c1; }
.plain { background: transparent; border-color: transparent; }
input, textarea, select { padding: 9px 12px; width: 100%; }
textarea { resize: vertical; }
input[type="radio"], input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--blue); }
input[type="file"]::file-selector-button { border: 0; border-radius: 5px; padding: 6px 10px; margin-right: 10px; background: #eaf0fc; color: #254998; }

.workspace { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--navy); color: #fff; padding: 30px 19px 20px; display: flex; flex-direction: column; gap: 48px; }
.brand { display: inline-flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; font-weight: 750; font-size: 17px; }
.sidebar .brand { padding: 0 8px; }
.brand-mark { width: 40px; height: 40px; border: 1px solid #e6c99580; border-radius: 11px; color: #eed4a3; background: #f4cc7530; display: grid; place-items: center; font-size: 20px; }
.brand small { display: block; color: #a3b7ce; font-size: 12px; font-weight: 500; margin-top: 3px; }
.sidebar nav { display: grid; gap: 7px; }
.nav { background: transparent; border: 1px solid transparent; color: #bfcee0; display: flex; align-items: center; text-align: left; gap: 13px; min-height: 45px; }
.nav:hover { background: #243d58; border-color: transparent; }
.nav[aria-current="page"] { color: #fff; background: #2a4562; border-color: #406185; }
.nav-icon { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #9fbbd9; border-radius: 4px; position: relative; }
.overview-icon::before, .overview-icon::after, .releases-icon::after, .devices-icon::after { position: absolute; content: ''; background: #9fbbd9; }
.overview-icon::before { width: 1px; height: 100%; left: 6px; }
.overview-icon::after { width: 100%; height: 1px; top: 6px; }
.releases-icon::after { width: 8px; height: 1px; top: 5px; left: 2px; box-shadow: 0 4px #9fbbd9; }
.devices-icon { height: 11px; border-radius: 3px; }
.devices-icon::after { width: 9px; height: 1.5px; bottom: -5px; left: 2px; }
.sidebar-logout { color: #bfcee0; text-align: left; margin-top: auto; }
.sidebar-logout:hover { color: white; background: #243d58; border-color: transparent; }
.main { padding: 41px clamp(20px, 3.6vw, 55px) 60px; width: 100%; max-width: 1600px; margin: 0 auto; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 30px; }
.top p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.top-actions, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric, .panel { background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 12px #172c4e05; }
.metric { padding: 20px; min-height: 116px; }
.metric dt { color: var(--muted); font-size: 14px; font-weight: 600; }
.metric dd { margin: 9px 0 0; font-weight: 740; font-size: clamp(26px, 2.6vw, 36px); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.metric:first-child { border-left: 3px solid #4d7ce7; }
.panels { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.panel { padding: 20px; min-width: 0; }
.panel-heading { min-height: 46px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.panel-heading p { margin-top: 5px; font-size: 13px; color: var(--muted); }
.panel-heading input, .panel-heading select { width: auto; max-width: 240px; }
.chart { height: 234px; position: relative; }
.chart canvas { width: 100%; height: 100%; display: block; }
.platforms, .history { display: grid; }
.platform-row, .history-row { padding: 13px 0; display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid #edf1f7; }
.platform-row:last-child, .history-row:last-child { border-bottom: 0; }
.platform-mark { width: 33px; height: 33px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; color: #2b57ae; background: #ebf1fe; font-weight: 750; font-size: 12px; }
.platform-row b { margin-left: auto; font-size: 13px; }
.history-row time { margin-left: auto; color: var(--muted); font-size: 13px; }
.muted, .empty { color: var(--muted); }
.empty { padding: 25px 6px; font-size: 14px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 670px; }
th, td { border-bottom: 1px solid #edf1f7; padding: 13px 10px; font-size: 14px; vertical-align: middle; }
th { font-size: 13px; font-weight: 650; background: #f5f7fb; color: var(--muted); white-space: nowrap; }
tbody:last-child tr:last-child td { border-bottom: 0; }
td button { min-height: 30px; padding: 0 8px; font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 660; border-radius: 6px; padding: 4px 8px; white-space: nowrap; background: #edf1f6; color: #4b617d; }
.tag-stable { background: #e1f5ee; color: #17654e; }
.tag-gray { background: #fff1d5; color: #765315; }
.tag-paused { background: #fcebea; color: #93433d; }
.secondary { color: var(--muted); display: block; margin-top: 4px; font-size: 12px; }
.notice { padding: 12px 15px; margin: 0 0 16px; background: #eaf2ff; border: 1px solid #cfe0ff; border-radius: 9px; color: #244991; }
.inline-error { color: #a23933; font-size: 14px; min-height: 20px; }

.login { max-width: 920px; margin: 13vh auto 30px; display: grid; grid-template-columns: 1.15fr 1fr; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 17px 50px #15315316; }
.login-copy { min-height: 430px; position: relative; overflow: hidden; padding: 40px; background: var(--navy); color: white; }
.login-copy h1 { margin-top: 66px; }
.login-copy p { margin-top: 13px; color: #c4d2e2; }
.login-lines { position: absolute; width: 285px; height: 285px; border-radius: 45px; border: 1px solid #a1bfd642; transform: rotate(-22deg); bottom: -166px; right: 5px; box-shadow: 0 0 0 23px #8bb7dc11, 0 0 0 46px #8bb7dc11, 0 0 0 69px #8bb7dc0c; }
.login-form { min-width: 0; background: white; padding: 45px; display: flex; flex-direction: column; gap: 13px; justify-content: center; }
.login-form h2 { font-size: 23px; margin-bottom: 12px; }
.login-form label { font-size: 14px; color: var(--muted); }
.login-form .primary { margin-top: 5px; }

dialog { padding: 0; width: min(502px, calc(100% - 36px)); border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 14px 60px #10264338; color: inherit; }
dialog::backdrop { background: #12283d66; }
dialog form { display: grid; gap: 14px; padding: 23px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 22px; }
.close { font-size: 23px; min-height: 31px; padding: 0 8px; line-height: 1; }
dialog label { display: grid; gap: 7px; font-size: 14px; font-weight: 620; color: var(--muted); }
dialog .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
dialog .check { display: flex; align-items: center; gap: 8px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; }
legend { font-size: 13px; color: var(--muted); }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 180px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { gap: 14px; padding: 14px; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .nav { min-height: 36px; padding: 0 8px; justify-content: center; }
  .nav-icon { display: none; }
  .sidebar-logout { align-self: flex-start; min-height: 32px; }
  .main { padding-top: 24px; }
  .top { align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
  .login { margin: 20px; grid-template-columns: 1fr; }
  .login-copy { padding: 25px; min-height: 215px; }
  .login-copy h1 { margin-top: 35px; }
  .login-form { padding: 25px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .001ms !important; } }
