/* Shared PSH game-node UI polish.
   Page files keep their local layout rules; this layer makes the whole node panel
   feel like the frontend control plane. */
:root {
  --bg-color: #0b0f16;
  --panel-color: #101724;
  --text-color: #edf3ff;
  --accent: #58c76b;
  --secondary: #2484f2;
  --danger: #e5534b;
  --warning: #f0c84b;
  --muted: #a8b7cb;
  --border-radius: 8px;
  --chip-bg: #0c1320;
  --chip-border: #243049;
  --psh-bg: #0b0f16;
  --psh-surface: #101724;
  --psh-surface-2: #0d1420;
  --psh-border: #243049;
  --psh-border-soft: #1a263a;
  --psh-text: #edf3ff;
  --psh-muted: #a8b7cb;
  --psh-blue: #2484f2;
  --psh-blue-2: #1266d8;
  --psh-green: #58c76b;
  --psh-danger: #e5534b;
  --psh-radius: 8px;
  --psh-shadow: 0 18px 34px rgba(0, 0, 0, .28);
  --psh-admin-surface: #142238;
  --psh-admin-surface-2: #0f1c2f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--psh-bg);
}

body {
  min-height: 100vh;
  margin: 0 !important;
  color: var(--psh-text) !important;
  background:
    radial-gradient(900px 420px at 82% -12%, rgba(36, 74, 124, .32), transparent 62%),
    radial-gradient(720px 380px at 8% 8%, rgba(31, 90, 55, .16), transparent 58%),
    var(--psh-bg) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  line-height: 1.45;
  letter-spacing: 0 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(36, 132, 242, .38);
  color: #fff;
}

a {
  color: #5eb1ff;
  text-underline-offset: 3px;
  transition: color .16s ease, opacity .16s ease, background-color .16s ease, border-color .16s ease;
}

a:hover {
  color: #dceaff;
}

h1,
h2,
h3 {
  color: var(--psh-text);
  letter-spacing: 0;
}

.node-auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--psh-text);
  font-weight: 850;
}

.node-logo-mark {
  display: block;
  width: 86px;
  height: auto;
  border-radius: 0;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .28));
  transition: filter .2s ease, transform .2s ease;
}

.node-auth-brand:hover .node-logo-mark {
  filter: drop-shadow(0 0 12px rgba(88, 199, 107, .58)) drop-shadow(0 12px 20px rgba(0, 0, 0, .3));
  transform: translateY(-1px);
}

.sidebar-brand .node-logo-mark {
  width: 74px;
}

body > .node-auth-brand,
body > h1,
body > #formTitle {
  text-align: center;
}

body.auth-page {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px !important;
}

body.auth-page > .node-auth-brand,
body.auth-page > h1,
body.auth-page > #formTitle,
body.auth-page > form,
body.auth-page > footer {
  width: min(360px, 100%) !important;
}

body.auth-page > h1 {
  margin: 0 0 6px !important;
}

body.auth-page > #formTitle {
  margin-bottom: 18px !important;
  color: var(--psh-muted) !important;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto 22px !important;
  padding: 18px 0 0;
}

body > h1,
body > .node-auth-brand,
body > #formTitle,
body > form,
body > .quota-box,
body > .footer,
body > footer,
body > main,
body > #controls,
body > #commandBar,
body > #logContainer,
body > #fileList,
body > #statusBar {
  width: min(1160px, calc(100vw - 32px));
  margin-left: auto;
  margin-right: auto;
}

body > h1 {
  margin-top: 22px;
}

.panel,
.server,
.ticket,
.backup,
.plugin-card,
.ftb-card,
.quota-box,
#usageStats,
#fileList,
#commandBar,
#logContainer,
#adminPanel .panel,
form,
main.panel,
section.panel,
article.panel,
.status,
.reply,
.installed-item {
  border-color: var(--psh-border-soft) !important;
  border-radius: var(--psh-radius) !important;
  background: linear-gradient(180deg, rgba(18, 26, 40, .96), rgba(12, 18, 29, .96)) !important;
  box-shadow: var(--psh-shadow) !important;
}

body > form {
  border: 1px solid var(--psh-border-soft) !important;
}

.server,
.ticket,
.plugin-card,
.ftb-card,
.backup {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.server:hover,
.ticket:hover,
.plugin-card:hover,
.ftb-card:hover,
.backup:hover {
  border-color: rgba(94, 177, 255, .32) !important;
  transform: translateY(-1px);
}

#logContainer {
  background: #05080d !important;
  color: #8df89a !important;
  border-color: #20314b !important;
}

button,
.button,
.btn,
a.button,
header a,
#topActions a,
#topActions button,
#controls button,
#controls a,
#backBtn,
#sendCommandBtn,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px !important;
  border: 1px solid #2a3853 !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, var(--psh-blue), var(--psh-blue-2)) !important;
  color: #fff !important;
  font-weight: 750 !important;
  line-height: 1.1;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: transform .12s ease, filter .16s ease, border-color .16s ease, background-color .16s ease, opacity .16s ease;
}

button:hover,
.button:hover,
.btn:hover,
a.button:hover,
header a:hover,
#topActions a:hover,
#topActions button:hover,
#controls button:hover,
#controls a:hover,
#backBtn:hover,
#sendCommandBtn:hover {
  filter: brightness(1.06);
  text-decoration: none !important;
}

button:active,
.button:active,
.btn:active,
a.button:active {
  transform: translateY(1px);
}

button:disabled,
.button:disabled,
.btn:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: .58 !important;
  cursor: not-allowed !important;
  filter: none !important;
}

.danger,
.delete-btn,
.red,
button.red,
button.danger,
button[data-f="stop"],
button[data-f="delete"],
#logoutBtn {
  background: linear-gradient(180deg, #d94f47, #a22f2a) !important;
  border-color: #92312c !important;
  color: #fff !important;
}

.success,
.green,
.download-btn,
button.green,
button.success,
button[data-f="start"],
button[data-f="ramSave"],
#backupNowBtn,
#addOpBtn,
#adminPanel a {
  background: linear-gradient(180deg, #5ac66d, #2f9440) !important;
  border-color: #287b35 !important;
  color: #fff !important;
}

.warning,
.gold,
button.gold,
.extract-btn,
#abortUploadBtn,
button[data-f="backups"] {
  background: linear-gradient(180deg, #f0c84b, #b47a16) !important;
  border-color: #9b6812 !important;
  color: #151515 !important;
}

.copy-btn,
.rename-btn,
button.secondary,
.secondary,
a.secondary,
button.small,
.small,
#backBtn,
#reloadBtn,
#clearBtn,
#togglePassword,
button[data-copy],
button[data-f="copy"],
button[data-f="logs"],
button[data-f="files"],
button[data-f="motd"],
button[data-f="properties"],
button[data-f="players"],
button[data-f="sftp"] {
  background: linear-gradient(180deg, #1a2437, #111a2a) !important;
  border-color: #2a3853 !important;
  color: #fff !important;
}

.edit-btn,
button[data-f="motd"] {
  background: linear-gradient(180deg, #338fe8, #1e5fae) !important;
  border-color: #245d9b !important;
  color: #fff !important;
}

button[onclick^="moveEntry"] {
  background: linear-gradient(180deg, #2e9fbb, #1b647a) !important;
  border-color: #205e73 !important;
  color: #fff !important;
}

.rename-btn,
button[data-f="properties"],
button[data-f="players"] {
  background: linear-gradient(180deg, #7459d9, #4d3298) !important;
  border-color: #4e3a8d !important;
  color: #fff !important;
}

.copy-btn,
button[data-f="copy"],
button[data-copy] {
  background: linear-gradient(180deg, #53657d, #334157) !important;
  border-color: #43536b !important;
  color: #fff !important;
}

.swatch {
  min-width: 34px !important;
  padding: 0 !important;
  background: var(--swatch-color, #55ff55) !important;
}

.template-card {
  background: linear-gradient(180deg, #142035, #0d1524) !important;
  border-color: #263852 !important;
  color: var(--psh-text) !important;
}

input,
select,
textarea,
input[type="file"] {
  border: 1px solid #2a3853 !important;
  border-radius: 8px !important;
  background-color: #0c1320 !important;
  color: var(--psh-text) !important;
  box-shadow: none !important;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 40px;
}

input::placeholder,
textarea::placeholder {
  color: #7f8ea5;
  opacity: 1;
}

label {
  color: var(--psh-muted) !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: rgba(94, 177, 255, .9) !important;
  box-shadow: 0 0 0 3px rgba(36, 132, 242, .18) !important;
}

.muted,
.restart-meta,
.meta,
#statusBar,
#commandStatus,
.footer,
footer {
  color: var(--psh-muted) !important;
}

.status,
#status,
#commandStatus,
#statusBar,
.error-msg,
.success-msg {
  font-size: .92rem;
  line-height: 1.45;
}

.status.error,
#status.error,
#commandStatus.error,
#statusBar.error,
.error,
.error-msg {
  color: #ffb7b2 !important;
  border-color: rgba(229, 83, 75, .42) !important;
  background: rgba(70, 18, 20, .72) !important;
}

.status.success,
#status.success,
#commandStatus.success,
#statusBar.success,
.success-msg {
  color: #a6f4b2 !important;
  border-color: rgba(88, 199, 107, .4) !important;
  background: rgba(14, 50, 26, .72) !important;
}

.pill,
.address code,
code {
  border: 1px solid var(--chip-border) !important;
  border-radius: 999px;
  background: var(--chip-bg) !important;
  color: #d8e7fb;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-color: var(--psh-border-soft) !important;
}

progress {
  accent-color: var(--psh-blue);
}

footer,
.footer {
  text-align: center;
  margin-top: 44px !important;
  padding-bottom: 28px;
}

body.dashboard-page {
  padding: 0 !important;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid rgba(36, 48, 73, .78);
  background:
    linear-gradient(180deg, rgba(16, 23, 36, .98), rgba(9, 15, 24, .98)),
    var(--psh-surface);
  box-shadow: 18px 0 35px rgba(0, 0, 0, .18);
}

.sidebar-brand {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.sidebar-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--psh-border-soft);
  border-radius: var(--psh-radius);
  background: linear-gradient(180deg, rgba(20, 34, 56, .72), rgba(10, 18, 30, .8));
}

.sidebar-label {
  color: #9cff9c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-actions {
  display: grid;
  gap: 8px;
}

.side-actions a,
.admin-actions a {
  width: 100%;
  justify-content: flex-start;
}

.admin-actions {
  display: none;
  border-color: rgba(88, 199, 107, .32);
  background: linear-gradient(180deg, rgba(18, 60, 32, .4), rgba(13, 28, 45, .78));
}

.admin-actions p {
  margin: 0;
  color: var(--psh-muted);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-sidebar footer {
  width: auto;
  margin-top: auto !important;
  padding-bottom: 0;
  font-size: 12px;
}

.dashboard-main {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 34px) 40px;
}

.dashboard-topbar {
  width: 100%;
  margin: 0 0 22px !important;
  padding: 0;
}

.dashboard-topbar h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
}

#userSection {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--psh-border-soft);
  border-radius: var(--psh-radius);
  background: rgba(12, 19, 32, .78);
}

#userDisplay {
  color: var(--psh-muted);
  font-weight: 800;
}

body.dashboard-page #usageStats {
  width: 100%;
  margin: 0 0 18px;
  border-color: rgba(94, 177, 255, .24) !important;
  background: linear-gradient(180deg, rgba(20, 34, 56, .85), rgba(13, 23, 38, .9)) !important;
}

body.dashboard-page #servers {
  display: grid;
  gap: 16px;
}

body.dashboard-page .server {
  margin-bottom: 0;
  border-color: rgba(94, 177, 255, .18) !important;
  background: linear-gradient(180deg, rgba(17, 29, 48, .98), rgba(10, 18, 30, .98)) !important;
}

body.dashboard-page .server h2 {
  margin-top: 0;
  font-size: 22px;
}

.summary-item,
.user-entry,
#nodeHealth .card,
#nodeUsers .card,
#userList .card,
#portList .card {
  border-color: rgba(94, 177, 255, .22) !important;
  background: linear-gradient(180deg, var(--psh-admin-surface), var(--psh-admin-surface-2)) !important;
}

.summary-item strong {
  color: #ffffff;
}

@media (max-width: 980px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(36, 48, 73, .78);
  }

  .side-actions {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    padding: 16px !important;
  }

  header {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-main {
    padding: 18px 14px 32px;
  }

  #userSection {
    width: 100%;
    justify-content: space-between;
  }

  body > h1,
  body > .node-auth-brand,
  body > #formTitle,
  body > form,
  body > .quota-box,
  body > .footer,
  body > footer,
  body > main,
  body > #controls,
  body > #commandBar,
  body > #logContainer,
  body > #fileList,
  body > #statusBar {
    width: 100%;
  }

  #topActions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  #topActions a,
  #topActions button,
  #controls button,
  #controls a {
    margin-right: 0 !important;
  }
}
