/* QuickLink UI design system: dark only, Segoe UI, one accent (QuickLink Blue). */
:root {
  --blue: #3fa7e0;          /* quicklink-blue */
  --dark-gray: #1d1d1d;     /* controls; text on blue */
  --surface: #1a1a1a;       /* page */
  --sunken: #111111;        /* header */
  --raised: #2d2d2d;        /* hover rows */
  --gray-700: #383838;      /* borders */
  --gray-500: #8e8e8e;      /* muted text */
  --white: #ffffff;
  --error: #ff0004;
  --error-hover: #9a0406;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); color: var(--white); }
body { font: 15px/1.45 "Segoe UI", "Open Sans", system-ui, sans-serif; }
a { color: var(--blue); }
h1 { font-size: 24px; font-weight: 700; margin: 0; }
h2 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }
.muted { color: var(--gray-500); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

header {
  display: flex; align-items: center; gap: 16px; padding: 18px 28px;
  background: var(--sunken); border-bottom: 3px solid var(--blue);
}
header .brand img { display: block; }
header .title { font-weight: 600; font-size: 17px; color: var(--gray-500); }
header .signout { margin-left: auto; color: var(--gray-500); text-decoration: none; }
header .signout:hover { color: var(--white); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 28px 48px; }

.card {
  background: var(--dark-gray); border: 1px solid var(--gray-700); border-radius: 5px;
  padding: 18px 20px; margin: 16px 0;
}
.card.flush { padding: 0; overflow-x: auto; }
.card h2:first-child { margin-top: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.toolbar .count { font-weight: 400; font-size: 18px; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions form { margin: 0; }

input {
  font: inherit; color: var(--white); background: var(--dark-gray);
  border: 1px solid var(--gray-700); border-radius: 3px; padding: 8px 12px; min-height: 37px;
}
input:focus { outline: none; border-color: var(--blue); }
input::placeholder { color: var(--gray-500); }

button, .button {
  font: 600 15px "Segoe UI", "Open Sans", system-ui, sans-serif; display: inline-flex; align-items: center;
  min-height: 37px; padding: 0 16px; border-radius: 3px; cursor: pointer; text-decoration: none;
}
.primary { background: var(--blue); color: var(--dark-gray); border: 0; }
.secondary { background: transparent; color: var(--white); border: 1px solid var(--blue); }
.secondary:hover { background: var(--white); color: var(--dark-gray); }
.danger { background: transparent; color: var(--white); border: 1px solid var(--gray-700); }
.danger:hover { background: var(--error-hover); border-color: var(--error-hover); }

.search { display: flex; gap: 8px; align-items: center; }
.search input { width: 320px; max-width: 60vw; }
.search .clear { color: var(--gray-500); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--gray-500); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--gray-700); }
td { padding: 10px 14px; border-bottom: 1px solid var(--gray-700); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
table.reports tbody tr { cursor: pointer; }
table.reports tbody tr:hover, table.files tbody tr:hover { background: var(--raised); }
td.what { color: #d9d9d9; min-width: 260px; }
td.empty { text-align: center; color: var(--gray-500); padding: 32px; cursor: default; }
table.files td.path { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; word-break: break-all; }
table.files td a { margin-left: 10px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { margin: 0; background: var(--surface); border: 1px solid var(--gray-700); border-radius: 5px; overflow: hidden; }
.tile img, .tile video { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #000; }
.tile .tile-file { height: 120px; display: flex; align-items: center; justify-content: center; }
.tile figcaption { padding: 8px 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tile figcaption .path { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; word-break: break-all; flex: 1 1 100%; }

.pager { display: flex; justify-content: center; gap: 20px; align-items: center; margin: 12px 0; }

dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; margin: 0 0 4px; }
dl.facts dt { color: var(--gray-500); font-size: 13px; }
dl.facts dd { margin: 2px 0 0; }
p.pre { white-space: pre-wrap; margin: 0; }

details.card summary { cursor: pointer; list-style: none; }
details.files-section summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
details.files-section summary .button { margin-left: auto; }
details.files-section[open] summary { margin-bottom: 8px; }
.small-button { min-height: 32px; font-size: 14px; padding: 0 12px; }
details.card summary h2 { display: inline; margin: 0; }
details.card summary::before { content: "\25B8  "; color: var(--blue); }
details.card[open] summary::before { content: "\25BE  "; }
pre {
  font: 13px/1.5 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; word-break: break-word;
  margin: 12px 0 0; color: #e6e6e6;
}
pre.viewer { margin-top: 16px; max-height: 75vh; overflow: auto; }
h1.path { font-family: Consolas, "Cascadia Mono", monospace; font-size: 18px; word-break: break-all; }

form.login { max-width: 380px; margin: 64px auto; display: flex; flex-direction: column; gap: 10px; }
form.login p { margin: 0 0 8px; }
form.login label { font-weight: 600; margin-top: 6px; }
form.login button { margin-top: 10px; justify-content: center; }
.error { color: #ff6b6e; }

@media (max-width: 640px) {
  header, main { padding-left: 16px; padding-right: 16px; }
  header .title { display: none; }
  .search input { width: 100%; max-width: none; }
  .search { width: 100%; }
}
.files-section-plain { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.files-section-plain h2 { margin: 0; }
.files-section-plain .button { margin-left: auto; }
.files-section-plain p { flex-basis: 100%; margin: 0; }
