:root {
  --bg: #0f1115;
  --card: #181b22;
  --card2: #20242e;
  --fg: #eef1f6;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --accent2: #2f6fe0;
  --danger: #ff5d5d;
  --ok: #36c275;
  --border: #2a2f3a;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 18px 16px 40px; }
.center-narrow { max-width: 460px; }

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: .95rem; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: none;
  padding: 14px 18px; border-radius: 12px; font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none; width: 100%;
  transition: background .15s ease, transform .05s ease;
}
.btn:hover { background: var(--accent2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--card2); color: var(--fg); border: 1px solid var(--border); }
.btn.secondary:hover { background: #2a2f3a; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--fg); }
.btn-row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .btn-row.cols { grid-template-columns: 1fr 1fr; } }

label { display: block; font-size: .9rem; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], select {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card2); color: var(--fg);
  font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.msg { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: .95rem; display: none; }
.msg.show { display: block; }
.msg.ok { background: rgba(54,194,117,.15); border: 1px solid var(--ok); color: #b9f3d2; }
.msg.err { background: rgba(255,93,93,.13); border: 1px solid var(--danger); color: #ffc9c9; }
.msg.info { background: rgba(79,140,255,.12); border: 1px solid var(--accent); color: #cfe0ff; }

.hidden { display: none !important; }

/* Galerie-Raster */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.tile {
  position: relative; aspect-ratio: 1/1; overflow: hidden;
  border-radius: 10px; background: var(--card2); cursor: pointer;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .del {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6);
  color: #fff; border: none; border-radius: 8px; width: 30px; height: 30px;
  font-size: 1rem; cursor: pointer; line-height: 1;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
.lightbox .close {
  position: absolute; top: 14px; right: 18px; color: #fff; font-size: 2rem;
  background: none; border: none; cursor: pointer;
}

/* Footer */
.site-footer {
  margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .8rem; text-align: center;
}
.site-footer a { color: var(--muted); }

.pill { font-size: .8rem; color: var(--muted); }
.count { color: var(--muted); font-size: .9rem; margin: 8px 0; }

table.albums { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.albums th, table.albums td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
table.albums td .mini { width: auto; padding: 7px 10px; font-size: .82rem; }

.maintenance { text-align: center; padding: 60px 20px; }
.maintenance .big { font-size: 3rem; }
