:root {
  --bg: #0f1720;
  --bg-soft: #172432;
  --surface: rgba(21, 33, 47, 0.72);
  --surface-strong: rgba(24, 39, 56, 0.95);
  --text: #e7edf4;
  --text-soft: #9db3c8;
  --accent: #29d5a7;
  --accent-2: #ffb35c;
  --danger: #ff6f61;
  --line: rgba(157, 179, 200, 0.2);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(41, 213, 167, 0.16), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(255, 179, 92, 0.14), transparent 60%),
    linear-gradient(180deg, #0f1720 0%, #0a1119 100%);
  z-index: -1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background: rgba(10, 17, 25, 0.55);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px rgba(41, 213, 167, 0.65);
}

.topnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: all .2s ease;
}

.topnav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.topnav a.active {
  border-color: rgba(41, 213, 167, 0.55);
  background: rgba(41, 213, 167, 0.14);
}

.page {
  max-width: 1280px;
  margin: 22px auto;
  padding: 0 16px 32px 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.animated {
  animation: riseIn 0.45s ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-head h1 {
  margin: 0;
}

.panel-head p {
  margin: 8px 0 0 0;
  color: var(--text-soft);
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 14px;
}

.card.metric {
  text-decoration: none;
  color: var(--text);
}

.metric-label {
  font-size: 14px;
  color: var(--text-soft);
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.metric-sub {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
}

.card.action {
  text-decoration: none;
  color: var(--text);
  transition: transform .2s ease, border-color .2s ease;
}

.card.action:hover {
  transform: translateY(-2px);
  border-color: rgba(41, 213, 167, 0.4);
}

.card.section h3 {
  margin-top: 0;
}

.warning-box {
  margin-top: 12px;
  border: 1px solid rgba(255, 179, 92, 0.45);
  background: rgba(255, 179, 92, 0.12);
  color: #ffd8a8;
  border-radius: 12px;
  padding: 10px 12px;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  border-color: rgba(41, 213, 167, 0.5);
  background: linear-gradient(135deg, rgba(41, 213, 167, 0.2), rgba(38, 165, 210, 0.2));
}

.btn-ghost {
  border-color: rgba(157, 179, 200, 0.4);
}

.btn-danger {
  border-color: rgba(255, 111, 97, 0.55);
  background: rgba(255, 111, 97, 0.12);
}

.btn-small {
  padding: 6px 9px;
  font-size: 12px;
}

.row {
  display: flex;
  align-items: center;
}

.wrap {
  flex-wrap: wrap;
}

.gap {
  gap: 8px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 10px;
  font-family: "Space Grotesk", sans-serif;
}

textarea.editor {
  width: 100%;
  min-height: 520px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-form.compact input[type="text"] {
  max-width: 180px;
}

.table-wrap {
  overflow: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-soft);
  font-weight: 600;
}

code {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 12px;
}

.flash-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.flash-success {
  border-color: rgba(41, 213, 167, 0.5);
  background: rgba(41, 213, 167, 0.12);
}

.flash-error {
  border-color: rgba(255, 111, 97, 0.55);
  background: rgba(255, 111, 97, 0.12);
}

.grid-center {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(460px, 96%);
}

.simple-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
}

.simple-list.numbered li {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .inline-form {
    flex-wrap: wrap;
  }
  table {
    min-width: 760px;
  }
}

select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 10px;
  font-family: "Space Grotesk", sans-serif;
}

small.muted,
.muted {
  color: var(--text-soft);
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.modal-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 21, 31, 0.95);
  color: var(--text);
  min-width: min(560px, 92vw);
  box-shadow: var(--shadow);
}

.modal-box::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.move-browser {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.move-dir-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logs-wrap {
  max-height: 72vh;
  min-height: 520px;
  overflow: auto;
}

.logs-table {
  min-width: 1200px;
}

.log-row {
  cursor: pointer;
}

.log-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ts-date {
  font-weight: 600;
}

.ts-time {
  color: var(--text-soft);
  font-size: 12px;
}

.log-details-cell {
  max-width: 540px;
  white-space: pre-line;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.logs-modal {
  width: min(980px, 96vw);
}

.log-detail-pre {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
