/* SCM Photos — change these colors to match the main SCM website */
:root {
  --brand: #1f4e79;        /* main color (header, buttons) */
  --brand-dark: #163a5a;
  --accent: #c99a2e;       /* highlight */
  --fb: #1877f2;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1d2430;
  --muted: #6b7380;
  --line: #e2e5ea;
  --ok: #1e8e3e;
  --warn: #b26a00;
  --bad: #c62828;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
body.noscroll { overflow: hidden; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: .2em 0 .3em; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
main.wrap { padding-top: 20px; padding-bottom: 48px; min-height: 70vh; }

/* Header & footer */
.topbar { background: var(--brand); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { height: 42px; width: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { opacity: .8; font-size: .8rem; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: .95rem; }
.topbar nav a:hover { background: rgba(255,255,255,.12); }
.footer { background: var(--brand-dark); color: #dfe6ee; padding: 20px 0; font-size: .9rem; }
.footer p { margin: .3em 0; }
.footer .muted { color: #aebccb; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: inherit; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.fb { background: var(--fb); border-color: var(--fb); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0c4c4; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.form label, .form .lbl { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.form input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), .form select, .form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; }
.form input[type=file], .form input[type=range] { display: block; margin-top: 6px; width: 100%; }
.form label.check, label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check.inline { display: inline-flex; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 .span2 { grid-column: span 2; }
.alert { background: #fdecec; color: var(--bad); padding: 10px 14px; border-radius: 8px; }
.notice { background: #e7f4ea; color: #145c29; padding: 10px 14px; border-radius: 8px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; font-size: 1.05rem; }
.crumbs { margin: 0 0 8px; }
.crumbs a { text-decoration: none; }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 24px 0; }

/* Home */
.hero { text-align: center; padding: 18px 0 8px; }
.hero p { color: var(--muted); margin: 0 0 16px; }
.search { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search input { flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 18px 0 22px; }
.chip { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .9rem; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.album-card { background: var(--card); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.album-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.album-card .cover { position: relative; aspect-ratio: 3 / 2; background: #dde3ea; }
.album-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card .count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: .8rem; padding: 3px 9px; border-radius: 999px; }
.album-card .meta { padding: 12px 14px 14px; }
.album-card h2 { font-size: 1.05rem; margin: 4px 0; }
.album-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); text-decoration: none; }

/* Album */
.album-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.album-head > div:first-child { flex: 1 1 420px; }
.album-head p { margin: .3em 0; }
.credits { font-size: .9rem; color: var(--muted); font-style: italic; }
.album-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.zip-parts summary { list-style: none; }
.zip-parts summary::-webkit-details-marker { display: none; }
.zip-parts div { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-grid::after { content: ""; flex-grow: 999; }
.tile { position: relative; height: 200px; flex-grow: 1; border-radius: 4px; overflow: hidden; background: #dde3ea; cursor: zoom-in; }
.tile img { height: 100%; width: 100%; object-fit: cover; }
.tile .check { display: none; position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.35); color: transparent; font-weight: 700; align-items: center; justify-content: center; }
.selecting .tile { cursor: pointer; }
.selecting .tile .check { display: flex; }
.tile.sel { outline: 4px solid var(--brand); outline-offset: -4px; }
.tile.sel .check { background: var(--brand); color: #fff; }
@media (max-width: 640px) { .tile { height: 120px; } }
.select-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: #fff; border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,.18); border-radius: 12px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; z-index: 20;
  width: max-content; max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center; }
.select-bar form { margin: 0; }
.select-bar[hidden], .lightbox[hidden] { display: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8,10,14,.95); z-index: 50; display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; max-width: 94vw; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-height: calc(100vh - 120px); max-width: 94vw; object-fit: contain; }
.lightbox figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; color: #ddd; padding: 12px 4px 0; font-size: .9rem; }
.lb-actions { display: flex; gap: 8px; }
.lb-close, .lb-prev, .lb-next { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; cursor: pointer; border-radius: 50%; width: 48px; height: 48px; font-size: 1.6rem; }
.lb-close { top: 12px; right: 12px; font-size: 1.2rem; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; } }

/* Upload page */
.upload-page .lead { font-size: 1.1rem; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 32px 16px; text-align: center; cursor: pointer; font-weight: 400 !important; }
.drop.over, .drop:hover { border-color: var(--brand); background: #f0f5fa; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.up-list { list-style: none; padding: 0; margin: 16px 0; }
.up-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: .9rem; }
.up-list .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-list progress { grid-column: span 2; width: 100%; height: 6px; }
.up-list li.ok .s { color: var(--ok); }
.up-list li.bad .s { color: var(--bad); }

/* Admin */
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stats strong { display: block; font-size: 1.6rem; }
.stats span { color: var(--muted); font-size: .88rem; }
.stats .warn strong { color: var(--warn); }
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
table.list th { background: #f0f2f5; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.card table.list { margin-bottom: 16px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef0f3; font-size: .78rem; margin: 1px 2px 1px 0; text-decoration: none; color: var(--text); }
.badge.ok { background: #e3f3e7; color: var(--ok); }
.badge.warn { background: #fff1dc; color: var(--warn); }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-cols .card { margin-bottom: 20px; }
.copy-row { display: flex; gap: 8px; margin-bottom: 8px; }
.copy-row input { flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .88rem; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 12px; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 600; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.review { margin-bottom: 24px; }
.review-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--bg); padding: 10px 0; }
.review-bar label { display: flex; gap: 6px; align-items: center; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.rv { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; }
.rv.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.rv.is-cover::after { content: "Cover"; position: absolute; top: 6px; right: 6px; background: var(--accent); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 999px; }
.rv input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; z-index: 2; }
.rv img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.rv-meta { display: flex; gap: 4px; justify-content: space-between; padding: 5px 8px; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.rv-meta a { text-decoration: none; }
.danger-zone h2 { color: var(--bad); }
.setting-img { max-height: 60px; margin: 6px 0; background: var(--brand); padding: 6px; border-radius: 6px; }
.wm-preview { border-radius: 8px; max-height: 260px; }
table.checks { border-collapse: collapse; margin: 12px 0; }
table.checks td { padding: 6px 12px; border-bottom: 1px solid var(--line); }
td.ok { color: var(--ok); font-weight: 600; }
td.bad { color: var(--bad); font-weight: 600; }

@media (max-width: 800px) {
  .admin-cols, .grid2 { grid-template-columns: 1fr; }
  .grid2 .span2 { grid-column: auto; }
  table.list th:nth-child(2), table.list td:nth-child(2) { display: none; }
}
.steps { padding-left: 20px; } .steps li { margin-bottom: 10px; }
.form input[type=number], .form input[type=date] { max-width: 260px; }
.form h3 { margin: 18px 0 10px; font-size: 1rem; } .form .lbl .check { font-weight: 400; margin: 4px 0; }
.wm-box { border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px 4px; margin: 0 0 14px; }
.wm-box legend { font-weight: 600; padding: 0 6px; }
.wm-box legend label.check { margin: 0; }
.wm-preview { width: 100%; height: auto; max-height: none; display: block; margin: 0 0 6px; }
[hidden] { display: none !important; }
.wm-preview { transition: opacity .15s; } .wm-preview.loading { opacity: .85; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input, .inline-form select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .88rem; max-width: 260px; }
.unit-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.unit-pick select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; max-width: 100%; }
.rv-unit { display: block; padding: 0 8px 6px; font-size: .74rem; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-tabs { justify-content: flex-start; margin: 6px 0 16px; }
.chip .n { font-size: .78rem; opacity: .7; margin-left: 2px; }
.table-scroll { overflow-x: auto; margin-top: 12px; }
.cell-input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .9rem; width: 100%; min-width: 140px; background: #fff; }
tr.muted .cell-input { color: var(--muted); }
.dest { background: #eef4fa; border: 1px solid #cfe0f0; border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
