/* Picture Day — staff interface
   Fixed, utilitarian palette. Student branding lives only in the gallery
   and on the public page, so the operations screens stay legible on a
   gym floor under bad lighting. */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&display=swap');

:root {
  --ink: #16202b;
  --ink-2: #44535e;
  --muted: #6d7b84;
  --paper: #f4f6f4;
  --card: #ffffff;
  --line: #dde3de;
  --line-2: #eef1ee;
  --primary: #16505c;
  --primary-dk: #0e3a44;
  --accent: #e8b33a;
  --good: #2f6f4f;
  --warn: #b97c08;
  --bad: #9b2226;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(22, 32, 43, 0.07), 0 8px 24px -16px rgba(22, 32, 43, 0.4);
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Archivo, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 0.95rem; }
p { margin: 0 0 0.9em; max-width: 68ch; }
a { color: var(--primary); }

.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }

.rail {
  background: var(--ink);
  color: #cdd7db;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.rail .mark { display: flex; align-items: center; gap: 10px; color: #fff; }
.rail .mark b { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.rail .mark span { font-size: 0.74rem; color: #8fa3ab; display: block; }
.lens {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 6px #4e6f78;
  flex: none;
}
.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail nav button {
  all: unset;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: #cdd7db;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.rail nav button:hover { background: #22303d; color: #fff; }
.rail nav button[aria-current='true'] { background: var(--primary); color: #fff; font-weight: 500; }
.rail nav button .tag {
  background: #35485500; border: 1px solid #40545f; border-radius: 999px;
  padding: 0 7px; font-size: 0.72rem; color: #a7bcc4;
}
.rail nav button[aria-current='true'] .tag { border-color: #4e8a98; color: #d7ecf1; }
.rail footer { margin-top: auto; font-size: 0.78rem; color: #7f939b; display: grid; gap: 6px; }
.rail footer a { color: #a7bcc4; }

main { padding: 26px 30px 80px; min-width: 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.head p { color: var(--muted); margin: 4px 0 0; font-size: 0.92rem; }

.view { display: none; }
.view.on { display: block; }

/* ------------------------------------------------------------ controls */

button, .btn {
  font: inherit;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 7px 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
button:hover, .btn:hover { border-color: #c3ccc5; background: #fbfcfb; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.primary:hover, .btn.primary:hover { background: var(--primary-dk); border-color: var(--primary-dk); }
.danger { color: var(--bad); border-color: #e7cfd0; }
.ghost { background: transparent; border-color: transparent; color: var(--ink-2); padding: 5px 8px; }
.ghost:hover { background: #e9ede9; border-color: transparent; }
.small { font-size: 0.83rem; padding: 4px 9px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'], select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
label { display: block; font-size: 0.83rem; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card > h2 { margin-bottom: 4px; }
.card .hint { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }

/* --------------------------------------------------------- floor board */

.board { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; margin-bottom: 16px; }
.board .caption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.board .caption b { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.board .caption span { color: var(--muted); font-size: 0.88rem; }

.tiles { display: flex; flex-wrap: wrap; gap: 3px; }
.tile {
  width: 15px; height: 15px; border-radius: 2px;
  background: #e3e8e3; border: 1px solid #d3dad3;
  cursor: pointer; padding: 0;
}
.tile:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.tile.shot { background: var(--good); border-color: var(--good); }
.tile.published { background: var(--primary); border-color: var(--primary); }
.tile.thin { background: var(--accent); border-color: #cf9c26; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 0.82rem; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.count { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; }
.count b { display: block; font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.count span { color: var(--muted); font-size: 0.84rem; }
.count.flag b { color: var(--bad); }
.count.wait b { color: var(--warn); }

/* --------------------------------------------------------------- table */

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 0.82rem; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:hover td { background: #fafbfa; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.84rem; color: var(--primary); }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 500; border: 1px solid; }
.pill.ok { color: var(--good); border-color: #bcd6c6; background: #f1f7f3; }
.pill.live { color: var(--primary); border-color: #b7d1d7; background: #eff6f8; }
.pill.wait { color: var(--warn); border-color: #ead2a4; background: #fdf7ea; }
.pill.none { color: var(--muted); border-color: var(--line); background: #f6f7f6; }
.gallery-project-title { margin: 0 0 14px; padding: 10px 12px; border-left: 4px solid var(--accent); background: #eff4f4; color: var(--primary-dk); font-size: 1.05rem; font-weight: 700; }

/* ------------------------------------------------------------- photos */

.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.shot-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.shot-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #e9ede9; cursor: zoom-in; }
.shot-card .bar { display: flex; gap: 4px; padding: 6px; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.shot-card .photo-actions { flex-wrap: wrap; justify-content: flex-start; }
.shot-card.is-hidden img { opacity: 0.35; }

.lightbox { position: fixed; inset: 0; background: rgba(12, 18, 24, 0.9); display: none; align-items: center; justify-content: center; z-index: 60; padding: 24px; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.drop {
  border: 2px dashed #c3ccc5; border-radius: var(--radius); padding: 34px 20px; text-align: center;
  background: #fbfcfb; color: var(--ink-2);
}
.drop.over { border-color: var(--primary); background: #eff6f8; }

.upload-queue { list-style: none; display: grid; gap: 6px; margin: 10px 0 14px; padding: 0; max-height: 300px; overflow: auto; }
.upload-queue li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); }
.upload-queue .queue-number { flex: none; width: 2.4em; color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-queue .queue-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.upload-queue .queue-actions { display: flex; flex: none; gap: 4px; }

.progress { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; background: var(--primary); width: 0; transition: width 0.2s; }

.log { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; background: #f7f9f8; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; }

/* -------------------------------------------------------------- toast */

.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 80; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: 0.88rem; max-width: 380px;
}
.toast.bad { background: var(--bad); }
.toast.good { background: var(--good); }

/* -------------------------------------------------------------- auth */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(420px, 100%); box-shadow: var(--shadow); }
.auth .mark { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth .mark b { font-size: 1.05rem; }
.auth .lens { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px #b9c6cb; }

.notice { border-left: 3px solid var(--accent); background: #fdf8ec; padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.88rem; margin-bottom: 14px; }
.notice.bad { border-color: var(--bad); background: #fbf0f0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: column; }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  main { padding: 20px 16px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
