:root {
  color-scheme: dark;
  --bg: #090a0d;
  --panel: #12151b;
  --panel2: #191e27;
  --line: #292f3a;
  --text: #f3f4f7;
  --muted: #929baa;
  --accent: #b8a0ff;
  --danger: #ff7373;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 50% -15%, #29243d 0, transparent 48%), var(--bg);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px,5vw,76px);
  border-bottom: 1px solid #ffffff0c;
  position: sticky;
  top: 0;
  background: #090a0de8;
  backdrop-filter: blur(20px);
  z-index: 10;
}
.brand { font-weight: 900; letter-spacing: .19em; font-size: 19px; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 24px; color: var(--muted); font-size: 13px; }
nav a:hover { color: white; }
main { max-width: 1600px; margin: auto; padding: 0 clamp(16px,4vw,60px) 72px; }
.hero { padding: 76px 0 32px; }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .25em; font-weight: 800; }
.hero h1 { font-size: clamp(38px,6vw,76px); line-height: 1.03; letter-spacing: -.06em; margin: 12px 0; }
.muted { color: var(--muted); }
.chips { display: flex; gap: 9px; overflow-x: auto; padding: 8px 0 25px; scrollbar-width: thin; }
.chip {
  white-space: nowrap; border: 1px solid var(--line); border-radius: 99px;
  padding: 9px 15px; color: #c8cbd5; font-size: 12px; transition: .2s;
}
.chip:hover { border-color: var(--accent); color: white; background: #b8a0ff12; }
.chip small { color: var(--muted); margin-left: 4px; }
.masonry { columns: 4 230px; column-gap: 16px; }
.tile {
  display: block; position: relative; width: 100%; padding: 0; margin: 0 0 16px;
  border: 1px solid #ffffff0a; border-radius: 13px; overflow: hidden;
  background: var(--panel); cursor: zoom-in; break-inside: avoid;
  text-align: left; color: white;
}
.tile img {
  display: block; width: 100%; height: auto; min-height: 100px;
  object-fit: cover; transition: transform .5s, opacity .3s;
}
.tile:hover img { transform: scale(1.045); opacity: .85; }
.tile span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 38px 14px 13px; background: linear-gradient(transparent,#000c);
  font-size: 12px; opacity: 0; transition: opacity .2s;
}
.tile:hover span { opacity: 1; }
.empty {
  padding: 75px 20px; text-align: center; border: 1px dashed var(--line);
  border-radius: 18px; color: var(--muted);
}
.empty-icon { font-size: 44px; color: #55516d; }
.empty h2 { color: var(--text); }
.button {
  border: 0; border-radius: 10px; background: var(--accent); color: #171222;
  padding: 12px 18px; font-weight: 800; cursor: pointer; display: inline-block;
  transition: transform .2s, filter .2s;
}
.button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.card {
  background: linear-gradient(145deg,#171a22,#101218);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin: 18px 0;
}
.card h2 { font-size: 18px; margin: 0 0 18px; }
.login { max-width: 460px; margin: 70px auto; }
.login h1 { font-size: 32px; letter-spacing: -.04em; }
form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #c8ccd5; font-size: 12px; }
input:not([type=checkbox]):not([type=file]), select {
  width: 100%; background: #0b0d12; border: 1px solid #343a48;
  border-radius: 9px; padding: 12px; color: var(--text); font: inherit; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input[type=file] {
  width: 100%; padding: 20px; border: 1px dashed #55516d;
  border-radius: 11px; background: #0b0d12; color: var(--muted);
  cursor: pointer; transition: .2s;
}
input[type=file]:hover, input[type=file].dragover {
  border-color: var(--accent); background: #b8a0ff12;
}
.check { display: flex; align-items: center; gap: 10px; }
.check input { accent-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 12px 0 22px; }
.stat { padding: 19px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat b { display: block; font-size: 26px; margin-top: 6px; overflow-wrap: anywhere; }
.adminhero { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.adminhero .eyebrow { width: 100%; margin-bottom: -10px; }
.adminhero h1 { margin-right: auto; }
.small {
  background: #242936; color: #e5e7eb; border: 1px solid #3a4050;
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 12px;
}
.small:hover { border-color: var(--accent); }
.danger { color: var(--danger); }
.tablewrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; min-width: 440px; }
th,td { text-align: left; padding: 11px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.mini { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; }
footer { border-top: 1px solid #ffffff0d; text-align: center; padding: 24px; color: #626979; font-size: 11px; }
.lightbox {
  position: fixed; inset: 0; background: #050609f7; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 60px 70px;
  backdrop-filter: blur(15px);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; box-shadow: 0 20px 90px #000; }
.close,.lbnav {
  position: absolute; border: 1px solid #ffffff30; background: #191b24;
  color: white; border-radius: 50%; cursor: pointer; transition: .2s;
}
.close:hover,.lbnav:hover { background: #39334e; border-color: var(--accent); }
.close { right: 22px; top: 18px; width: 44px; height: 44px; font-size: 28px; }
.lbnav { font-size: 32px; width: 48px; height: 48px; top: 50%; transform: translateY(-50%); }
#prevPhoto { left: 15px; }
#nextPhoto { right: 15px; }
#lightboxTitle { position: absolute; bottom: 20px; color: #c0c3ce; font-size: 12px; max-width: 80%; text-align: center; }
body:has(.lightbox:not([hidden])) { overflow: hidden; }
@media(max-width:900px) { .masonry { columns: 3 190px; } }
@media(max-width:700px) {
  header { height: 62px; }
  .hero { padding-top: 45px; }
  .masonry { columns: 2 145px; column-gap: 9px; }
  .tile { margin-bottom: 9px; border-radius: 8px; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 13px; }
  .stat b { font-size: 21px; }
  .card { padding: 16px; }
  .lightbox { padding: 55px 45px; }
  .lbnav { width: 35px; height: 35px; font-size: 24px; }
  #prevPhoto { left: 5px; }
  #nextPhoto { right: 5px; }
}

/* Deviluke: album covers and gallery tools */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.album-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    padding-bottom: 12px;
}

.album-card img,
.album-cover-empty {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.album-cover-empty {
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.06);
    font-size: 32px;
}

.album-card span,
.album-card small {
    padding: 0 12px;
}

.album-card span {
    font-weight: 600;
}

.album-card small {
    opacity: .65;
}

.gallery-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.gallery-tools input[type="search"] {
    flex: 1 1 220px;
    min-width: 0;
}

.gallery-tools select {
    min-width: 150px;
}

#bulkDeleteForm {
    margin: 12px 0;
}

#bulkDeleteForm button,
.danger {
    cursor: pointer;
}

#selectAllPhotos,
input[name="photo_ids"] {
    width: 18px;
    height: 18px;
    accent-color: #9b75ff;
    cursor: pointer;
}

@media (max-width: 600px) {
    .gallery-tools {
        flex-direction: column;
    }

    .gallery-tools input,
    .gallery-tools select,
    .gallery-tools button {
        width: 100%;
    }
}
sudo tee -a /opt/darkwall/app/app/static/style.css > /dev/null <<'CSS'

/* Deviluke: album covers and gallery tools */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.album-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    padding-bottom: 12px;
}

.album-card img,
.album-cover-empty {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.album-cover-empty {
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.06);
    font-size: 32px;
}

.album-card span,
.album-card small {
    padding: 0 12px;
}

.album-card span {
    font-weight: 600;
}

.album-card small {
    opacity: .65;
}

.gallery-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.gallery-tools input[type="search"] {
    flex: 1 1 220px;
    min-width: 0;
}

.gallery-tools select {
    min-width: 150px;
}

#bulkDeleteForm {
    margin: 12px 0;
}

#bulkDeleteForm button,
.danger {
    cursor: pointer;
}

#selectAllPhotos,
input[name="photo_ids"] {
    width: 18px;
    height: 18px;
    accent-color: #9b75ff;
    cursor: pointer;
}

@media (max-width: 600px) {
    .gallery-tools {
        flex-direction: column;
    }

    .gallery-tools input,
    .gallery-tools select,
    .gallery-tools button {
        width: 100%;
    }
}
