/* hostpanel arayüzü — sade CSS, bağımlılık yok. Açık/koyu tema sistem tercihini izler. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9; --fg: #1d2330; --muted: #5b6475; --card: #fff; --line: #d9dde5;
  --accent: #1f5fbf; --accent-fg: #fff; --danger: #b42318; --ok: #1a7f37; --warn: #9a6700;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 100%; line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12151b; --fg: #e6e9ef; --muted: #9aa3b5; --card: #1b2029; --line: #2e3542;
          --accent: #6ea8fe; --accent-fg: #0b1220; --danger: #ff8a80; --ok: #6fdd8b; --warn: #f2cc60; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .75rem 1.25rem;
       background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); }
.top nav ul { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.logout { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.who { color: var(--muted); font-size: .9rem; }
main { max-width: 72rem; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
section + section { margin-top: 2.5rem; }
.meta, .hint { color: var(--muted); }
.hint { font-size: .9rem; margin: .25rem 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.narrow { max-width: 26rem; }
label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin: .35rem 0; }
input, select, textarea, button { font: inherit; font-size: max(1rem, 16px); }
input:not([type="checkbox"], [type="radio"]), select, textarea {
  width: 100%; max-width: 32rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--fg);
}
textarea { font-family: ui-monospace, monospace; font-size: .9rem; max-width: 100%; }
input.otp { font-family: ui-monospace, monospace; font-size: 1.25rem; letter-spacing: .35em; max-width: 12rem; min-height: 48px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: .75rem 0; padding: .5rem .9rem; max-width: 32rem; }
legend { font-weight: 600; padding: 0 .25rem; }
button { cursor: pointer; padding: .5rem 1rem; border-radius: 6px; border: 1px solid var(--accent);
         background: var(--accent); color: var(--accent-fg); min-block-size: 2.25rem; }
button:disabled { opacity: .6; cursor: progress; }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; min-block-size: auto; }
.actions button, .actions form { display: inline-block; margin: .15rem; padding: .3rem .7rem; }
.actions form { padding: 0; }
.inline-form { margin-top: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.inline-form h2, .inline-form h3 { margin-top: 0; }
.inline-form button[type="submit"] { margin-top: 1rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1rem; }
.grid-form h2, .grid-form .form-error, .grid-form button { grid-column: 1 / -1; justify-self: start; }
.buttons { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.form-error { color: var(--danger); margin: 0; }
.form-error:empty { display: none; }
.error-box { color: var(--danger); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
caption { text-align: start; padding: .75rem 1rem; color: var(--muted); }
th, td { text-align: start; padding: .6rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
td.empty { color: var(--muted); text-align: center; }
tbody[aria-busy="true"] { opacity: .6; }
tr.warn td { color: var(--warn); font-weight: 600; }
code { font-family: ui-monospace, monospace; font-size: .9em; overflow-wrap: anywhere; }
.verify { margin-top: .5rem; padding: .5rem .75rem; border-left: 3px solid var(--warn); }
.kv { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; margin: .25rem 0; }
.kv > span:first-child { color: var(--muted); min-width: 3rem; }
.secret-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
code.secret { font-size: 1.1rem; padding: .4rem .6rem; border: 1px dashed var(--line); border-radius: 6px; }

.copy { position: relative; display: inline-flex; align-items: center; gap: .4rem; }
.copy-button { padding: .2rem .6rem; min-inline-size: 24px; min-block-size: 24px; font-size: .85rem; }
.copy-button[data-copied] { background: var(--ok); border-color: var(--ok); }
.tip { font-size: .85rem; color: var(--muted); opacity: 1; transition: opacity .2s; }
.tip:empty { opacity: 0; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--fg);
         width: min(40rem, calc(100vw - 2rem)); padding: 1.25rem 1.5rem; }
dialog h2 { margin-top: 0; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(0 0 0 / .45); overflow: hidden; overscroll-behavior: contain; }

.toast { position: fixed; inset-inline: 1rem; inset-block-end: max(1rem, env(safe-area-inset-bottom)); margin-inline: auto;
         max-width: 36rem; padding: .75rem 1rem; border-radius: var(--radius); background: var(--fg); color: var(--bg);
         box-shadow: 0 6px 24px rgb(0 0 0 / .25); transition: opacity .2s; }
.toast:empty { opacity: 0; pointer-events: none; }
.toast[data-kind="error"] { background: var(--danger); color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
