:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #e5e5e5;
  background: #121212;
  font-size: 12px;
  font-synthesis: none;
  --muted: #aaa;
  --border: #393939;
  --blue: #347cb9;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button {
  color: #eee;
  background: #303030;
  border: 1px solid #555;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #414141; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #79b8ef;
  outline-offset: 2px;
}
button.primary { background: #245d90; border-color: #4687bf; }
button.danger { background: #64312c; border-color: #a1574d; }
input, select, textarea {
  color: #eee;
  background: #161616;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 8px;
  max-width: 100%;
}
textarea { width: 100%; resize: vertical; margin: 9px 0; }
label { display: block; }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
code { color: #b4cde7; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 11px; line-height: 1.6; }
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  z-index: 10;
  padding: 0 16px;
  background: #071b34;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1d2a3b;
}
.brand { font-weight: bold; font-size: 14px; white-space: nowrap; }
.brand span { color: #aab5c7; font-size: 11px; font-weight: normal; margin-left: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; font-size: 11px; }
.topbar button { background: transparent; border-color: #8899b0; padding: 3px 12px; }
.badge {
  display: inline-block;
  background: #3176b1;
  color: white;
  font-size: 10px;
  font-weight: bold;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge.warning { background: #a77800; }
.badge.ok, .badge.succeeded { background: #287d3f; }
.badge.error, .badge.failed { background: #aa3b30; }
.sidebar {
  position: fixed;
  top: 42px;
  bottom: 0;
  left: 0;
  width: 156px;
  background: #191919;
  border-right: 1px solid var(--border);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav button {
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  min-height: 35px;
}
.sidebar nav button.active { background: #2b2b2b; border-color: #3d3d3d; font-weight: bold; }
.nav-section { font-size: 9px; letter-spacing: 1px; color: #858585; padding: 16px 14px 5px; }
.sidebar-footer { margin-top: auto; padding: 25px 14px 5px; font-size: 10px; line-height: 1.8; color: #999; }
.sidebar-footer span { font-size: 9px; }
main { margin-left: 156px; padding: 58px 14px 18px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 16px; }
h1 { font-size: 17px; margin: 0; }
.page-heading > span { color: #939393; font-size: 10px; }
h2 { font-size: 12px; margin: 0; }
p { line-height: 1.7; margin: 10px 0; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 12px; }
.panel { background: #202020; border: 1px solid var(--border); border-radius: 12px; min-width: 0; overflow: hidden; }
.panel > h2 {
  background: #2b2b2b;
  border-bottom: 1px solid var(--border);
  border-radius: 11px 11px 9px 9px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-body { padding: 8px; overflow-wrap: anywhere; }
.dashboard-grid > .panel:nth-child(-n+4) { min-height: 375px; }
.dashboard-grid > .panel:nth-child(-n+4) .panel-body { max-height: 370px; overflow: auto; }
.dashboard-grid > .panel:nth-child(n+5) { min-height: 240px; }
.table-scroll { overflow: auto; max-height: 500px; }
table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
th { background: #313131; font-weight: bold; padding: 8px 6px; white-space: nowrap; }
td { padding: 9px 6px; border-bottom: 1px solid #3a3a3a; line-height: 1.5; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.kv td:first-child { color: #aaa; width: 39%; }
progress { display: block; width: 100%; height: 8px; border: 0; background: #343434; border-radius: 5px; overflow: hidden; accent-color: var(--blue); }
progress::-webkit-progress-bar { background: #343434; }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
progress.warning { accent-color: #c28a00; }
progress.warning::-webkit-progress-value { background: #c28a00; }
progress.warning::-moz-progress-bar { background: #c28a00; }
progress.danger { accent-color: #bd3a2c; }
progress.danger::-webkit-progress-value { background: #bd3a2c; }
progress.danger::-moz-progress-bar { background: #bd3a2c; }
.chart { display: block; width: 100%; height: 110px; background: #262626; border: 1px solid #404040; border-radius: 6px; margin-top: 8px; }
.chart:nth-of-type(2) { height: 90px; }
.chart path { fill: none; stroke-width: 1.3; }
.chart .gridline { stroke: #707070; stroke-width: .6; }
.cpu-line { stroke: #378ac7; }
.memory-line { stroke: #d49a00; }
.receive-line { stroke: #35b55a; }
.transmit-line { stroke: #d95646; }
.chart-legend { display: flex; gap: 12px; font-size: 9px; color: #999; margin-top: 5px; }
.chart-legend span:last-child { margin-left: auto; }
.cpu-key { color: #63a6dc; }
.memory-key { color: #deb44b; }
.receive-key { color: #6cbd84; }
.transmit-key { color: #e48175; }
.disk-usage { min-width: 90px; }
.disk-usage span { display: block; font-size: 10px; color: #c0c0c0; margin-top: 6px; }
.game-mini { border-bottom: 1px solid #3a3a3a; padding: 10px 0; }
.game-mini:last-child { border-bottom: 0; }
.game-mini strong { display: block; margin-bottom: 7px; }
.game-mini p { font-size: 10px; color: #aaa; }
.notice { background: #202938; color: #c5d8eb; border: 1px solid #3b5069; padding: 11px 13px; border-radius: 6px; margin-bottom: 14px; line-height: 1.7; }
.notice.error { background: #382321; border-color: #77463e; color: #f1b1a5; }
.notice.success { background: #23352a; border-color: #41684a; color: #bbdcc3; }
.notice.warning-notice { background: #352e1d; border-color: #665733; color: #dacb9b; }
.website-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.website-grid .panel-body { padding: 16px; }
.website-grid h3 { font-size: 11px; color: #aaa; text-transform: uppercase; margin-top: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 15px 0; }
.stat { background: #292929; border: 1px solid #3b3b3b; padding: 12px; border-radius: 5px; }
.stat strong { display: block; font-size: 23px; margin-bottom: 6px; }
.stat span { color: #aaa; font-size: 10px; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 0; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 15px; }
.toolbar label { display: flex; flex-direction: column; gap: 6px; }
.toolbar select { min-width: 180px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; border-top: 1px solid var(--border); padding: 10px; }
.database-table td { max-width: 320px; min-width: 110px; overflow-wrap: anywhere; }
.cell-button { text-align: left; width: 100%; min-height: 30px; background: transparent; border: 1px dashed #535353; padding: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cell-button:hover { border-color: #7ea3c6; }
.job-panel { margin-top: 18px; }
pre { margin: 0; color: #c4d9ca; background: #101410; padding: 15px; border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; min-height: 70px; font-size: 11px; }
.checkbox { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.checkbox input { margin: 0; }
.cores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 12px; }
.core-label { display: flex; justify-content: space-between; margin-bottom: 7px; }
.error-text { color: #efb0a4; line-height: 1.6; }
footer { color: #888; font-size: 9px; text-align: center; padding-top: 24px; }
.login-overlay { position: fixed; inset: 42px 0 0; z-index: 20; background: #121212f5; display: grid; place-items: center; padding: 20px; }
.login-card { background: #202020; border: 1px solid #414141; border-radius: 10px; padding: 28px; max-width: 430px; width: 100%; }
.login-card h1 { font-size: 21px; }
.login-card input { width: 100%; margin-top: 8px; }
.login-card button { margin-top: 10px; width: 100%; }
.login-card { max-height: calc(100vh - 85px); overflow: auto; }
.phone-body { padding: 24px 12px; }
.phone-card { margin: auto; padding: 24px; max-width: 620px; background: #202020; border: 1px solid #444; border-radius: 10px; }
.phone-card input:not([type=checkbox]) { width: 100%; margin: 10px 0; }
.phone-card section { margin: 25px 0; }
.verification-code { font: bold 32px ui-monospace, monospace; letter-spacing: 5px; text-align: center; }
#login-qr { display: block; margin: 18px auto 0; max-width: 100%; height: auto; border: 8px solid white; background: white; }
.phone-card a, .login-card a { color: #99c7ef; text-decoration: underline; }
dialog { background: #242424; color: #eee; border: 1px solid #555; border-radius: 10px; width: min(520px, calc(100% - 30px)); padding: 24px; }
dialog::backdrop { background: #000b; }
dialog h2 { font-size: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .dashboard-grid > .panel:nth-child(-n+4) { min-height: 300px; }
  .cores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { position: static; padding: 0 10px; height: 48px; }
  .brand span, .admin-label, #connection { display: none; }
  .topbar-actions { gap: 7px; }
  .sidebar { position: static; width: auto; padding: 5px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { flex-direction: row; overflow: auto; }
  .sidebar nav button { white-space: nowrap; padding: 8px 12px; }
  .nav-section, .sidebar-footer { display: none; }
  main { margin-left: 0; padding: 16px 10px; }
  .website-grid { grid-template-columns: 1fr; }
  .login-overlay { inset: 48px 0 0; }
  .page-heading { align-items: flex-start; }
  .page-heading > span { text-align: right; }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .panel { min-height: 0 !important; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar label { width: 100%; }
  .toolbar select { width: 100%; }
  .brand { font-size: 12px; }
}
