/* Styling: odesyn brand tokens — a light admin viewer with a scan grid and a photo/3D lightbox. */
:root {
  --ink: #000;
  --paper: #fff;
  --surface: #f6f6f4;
  --label: rgba(0, 0, 0, 0.6);
  --line: rgba(0, 0, 0, 0.12);
  --muted: rgba(0, 0, 0, 0.5);
  --danger: #c0392b;
  --accent: #b8ff2e;
  --corner: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  min-height: 100%;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--paper);
}

.logo { width: auto; display: block; fill: currentColor; }
.hidden { display: none !important; }

body.view-loading #login,
body.view-loading #gallery { display: none; }
body.view-login #gallery { display: none; }
body.view-gallery #login { display: none; }

/* ---- login ---- */
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }

.auth {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-logo { height: 34px; color: var(--ink); margin-bottom: 6px; }
.auth-title { font-size: 20px; font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 11px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; color: var(--label); }

.outlined {
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  width: 100%;
  padding: 14px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  outline: none;
}

.outlined::placeholder { color: rgba(0, 0, 0, 0.35); }
.auth-msg { font-size: 13px; line-height: 1.4; }
.auth-msg.err { color: var(--danger); }

.filled {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 500;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 26px;
  cursor: pointer;
}

.arrow { white-space: pre; }

/* ---- gallery ---- */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.bar-logo { height: 22px; color: var(--ink); }
.bar-title { font-size: 15px; font-weight: 500; }
.count { color: var(--muted); font-weight: 400; margin-left: 4px; }

.ghost {
  margin-left: auto;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 22px;
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--corner);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover { border-color: var(--ink); transform: translateY(-2px); }

.thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--surface);
}

.thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.card-name { font-size: 15px; font-weight: 500; }
.card-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.card-date { font-size: 12px; color: var(--muted); }

/* ---- lightbox ---- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
}

.viewer-card {
  position: relative;
  display: flex;
  width: min(920px, 100%);
  max-height: 90vh;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
}

.viewer-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.viewer-stage { flex: 1; min-width: 0; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.viewer-image { width: 100%; height: 100%; max-height: 90vh; object-fit: contain; }
.viewer-model { width: 100%; height: min(90vh, 620px); }
.viewer-model model-viewer { width: 100%; height: 100%; background: var(--surface); }

.viewer-side { width: 260px; flex-shrink: 0; padding: 24px; display: flex; flex-direction: column; gap: 18px; border-left: 1px solid var(--line); }
.viewer-title { font-size: 18px; font-weight: 500; word-break: break-word; }
.viewer-meta { display: flex; flex-direction: column; gap: 12px; }
.viewer-meta div { display: flex; flex-direction: column; gap: 2px; }
.viewer-meta dt { font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--label); }
.viewer-meta dd { font-size: 14px; word-break: break-word; }
.viewer-side .filled { margin-top: auto; }

@media (max-width: 720px) {
  .viewer-card { flex-direction: column; max-height: 92vh; overflow-y: auto; }
  .viewer-side { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
}
