/* ==========================================================================
   NAQUTH Panel — Pterodactyl-inspired theme
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --navbar: #101a2c;
  --sidebar: #16233a;
  --bg: #0b1120;
  --card: #17233a;
  --card-alt: #1c2a44;
  --border: #24324c;
  --border-soft: #1e2a40;

  --text: #e6ebf5;
  --text-dim: #a7b3c9;
  --muted: #7488a6;
  --muted-2: #526181;

  --brand: #0f52e5;
  --brand-light: #4f83f0;
  --brand-soft: rgba(15, 82, 229, 0.16);

  --green: #23c268;
  --green-soft: rgba(35, 194, 104, 0.15);
  --red: #f0454c;
  --red-soft: rgba(240, 69, 76, 0.15);
  --amber: #f0a63a;
  --amber-soft: rgba(240, 166, 58, 0.15);
  --cyan: #2bb8c4;
  --cyan-soft: rgba(43, 184, 196, 0.15);

  --radius-lg: 4px;
  --radius-md: 3px;
  --radius-sm: 3px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.4);
  --shadow-pop: 0 16px 46px -12px rgba(0,0,0,.65);
  --ease: cubic-bezier(.4,0,.2,1);
}

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b3a56; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4c6e; background-clip: padding-box; }

/* ==========================================================================
   Login
   ========================================================================== */

.login-screen {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; padding: 20px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(15,82,229,.14), transparent 60%),
    var(--bg);
}

.login-card {
  width: 100%; max-width: 380px;
  padding: 38px 34px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

.login-card .logo {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  margin-bottom: 20px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 20px; font-weight: 900;
}

.login-card h1 { margin: 0; font-size: 21px; font-weight: 700; }
.login-card p { margin: 7px 0 26px; color: var(--muted); font-size: 13px; }

.login-card form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.login-card input {
  width: 100%; padding: 11px 13px;
  outline: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0d1526;
  color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.login-card input::placeholder { color: var(--muted-2); }
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.login-card button {
  margin-top: 4px; padding: 11px;
  border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: 13.5px;
  text-transform: uppercase; letter-spacing: .03em;
  transition: background .12s var(--ease);
}
.login-card button:hover { background: var(--brand-light); }

#login-error { min-height: 18px; margin-top: 14px; color: var(--red); font-size: 12.5px; text-align: center; }
.login-foot { margin: 0; color: var(--muted-2); font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; }

/* ==========================================================================
   Navbar
   ========================================================================== */

.pd-navbar {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--navbar);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 30;
}
.pd-navbar-left { display: flex; align-items: center; gap: 10px; }
.pd-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.pd-brand-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 900; font-size: 12.5px;
}
.pd-crumb-sep { color: var(--muted-2); font-size: 13px; }
.pd-crumb { color: var(--text-dim); font-size: 13px; font-weight: 500; }

.pd-navbar-right { display: flex; align-items: center; gap: 14px; }
.pd-conn {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 99px;
  color: var(--red); background: var(--red-soft);
}
.pd-conn.online { color: var(--green); background: var(--green-soft); }

.pd-icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text-dim);
  transition: background .12s var(--ease), color .12s var(--ease);
}
.pd-icon-btn svg { width: 15px; height: 15px; }
.pd-icon-btn:hover { background: var(--card-alt); color: #fff; }
.pd-icon-btn:active svg { transform: rotate(180deg); }

.pd-user {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-light);
  font-weight: 700; font-size: 12.5px;
}

/* ==========================================================================
   Body / Sidebar / Main shell
   ========================================================================== */

.pd-body { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  width: 230px;
  flex: 0 0 auto;
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  padding: 18px 12px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.sidebar-server {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.sidebar-server strong { display: block; font-size: 12.5px; font-weight: 650; }
.sidebar-server small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.nav-group { display: flex; flex-direction: column; gap: 1px; }

.nav {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0; border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  text-align: left;
  transition: background .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);
}
.nav svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: .8; }
.nav:hover:not(.nav-disabled) { background: var(--card-alt); color: var(--text-dim); }
.nav.active { background: var(--brand-soft); color: #fff; border-left-color: var(--brand); }
.nav.active svg { opacity: 1; color: var(--brand-light); }
.nav-disabled { opacity: .38; cursor: not-allowed; }

/* ==========================================================================
   Main
   ========================================================================== */

.main {
  flex: 1;
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 40px) 60px;
  max-width: 1180px;
}

/* ==========================================================================
   Overview
   ========================================================================== */

.server-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color .2s var(--ease);
}
.server-card:has(.dot.online) { border-left-color: var(--green); }
.server-status { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.server-status strong { font-weight: 650; }
.server-card p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
#uptime { color: var(--text-dim); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

.dot {
  width: 8px; height: 8px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.dot.online { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-top: 12px;
}
.stat {
  display: flex; gap: 13px;
  padding: 16px 17px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .15s var(--ease);
}
.stat:hover { border-color: #33456a; }

.stat-icon {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon-cpu { background: var(--brand-soft); color: var(--brand-light); }
.stat-icon-ram { background: var(--cyan-soft); color: var(--cyan); }
.stat-icon-disk { background: var(--amber-soft); color: var(--amber); }
.stat-icon-temp { background: var(--red-soft); color: var(--red); }

.stat-body { flex: 1; min-width: 0; }
.stat-body > span { display: block; color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.stat-body strong { display: block; margin-top: 6px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-body small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }

.bar { height: 5px; margin-top: 10px; overflow: hidden; background: #202c46; border-radius: 99px; }
.bar i {
  display: block; width: 0; height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width .35s var(--ease);
}
#ram-bar { background: var(--cyan); }
#storage-bar { background: var(--amber); }

.section { margin-top: 28px; }
.section-title h2, .page-heading h2 { margin: 0; font-size: 15.5px; font-weight: 700; }
.section-title p, .page-heading p { margin: 4px 0 14px; color: var(--muted); font-size: 12.5px; }

.service {
  display: grid;
  grid-template-columns: minmax(220px,1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.service-info { display: flex; align-items: center; gap: 13px; }
.service-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand-light);
  font-weight: 700; font-size: 14px;
}
.service-info h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.service-sub { display: flex; align-items: center; gap: 9px; margin-top: 6px; color: var(--muted); font-size: 11px; }

.pill { padding: 3px 9px; border-radius: 99px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pill.online { background: var(--green-soft); color: var(--green); }
.pill.offline { background: var(--red-soft); color: var(--red); }

.service-metrics { display: flex; gap: 26px; }
.service-metrics small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.service-metrics strong { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }

.actions { display: flex; gap: 7px; }
.actions button svg { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }

.actions button, .file-actions button, .file-toolbar button, .editor-head button, .upload-button {
  display: inline-flex; align-items: center;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-alt);
  color: var(--text-dim);
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .02em;
  transition: background .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);
}
.actions button:hover, .file-actions button:hover, .file-toolbar button:hover, .editor-head button:hover, .upload-button:hover {
  background: #24314c; color: #fff; border-color: #384c72;
}
.actions .primary, .file-actions .primary, .editor-head .primary {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.actions .primary:hover, .editor-head .primary:hover { background: var(--brand-light); }
.actions .danger { color: var(--red); }
.actions .danger:hover { background: var(--red-soft); border-color: rgba(240,69,76,.3); color: var(--red); }

/* ==========================================================================
   Page heading / toolbars
   ========================================================================== */

.page-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 14px; flex-wrap: wrap;
}
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-button { cursor: pointer; }
.upload-button input { display: none; }

/* ==========================================================================
   Console (real terminal look)
   ========================================================================== */

.console-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #05070c;
  box-shadow: var(--shadow-card);
}
.console-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px;
  background: #10131a;
  border-bottom: 1px solid #1a1e28;
}
.tl-dot { width: 10px; height: 10px; border-radius: 50%; }
.tl-red { background: #ff5f57; }
.tl-amber { background: #febc2e; }
.tl-green { background: #28c840; }
.console-title { margin-left: 8px; color: #6b7280; font-size: 11.5px; font-family: 'Source Code Pro', monospace; }

.console-output {
  height: 480px;
  overflow: auto;
  padding: 16px 18px;
  font: 12.5px/1.7 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  background: #05070c;
}
.console-line { margin-bottom: 12px; }
.console-command { color: #56d364; margin-bottom: 2px; }
.console-command::before { content: ''; }
.console-stdout { color: #c9d1d9; }
.console-stderr { color: #ff7b72; }
.console-muted { color: #4a5568; }

.console-tools {
  display: flex; justify-content: flex-end;
  padding: 7px 10px;
  background: #0a0d13;
  border-top: 1px solid #1a1e28;
}
.console-tools button { padding: 6px 10px; border: 1px solid #232936; border-radius: var(--radius-sm); background: #151a24; color: var(--text-dim); font-size: 10.5px; text-transform: uppercase; font-weight: 600; }
.console-tools button:hover { background: #1c2330; color: #fff; }

.console-form { display: flex; align-items: center; border-top: 1px solid #1a1e28; background: #05070c; padding-left: 14px; }
.console-prompt { color: #56d364; font: 13px 'Source Code Pro', monospace; }
.console-form input {
  flex: 1; min-width: 0;
  padding: 14px 10px;
  border: 0; outline: 0;
  background: transparent;
  color: #e6edf3;
  font: 12.5px 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
}
.console-form input::placeholder { color: #4a5568; }
.console-form button {
  padding: 0 20px; height: 100%; border: 0;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .03em;
  align-self: stretch;
}
.console-form button:hover { background: var(--brand-light); }

.warning {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
  padding: 10px 13px;
  background: var(--amber-soft);
  border: 1px solid rgba(240,166,58,.25);
  border-radius: var(--radius-sm);
  color: #e0b56b;
}

/* ==========================================================================
   File Manager
   ========================================================================== */

.file-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.file-toolbar span {
  flex: 1; color: var(--text-dim);
  font: 12px 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.file-list-head {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 90px 170px 190px;
  gap: 10px;
  padding: 9px 14px;
  background: #101a2c;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--muted);
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.file-list-head .file-size, .file-list-head .file-date { text-align: right; }

.file-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--card);
}
.file-row {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 90px 170px 190px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
  transition: background .1s var(--ease);
}
.file-row:nth-child(even) { background: rgba(255,255,255,.012); }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--card-alt); }
.file-row > div:first-child { color: var(--brand-light); text-align: center; font-size: 13px; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-size, .file-date { color: var(--muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }

.file-actions-row { display: flex; justify-content: flex-end; gap: 5px; }
.file-actions-row button {
  padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-alt); color: var(--text-dim); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase;
}
.file-actions-row button:hover { background: #24314c; color: #fff; }
.file-actions-row .delete { color: var(--red); }
.file-actions-row .delete:hover { background: var(--red-soft); color: var(--red); }

.empty { padding: 40px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ==========================================================================
   Editor
   ========================================================================== */

.editor {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #05070c;
  box-shadow: var(--shadow-card);
}
.editor-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #10131a;
  border-bottom: 1px solid #1a1e28;
}
.editor-head span {
  font: 12px 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.editor-head div { display: flex; gap: 6px; }
.editor textarea {
  display: block; width: 100%; min-height: 420px;
  padding: 16px;
  border: 0; outline: 0; resize: vertical;
  background: #05070c;
  color: #d7dde5;
  font: 12.5px/1.65 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ==========================================================================
   Toast / Footer
   ========================================================================== */

#toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  padding: 12px 16px;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
#toast.show { opacity: 1; transform: translateY(0); }

footer {
  margin-top: 40px;
  padding-bottom: 10px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .pd-brand-text { display: none; }
  .sidebar { width: 64px; padding: 16px 8px; position: static; height: auto; }
  .sidebar-server div { display: none; }
  .sidebar-server { justify-content: center; }
  .nav { justify-content: center; padding: 11px; border-left: none; border-radius: var(--radius-sm); }
  .nav span:last-child { display: none; }
  .nav.active { border-left: none; }
  .pd-body { flex-direction: row; }
  .main { padding: 20px 16px 50px; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .service { grid-template-columns: 1fr; }
  .page-heading { display: block; }
  .file-actions { margin-bottom: 12px; }
  .file-row, .file-list-head { grid-template-columns: 26px minmax(0,1fr) 70px 120px; }
  .file-date { display: none; }
}

@media (max-width: 560px) {
  .pd-crumb-sep, .pd-crumb { display: none; }
  .main { padding: 16px 12px 44px; }
  .stats { grid-template-columns: 1fr; }
  .server-card { padding: 16px; flex-wrap: wrap; gap: 10px; }
  .service-metrics { justify-content: space-between; gap: 12px; }
  .actions { flex-wrap: wrap; }
  .file-row, .file-list-head { grid-template-columns: 22px minmax(0,1fr) 64px; }
  .file-size { display: none; }
  .file-actions-row { grid-column: 2; }
  .console-output { height: 400px; }
  .editor textarea { min-height: 320px; }
  #toast { left: 14px; right: 14px; bottom: 14px; }
}
