/* uwu.kim — login + admin panel styling.
   Same terminal palette as the public site. Kept in its own file because the
   admin CSP bans inline styles just like the public one does. */

:root {
  --bg:      #0a0a0f;
  --bg-soft: #12121c;
  --fg:      #e8e0f0;
  --dim:     #6b6b85;
  --pink:    #ff6ac1;
  --cyan:    #5ef1e8;
  --amber:   #ffcc66;
  --red:     #ff5c7a;
  --line:    #22223a;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

/* No stars on the admin pages — comets only.
   sky.css keeps stars out of the centre column, which works because /home and
   the landing page put their content in a fixed-width column with real gutters
   either side. The admin grid is full-width (see .grid below), so there is no
   gutter to retreat into and every star would end up half-hidden behind a
   thumbnail. Comets are unaffected: they're in motion, so passing behind a card
   reads as depth rather than as a clipped glyph.
   display isn't set on .sky__stars anywhere in sky.css, so this wins outright
   despite admin.css being linked first — if that ever changes, this needs to
   become more specific than a bare class. */
.sky__stars { display: none; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--cyan); }

/* .sky is position:fixed with z-index 0, which would otherwise paint over
   ordinary non-positioned content. Lift everything else above it. */
body > *:not(.sky) { position: relative; z-index: 1; }

/* The bar has to outrank the content below it, not merely tie with it.
   Everything above shares z-index 1, and on a tie the later element in the
   document wins — so <main> was painting over <header>, taking the dropdown
   with it. The menu's own z-index can't rescue it: .menu__panel is inside the
   header's stacking context and cannot escape its parent's layer.
   Selector is `body > .bar` rather than `.bar` so it matches the specificity
   of the rule above and wins on source order. */
body > .bar { z-index: 20; }

/* --------------------------------- LOGIN ------------------------------- */
.auth {
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth__logo {
  margin: 0 0 22px;
  font-size: clamp(22px, 7vw, 34px);
  font-weight: 700;
  color: var(--pink);
  text-shadow: 0 0 18px rgba(255, 106, 193, 0.4);
}

.auth__form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth__form label {
  font-size: 12px;
  color: var(--dim);
  margin-top: 8px;
}

.auth__err {
  margin: 0 0 6px;
  padding: 9px 11px;
  font-size: 13px;
  color: var(--red);
  background: rgba(255, 92, 122, 0.08);
  border: 1px solid rgba(255, 92, 122, 0.35);
  border-radius: 4px;
}

input, button {
  font-family: var(--mono);
  font-size: 14px;
}

input {
  padding: 10px 11px;
  min-height: 42px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }

button {
  margin-top: 14px;
  padding: 11px 16px;
  min-height: 44px;
  font-weight: 700;
  color: var(--bg);
  background: var(--cyan);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { filter: brightness(1.12); }

/* ---------------------------------- BAR -------------------------------- */
/* A spacer element rather than justify-content:space-between — with four
   children, space-between would scatter them evenly instead of keeping the
   home/logout pair together on the right. */
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.bar__who { font-size: 13px; color: var(--dim); }
.bar__who em { color: var(--pink); font-style: normal; }
.bar__spacer { flex: 1; }

.bar__link,
.bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 14px;
  min-height: 38px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  color: var(--dim);
  background: transparent;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}
.bar__link:hover, .bar__link:focus-visible,
.bar button:hover, .bar button:focus-visible {
  color: var(--pink);
  border-color: var(--pink);
}
/* Styled as one thing with .bar__link below — an <a> and a <button> otherwise
   resolve line-height and padding differently, which makes identically-sized
   text look mismatched. */
.bar form { margin: 0; display: flex; }

/* --------------------------------- MENU -------------------------------- */
/* <details>/<summary> dropdown — a real menu with zero JavaScript, which the
   admin CSP requires (script-src 'none'). Keyboard accessible natively. */
.menu { position: relative; }
.menu__btn {
  list-style: none;
  cursor: pointer;
  padding: 8px 14px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  user-select: none;
}
.menu__btn::-webkit-details-marker { display: none; }
.menu__btn:hover { border-color: var(--pink); }
.menu[open] .menu__btn { border-color: var(--pink); color: var(--pink); }

.menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.menu__item {
  padding: 9px 11px;
  font-size: 13px;
  color: var(--fg);
  text-decoration: none;
  border-radius: 4px;
}
.menu__item:hover { background: rgba(255, 106, 193, 0.12); color: var(--pink); }
.menu__item.is-current { color: var(--pink); }

/* -------------------------------- TABLES ------------------------------- */
.page { padding: 18px; display: flex; flex-direction: column; gap: 30px; }
.page h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--dim);
  text-transform: lowercase;
}
.count {
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--bg);
  background: var(--dim);
  border-radius: 9px;
}

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 400; font-size: 11px; color: var(--dim); background: var(--bg-soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.is-banned td { opacity: 0.55; }
.mono { font-variant-numeric: tabular-nums; color: var(--dim); white-space: nowrap; }
.dim { color: var(--dim); }
time { white-space: nowrap; }
time.is-past { color: var(--red); }

.role { padding: 2px 7px; font-size: 11px; border-radius: 3px; border: 1px solid var(--line); }
.role--admin { color: var(--pink); border-color: rgba(255, 106, 193, 0.4); }
.role--user  { color: var(--cyan); border-color: rgba(94, 241, 232, 0.35); }

.tag { padding: 2px 7px; font-size: 11px; border-radius: 3px; font-style: normal; }
.tag--ok  { color: var(--cyan); background: rgba(94, 241, 232, 0.1); }
.tag--bad { color: var(--red);  background: rgba(255, 92, 122, 0.12); }
.tag--dim { color: var(--dim); background: rgba(107, 107, 133, 0.15); }

.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.acts form { margin: 0; }
.acts button {
  margin: 0; padding: 6px 10px; min-height: 32px; font-size: 12px;
  color: var(--dim); background: transparent; border: 1px solid var(--line);
}
.acts button:hover { color: var(--fg); border-color: var(--pink); }
.acts button.danger { color: var(--red); border-color: rgba(255, 92, 122, 0.35); }
.acts button.danger:hover { color: var(--bg); background: var(--red); }

.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 200px; }
.inline button { margin: 0; }

/* -------------------------------- INVITE ------------------------------- */
.invite {
  margin: 14px 18px 0;
  padding: 14px 16px;
  background: rgba(94, 241, 232, 0.06);
  border: 1px solid rgba(94, 241, 232, 0.4);
  border-radius: 6px;
}
.invite__lead { margin: 0 0 8px; font-size: 13px; color: var(--cyan); }
.invite__url {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  word-break: break-all;
  user-select: all;
}
.invite__note { margin: 8px 0 0; font-size: 12px; color: var(--dim); }

.notice {
  margin: 0;
  padding: 11px 18px;
  font-size: 13px;
  color: var(--amber);
  background: rgba(255, 204, 102, 0.07);
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}

/* --------------------------------- GRID -------------------------------- */
.grid {
  list-style: none;
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.empty { color: var(--dim); padding: 30px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 0;
}

.card__link { display: block; }

.card__img,
.card__noimg {
  width: 100%;
  height: 130px;
  border-radius: 4px;
  background: #000;
}
.card__img { object-fit: contain; }
.card__noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--dim);
  border: 1px dashed var(--line);
}

.card__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.card__name {
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.card__size { color: var(--dim); flex: 0 0 auto; }

.card__aliases { display: flex; flex-wrap: wrap; gap: 6px; }
.card__alias {
  font-size: 11px;
  padding: 2px 6px;
  color: var(--pink);
  background: rgba(255, 106, 193, 0.08);
  border: 1px solid rgba(255, 106, 193, 0.3);
  border-radius: 3px;
  text-decoration: none;
}

.card__form { display: flex; gap: 6px; }
.card__form input { flex: 1; min-width: 0; padding: 7px 8px; min-height: 34px; font-size: 12px; }
.card__form button { margin: 0; padding: 7px 10px; min-height: 34px; font-size: 12px; }

.card__del {
  width: 100%;
  color: var(--red);
  background: transparent;
  border: 1px solid rgba(255, 92, 122, 0.35);
}
.card__del:hover { color: var(--bg); background: var(--red); }

/* -------------------------------- PAGING ------------------------------- */
.pagers { display: flex; gap: 12px; padding: 0 18px 30px; }
.pager {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--cyan);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
}
.pager:hover { border-color: var(--cyan); }

/* Moderator rank pill in the accounts table. */
.role--moderator { background: #7c5cff; color: #fff; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--dim); }

/* Rank buttons in the accounts table sit alongside ban/delete but read as
   neutral rather than destructive. */
.acts form { display: inline-block; }

/* ------------------------------ FILE BROWSER ---------------------------- */
/* Year/month folders. Deliberately plain rows rather than big icons — this is
   a list you scan, not a desktop you arrange. */
.crumbs {
  padding: 14px 18px 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
}
.crumbs a { color: var(--cyan); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs__sep { color: #3a3a5c; padding: 0 4px; }
.crumbs__here { color: var(--fg); }

.folds { list-style: none; margin: 0; padding: 14px 18px 24px; display: grid; gap: 6px; }
.fold__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.fold__link:hover { border-color: var(--cyan); }
.fold__icon { color: var(--cyan); }
.fold__name { flex: 1 1 auto; }
.fold__count { flex: 0 0 auto; font-size: 11.5px; color: var(--dim); }
.fold--undated .fold__icon { color: var(--amber); }
