:root {
  --bg: #0f1420;
  --bg-card: #1a2233;
  --bg-input: #111827;
  --border: #2a3548;
  --text: #e5e9f0;
  --muted: #8b95a7;
  --accent: #4f8cff;
  --green: #3ecf8e;
  --red: #ef6461;
  --yellow: #f2c94c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); margin-top: 10px; min-height: 1.2em; }

/* --- Login --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-box h1 { font-size: 24px; text-align: center; }
.login-box p { text-align: center; }

/* --- Formulare --- */
input, textarea, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary { background: var(--bg-input); border: 1px solid var(--border); }
.btn-danger { background: var(--red); }
.btn-small { padding: 5px 10px; font-size: 13px; }

/* --- Layout --- */
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
header h1 { font-size: 20px; }
nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
nav button {
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
}
nav button.active { background: var(--accent); color: #fff; }
nav button:hover:not(.active) { color: var(--text); background: var(--bg-input); }
.header-right { display: flex; align-items: center; gap: 12px; }
main { padding: 24px; max-width: 1200px; margin: 0 auto; }
h2 { margin-bottom: 16px; font-size: 18px; }
h3 { margin: 16px 0 8px; font-size: 15px; }

/* --- Carduri --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.card .label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.card .value { font-size: 20px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* --- Tabele --- */
table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.green { background: rgba(62, 207, 142, 0.15); color: var(--green); }
.badge.red { background: rgba(239, 100, 97, 0.15); color: var(--red); }
.badge.yellow { background: rgba(242, 201, 76, 0.15); color: var(--yellow); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.limit-input { width: 80px; padding: 5px 8px; font-size: 13px; }

/* --- Editor nginx --- */
#site-config-text {
  width: 100%;
  min-height: 400px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.editor-actions { display: flex; gap: 10px; margin: 12px 0; }

/* --- Loguri --- */
.log-controls { display: flex; gap: 10px; margin-bottom: 12px; }
#log-output {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  max-height: 600px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- Toast --- */
.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--green);
  color: var(--text);
  z-index: 100;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.toast.error-toast { border-color: var(--red); }

/* --- Disc --- */
.df-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 13px;
  white-space: pre;
  overflow-x: auto;
  margin-bottom: 16px;
}

@media (max-width: 700px) {
  main { padding: 14px; }
  header { gap: 10px; }
}
