/* Nefel Destek Konsolu — sayfanın tek stil dosyası (P20). Satır içi stil yok (CSP: style-src 'self'). */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5f6b7a;
  --border: #d5dbe3;
  --accent: #1f6f43;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --warn-bg: #fff4d6;
  --warn-border: #e2b23c;
  --error-bg: #fde8e7;
  --ok-bg: #e5f4ea;
  --online: #1f7a3f;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b212a;
    --text: #e6eaf0;
    --muted: #9aa5b4;
    --border: #2f3946;
    --accent: #3fa36b;
    --accent-text: #0b1210;
    --danger: #f2827a;
    --warn-bg: #3a3017;
    --warn-border: #a9852c;
    --error-bg: #3b1d1b;
    --ok-bg: #173022;
    --online: #5cc98a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[hidden] { display: none !important; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.bar h1 { margin: 0; font-size: 18px; }

.user { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 48px; }

h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

label { display: block; margin-bottom: 12px; font-weight: 500; }

input, select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  font: inherit;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button[type="submit"], button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { background: var(--danger); border-color: var(--danger); color: #ffffff; }
button.link, a.link { background: none; border: none; padding: 4px 6px; color: var(--accent); text-decoration: underline; }
button.link.danger { color: var(--danger); background: none; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* NefelLink'e giden bağlantı düğme gibi (giriş ekranı). */
a.button { display: inline-block; padding: 7px 14px; border-radius: 6px; background: var(--accent); color: var(--accent-text); text-decoration: none; }
a.button:focus-visible, a.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
td.actions { margin: 0; }

input.search { max-width: 360px; margin: 0 0 12px; }

.inline { display: flex; gap: 8px; margin-bottom: 16px; }
.inline input { margin-top: 0; }
.inline button { white-space: nowrap; }
.inline label { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-weight: 400; }
.inline input[type="checkbox"] { width: auto; }

.alert { padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; border: 1px solid var(--border); }
.alert.error { background: var(--error-bg); border-color: var(--danger); }
.alert.warn, .card.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.alert.ok { background: var(--ok-bg); border-color: var(--online); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 14px; }
.tabs button.active { border-bottom-color: var(--accent); font-weight: 600; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr.revoked td { color: var(--muted); }
td.online { color: var(--online); font-weight: 600; }
td.offline { color: var(--muted); }

.logs td { font-size: 13px; vertical-align: top; }
.logs td:first-child { white-space: nowrap; }
.log-message { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; }
td.level.warning { color: var(--warn-border); font-weight: 600; }
td.level.error, td.level.critical { color: var(--danger); font-weight: 600; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); }
.chip.warn { background: var(--warn-bg); border-color: var(--warn-border); }

code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
code.secret, .credentials code { font-size: 18px; letter-spacing: 1px; user-select: all; word-break: break-all; }

.request { border-color: var(--accent); border-width: 2px; }
.status { font-size: 16px; font-weight: 500; }
.credentials { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: center; margin: 12px 0; }
.credentials dt { color: var(--muted); }
.credentials dd { margin: 0; }

dialog {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  width: min(460px, 92vw);
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.45); }

@media (max-width: 760px) {
  main { padding: 12px; }
  .inline { flex-direction: column; }
  th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5) { display: none; }
}
