/* Additions to the prototype's app.css (web/css/app.css) for server-rendered pages. */

.topbar form { margin: 0; }
.topbar .logo { width: auto; }
.topbar a.who { text-decoration: none; color: inherit; }
.messages { margin-bottom: 20px; }
.demo-note { margin-bottom: 16px; }

/* Account menu (top right): organisation switcher and account links. */
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu .menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 260px; padding: 8px;
  color: var(--text); box-shadow: var(--shadow);
}
.account-menu .nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 10px; }
.account-menu .menu-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius);
  background: none; color: var(--text); font: inherit; text-decoration: none; cursor: pointer;
}
.account-menu .menu-item small { display: block; }
.account-menu .menu-item:hover { background: var(--surface-2); }
.account-menu .menu-item.on { background: var(--primary-soft); color: var(--on-primary-soft); }
.account-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* Forms on our own pages. */
.field-error { color: var(--bad); display: block; margin-top: 4px; }
.choice-list { border: 0; padding: 0; margin: 0; }
.choice-list legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=color] { height: 40px; width: 100%; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
input:disabled, textarea:disabled, select:disabled { opacity: .7; }

/* Switches: the toggle sits exactly on the title's line in every browser (the title's line
   is as tall as the toggle), and cards side by side in a grid start level. */
.switch input { margin: 0; }
.switch .txt b { line-height: 24px; }
.grid2 > .card + .card, .grid3 > .card + .card, .project-cards > .card + .card { margin-top: 0; }
.dependent { transition: opacity .15s; }
.dependent.off { opacity: .45; }
form .field textarea { width: 100%; }

/* django-allauth forms (allauth/elements/*.html render plain labels and inputs). */
.account-card h1 { margin-top: 0; }
.account-card form p, .account-card form > div { margin-bottom: 14px; }
.account-card label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.account-card input[type=checkbox] + label, .account-card label:has(input[type=checkbox]) { display: inline; font-weight: 500; }
.account-card .helptext, .account-card small { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.account-card ul.errorlist { color: var(--bad); margin: 4px 0 0; padding-left: 18px; }
.account-card button[type=submit] {
  min-height: 40px; padding: 8px 18px; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer;
  background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary);
}
.account-card button[type=submit]:hover { filter: brightness(1.08); }

/* Project maker. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.extra-row { margin-bottom: 8px; }
.extra-row input[type=text] { min-width: 180px; }
.item-row .switch { padding: 0; align-self: center; }
.save-bar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 16px; padding: 12px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent); display: flex; justify-content: flex-end;
}
.danger-zone summary { cursor: pointer; }
.import-form { margin: 0; }
.project-card .meta { flex-wrap: wrap; }

/* Share tab and the site team's page. */
.qr { width: 220px; max-width: 100%; background: #fff; padding: 8px; border-radius: var(--radius); }
.qr svg { display: block; width: 100%; height: auto; }
ol.steps { margin: 0; padding-left: 20px; }
ol.steps li + li { margin-top: 6px; }

/* Photos tab and viewer (tiles use the prototype's .photo-tile .img / .cap styles). */
.photo-grid { margin-bottom: 20px; }
.photo-tile { text-decoration: none; }
.photo-tile .cap b { margin-bottom: 4px; }
.stats .value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.no-img { display: grid; place-items: center; color: var(--muted); min-height: 120px; }
.photo-view { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; align-items: start; }
.photo-frame img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
@media (max-width: 860px) { .photo-view { grid-template-columns: 1fr; } }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
ul.checks { list-style: none; padding: 0; margin: 0 0 8px; }
ul.checks li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.checks li:last-child { border-bottom: 0; }
ul.checks .lvl { flex: none; width: 3.2em; font-weight: 700; font-size: .8rem; }
ul.checks .pass .lvl { color: var(--ok); }
ul.checks .note .lvl { color: var(--warn); }
ul.checks .fail .lvl { color: var(--bad); }
ul.checks .skip .lvl { color: var(--muted); }
details.send summary { cursor: pointer; }
details.send + details.send { margin-top: 10px; }

/* Review decisions and the progress board */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.choice:has(input:checked) { border-color: var(--green); background: var(--primary-soft); color: var(--on-primary-soft); }
.decision select, .decision textarea { width: 100%; }
ul.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .9rem; }
.board a.cell { text-decoration: none; }
.cell.awaiting { background: var(--primary-soft); color: var(--on-primary-soft); }
.cell.retake { background: var(--bad-soft); color: var(--bad); }
.cell.unavailable { background: var(--surface-3); color: var(--muted); }
.board th.stage-head { text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; color: var(--muted); }
.board td.stage { white-space: nowrap; min-width: 92px; }
.board td.stage .chip { font-size: .72rem; }
.photo-tile .cap .row { flex-wrap: wrap; margin: 4px 0 2px; }
.board .cell.missing, .legend .cell.missing { background: transparent; box-shadow: inset 0 0 0 1px var(--warn); color: var(--warn); }

/* Magnifier (unlicensed previews) */
.magnify-wrap img[data-magnify] { cursor: zoom-in; }
.magnifier { border-top: 1px solid var(--line); padding-top: 10px; }
.magnifier img { display: block; width: 100%; max-width: 800px; height: auto; border-radius: var(--radius); margin-top: 8px; }
.break { overflow-wrap: anywhere; }

/* "Being covered soon" (Photo Upload and Review Plan §3.2): highlighted in the menu, queue and photo page. */
.sidenav a .count + .count { margin-left: 4px; }
.sidenav a .count.urgent { background: var(--bad); color: var(--on-primary); }
.chip.cover-today { background: var(--bad); color: var(--on-primary); border-color: transparent; }
.chip.cover-past { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); border-color: transparent; }
.chip.cover-week { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); border-color: transparent; }

/* Chips inside photo tiles keep their own colours: app.css greys every span in a tile caption
   (.photo-tile .cap span), which otherwise wins over a chip's colour. */
.photo-tile .cap .chip { display: inline-flex; color: var(--text); }
.photo-tile .cap .chip.ok { color: var(--ok); }
.photo-tile .cap .chip.warn { color: var(--warn); }
.photo-tile .cap .chip.bad { color: var(--bad); }
.photo-tile .cap .chip.brand { color: var(--on-primary-soft); }
.photo-tile .cap .chip.cover-today { color: var(--on-primary); }
.photo-tile .cap .chip.cover-week { color: var(--warn); }

/* The firm you're working in, in its brand colour (top bar). */
.topbar .who .org.org-badge { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; line-height: 1.35; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.topbar .who .who-text { display: flex; flex-direction: column; align-items: flex-start; }
.topbar .who .name { font-size: .8rem; opacity: .85; }

/* Progress board: fill the width; the legend's icons centred in their boxes. */
.board-wrap .board { min-width: 100%; }
.legend .cell { display: inline-grid; place-items: center; gap: 0; }

/* QR code: square, never clipped (the prototype's .qr has a fixed height). */
.qr { height: auto; aspect-ratio: 1; display: block; }

/* Footer links under every page, and the privacy page's text. */
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; margin-top: 40px; font-size: .85rem; }
.site-foot a { color: var(--muted); }
.prose h2 { margin: 0; font-size: 1.1rem; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prose p { margin: 0; }
