/* 22twórcy - logowanie i panel administratora (stonowana czerń / szarość) */
:root {
  --bg: #0b0b0b;
  --surface: #121212;
  --surface-2: #171717;
  --field: #1b1b1b;
  --field-focus: #202020;
  --border: #242424;
  --border-2: #303030;
  --text: #cdcdcd;
  --text-2: #9a9a9a;
  --muted: #666;
  --danger: #b87474;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: #eee; }
h1, h2, h3 { margin: 0; font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; }

/* ---------- formularze ---------- */
label { display: block; margin: 0 0 6px; font-size: 12px; color: var(--text-2); }
input[type="text"], input[type="password"], select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s, background-color .15s;
}
input[type="text"]:hover, input[type="password"]:hover, select:hover { border-color: var(--border-2); }
input[type="text"]:focus, input[type="password"]:focus, select:focus { border-color: #4a4a4a; background: var(--field-focus); }
input:disabled, button:disabled { opacity: .45; cursor: not-allowed; }
input::placeholder { color: #4a4a4a; }
input[type="file"] { font: inherit; font-size: 12px; color: var(--text-2); max-width: 100%; }
input[type="file"]::file-selector-button {
  margin-right: 10px; height: 32px; padding: 0 12px;
  background: #1f1f1f; color: var(--text); border: 1px solid var(--border-2); border-radius: var(--radius);
  font: inherit; cursor: pointer;
}
input[type="checkbox"] { accent-color: #8a8a8a; width: 15px; height: 15px; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  background: #1f1f1f; color: #d2d2d2;
  border: 1px solid var(--border-2); border-radius: var(--radius);
  font: 500 13px/1 var(--font); white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: #262626; border-color: #3a3a3a; color: #eee; }
.btn:focus-visible { outline: 2px solid #5a5a5a; outline-offset: 2px; }
.btn-block { width: 100%; height: 42px; margin-top: 16px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-ghost { background: transparent; }
.btn-primary { background: #2c2c2c; border-color: #3c3c3c; color: #ececec; }
.btn-primary:hover { background: #343434; }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: #1c1515; border-color: #4a3030; color: #d39494; }

.note {
  margin: 0 0 16px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-2); font-size: 13px;
}
.note.error { border-color: #3a2727; background: #181212; color: #cfa1a1; }
.note.ok    { border-color: #263228; background: #121713; color: #a6bfab; }
.note.warn  { border-color: #39331f; background: #17150f; color: #c7b78c; }
.note.info  { border-color: var(--border-2); }

/* ---------- logowanie ---------- */
body.auth {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-box {
  width: 100%; max-width: 340px;
  padding: 30px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.auth-box.center { text-align: center; }
.brand {
  display: inline-flex; align-items: baseline; gap: 1px;
  margin-bottom: 22px;
  font: 600 12px/1 var(--font); letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}
.brand b { font-weight: 600; color: var(--text-2); }
.auth-box h1 { margin-bottom: 22px; font-size: 17px; color: var(--text); }
.auth-box.center h1 { margin-bottom: 8px; }
.attempts {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 18px; font-size: 12px; color: var(--muted);
}
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #262626; }
.dots i.on { background: #6e6e6e; }
.auth-foot { margin: 18px 0 0; font-size: 11px; letter-spacing: .03em; color: #474747; text-align: center; }
.err-code { margin: 0 0 6px; font: 600 44px/1 var(--font); color: #3a3a3a; }

/* ---------- panel ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(11, 11, 11, .92);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.topbar-in {
  max-width: 1040px; height: 56px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .brand { margin: 0; }
.brand-sub {
  margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border-2);
  letter-spacing: .12em; color: #555; font-weight: 500;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }

.card { margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-h h2 { font-size: 14px; font-weight: 600; color: var(--text); }
.card-b { padding: 18px; }
.count {
  display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 6px;
  border-radius: 10px; background: #1e1e1e; color: var(--text-2);
  font-size: 11px; font-weight: 500; text-align: center;
}
.sub { margin: 22px 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.card-b > .sub:first-child { margin-top: 0; }
.sub .muted { font-weight: 400; }
.empty { margin: 0; padding: 28px 18px; color: var(--muted); text-align: center; }
.empty-s { margin: 0; color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span-2 { grid-column: span 2; }
.field.has-err input, .field.has-err select { border-color: #5a3434; }
.field-err { margin: 6px 0 0; font-size: 12px; color: var(--danger); }
.prefixed {
  display: flex; align-items: stretch; height: 40px;
  background: var(--field); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s;
}
.prefixed:focus-within { border-color: #4a4a4a; }
.prefixed span {
  display: flex; align-items: center; padding: 0 0 0 12px;
  color: var(--muted); white-space: nowrap; font-size: 13px;
}
.prefixed input { height: 38px; border: 0; background: transparent; padding-left: 2px; }
.prefixed input:focus { background: transparent; }
.avatar-field { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.label { display: block; margin: 0 0 6px; font-size: 12px; color: var(--text-2); }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day { position: relative; margin: 0; cursor: pointer; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day span {
  display: grid; place-items: center; min-width: 44px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--field); color: var(--muted); font-size: 12px; font-weight: 500;
  transition: background-color .15s, border-color .15s, color .15s;
}
.day:hover span { border-color: var(--border-2); }
.day input:checked + span { background: #2a2a2a; border-color: #444; color: #e2e2e2; }
.day input:focus-visible + span { outline: 2px solid #5a5a5a; outline-offset: 2px; }
.field.has-err .day span { border-color: #5a3434; }
.check { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; font-size: 13px; color: var(--text); cursor: pointer; }
.check.small { margin-top: 8px; font-size: 12px; color: var(--text-2); }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.av {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: #1c1c1c; border: 1px solid var(--border-2);
  filter: grayscale(.4);
}
.av-empty { display: grid; place-items: center; color: var(--text-2); font-weight: 600; }
.row-main { flex: 1; min-width: 0; }
.row-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text); font-weight: 500; }
.row-link { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.row-link:hover { color: var(--text-2); }
.row-meta { display: block; margin-top: 2px; font-size: 12px; color: #555; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
.badge {
  padding: 1px 7px; border: 1px solid var(--border-2); border-radius: 4px;
  font-size: 11px; font-weight: 500; color: var(--text-2);
}
.badge-off { border-color: #3a3324; color: #b5a47a; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  padding: 0 10px 8px 0; border-bottom: 1px solid var(--border);
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.tbl td { padding: 8px 10px 8px 0; border-bottom: 1px solid #1a1a1a; color: var(--text-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl form { margin: 0; }
.tag { font-size: 12px; }
.tag-ok { color: #93ad98; }
.tag-warn { color: #b7a77d; }
.tag-error { color: var(--danger); }
.tag-muted { color: var(--muted); }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; padding-left: 54px; }
  .tbl th:nth-child(1), .tbl td:nth-child(1) { white-space: nowrap; }
  .card-b { overflow-x: auto; }
}
