/* Aperta Panel -- personel + bayi web paneli. Dış kaynak yok. */
:root {
  --bg: #f3f1ec; --surface: #ffffff; --surface2: #f6f5f1; --ink: #11201e;
  --muted: #5a6b69; --faint: #8b9896; --line: #e2e6e4; --accent: #0f766e;
  --accent-ink: #ffffff; --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --ok-bg: #e7f5ec; --warn-bg: #fdf3e2; --bad-bg: #fbeaea;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 18px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050f18; --surface: #0c1a24; --surface2: #10212d; --ink: #e6eef0;
    --muted: #93a6ad; --faint: #6c7f86; --line: #1c2c36; --accent: #2dd4bf;
    --accent-ink: #032321; --ok: #4ade80; --warn: #f5b84a; --bad: #f87171;
    --ok-bg: #0d2a1c; --warn-bg: #2d2208; --bad-bg: #2d1111; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* ---- üst çubuk + menü ---- */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1180px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.2px; }
.mark {
  width: 26px; height: 26px; border-radius: 50%; border: 4px solid var(--accent);
  border-top-color: transparent; transform: rotate(-30deg); flex: none;
}
.env { font-size: 11px; font-weight: 800; letter-spacing: .6px; color: var(--warn);
  background: var(--warn-bg); padding: 2px 7px; border-radius: 6px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 10px;
  font-weight: 600;
}
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; }
h1 { font-size: 24px; letter-spacing: -.4px; margin: 4px 0 14px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- kartlar, formlar ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 180px; }
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface2); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input { max-width: 340px; }
.grow { flex: 1; }

.msg { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-weight: 600; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: var(--surface2); color: var(--muted); font-weight: 500; }

/* ---- tablo (dar ekranda yatay kayar, sayfa kaymaz) ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 700; background: var(--surface2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
td select { min-width: 150px; padding: 6px 8px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.off { color: var(--faint); background: var(--surface2); }

.perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 14px; }
.perms label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; color: var(--ink);
  font-size: 14px; margin: 0; cursor: pointer; }
.perms input { width: auto; margin-top: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 12px; background: var(--surface2); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 6px; white-space: nowrap; }

/* ---- giriş ---- */
.login { max-width: 400px; margin: 9vh auto 0; }
.login h1 { margin-top: 18px; }
.login .btn { width: 100%; margin-top: 14px; }
.code { letter-spacing: 10px; font-size: 24px; text-align: center; font-weight: 800; }
.linkbtn { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; padding: 6px 0; }
.linkbtn:disabled { color: var(--faint); cursor: default; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); width: min(640px, calc(100vw - 32px)); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dlg-h { padding: 16px 18px 0; font-weight: 800; font-size: 17px; }
.dlg-b { padding: 14px 18px; display: grid; gap: 12px; }
.dlg-f { padding: 0 18px 16px; display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 640px) {
  .who span { display: none; }
  h1 { font-size: 21px; }
}
