/* SHVFD website backend. Layout from the Jarratt VFD officer dashboard; SHVFD colors. */
:root { --engine:#C8102E; --engine-deep:#8B0A1F; --gold:#F2A900; --ink:#16181B; --steel:#59626d; --mist:#eef0f2; --line:#d7dbe0; --radius:6px; }
* { box-sizing: border-box; }
body { margin:0; font-family:'Public Sans',system-ui,sans-serif; font-size:16px; line-height:1.5; color:var(--ink); background:#f6f7f8; }
a { color:var(--engine); }
:focus-visible { outline:3px solid var(--gold); outline-offset:2px; }
h1,h2,h3 { font-family:'Oswald',Impact,sans-serif; line-height:1.2; margin:0 0 .6rem; }
h1 { font-size:1.9rem; } h2 { font-size:1.35rem; }
.shell { display:grid; grid-template-columns:230px 1fr; min-height:100vh; }
.side { background:var(--ink); color:#cfd5dc; padding:1.2rem 0; position:sticky; top:0; height:100vh; overflow:auto; }
.side .brand { display:flex; gap:.6rem; align-items:center; padding:0 1.2rem 1.2rem; color:#fff; text-decoration:none; font-family:'Oswald',sans-serif; font-weight:700; font-size:1.1rem; border-bottom:1px solid #2e3844; margin-bottom:.8rem; }
.side .brand img { width:30px; height:38px; object-fit:contain; }
.side nav a { display:flex; justify-content:space-between; padding:.55rem 1.2rem; color:#cfd5dc; text-decoration:none; font-weight:500; }
.side nav a:hover { background:#222c38; color:#fff; }
.side nav a[aria-current] { background:#222c38; color:#fff; box-shadow:inset 3px 0 0 var(--gold); }
.side .group { padding:.9rem 1.2rem .3rem; font-size:.8rem; color:#8994a0; font-weight:600; }
.side form { padding:1rem 1.2rem; }
.side .who { padding:0 1.2rem; font-size:.88rem; color:#8994a0; margin-top:1rem; }
.badge { background:var(--engine); color:#fff; font-size:.75rem; font-weight:700; border-radius:999px; padding:.05rem .5rem; }
.content { padding:2rem 2.4rem 4rem; max-width:1100px; }
.topline { display:flex; flex-wrap:wrap; gap:1rem; align-items:center; justify-content:space-between; margin-bottom:1.4rem; }
.topline h1 { margin:0; }
.flash { background:#e9f4ec; border-left:4px solid #2e7d4f; padding:.7rem 1rem; border-radius:0 var(--radius) var(--radius) 0; margin-bottom:1.4rem; }
.error { background:#fbf0f0; border-left:4px solid var(--engine); padding:.7rem 1rem; border-radius:0 var(--radius) var(--radius) 0; margin-bottom:1.4rem; }
.panel { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:1.4rem; margin-bottom:1.4rem; }
.stats { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:1rem; margin-bottom:1.6rem; }
.stat { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:1rem 1.1rem; text-decoration:none; color:var(--ink); }
.stat:hover { border-color:var(--ink); }
.stat b { display:block; font-family:'Oswald',sans-serif; font-size:2rem; line-height:1; margin-bottom:.3rem; }
.stat.hot b { color:var(--engine); }
table { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
th, td { text-align:left; padding:.7rem .9rem; border-bottom:1px solid var(--line); vertical-align:top; }
th { background:var(--mist); font-size:.88rem; font-weight:700; }
tr:last-child td { border-bottom:0; }
td.actions { white-space:nowrap; text-align:right; }
td.actions form { display:inline; }
.btn { display:inline-block; font:inherit; font-weight:700; font-size:.95rem; text-decoration:none; padding:.55rem 1rem; border-radius:var(--radius); border:1.5px solid transparent; cursor:pointer; line-height:1.2; background:none; }
.btn-red { background:var(--engine); color:#fff; } .btn-red:hover { background:var(--engine-deep); color:#fff; }
.btn-line { border-color:#aeb5bd; color:var(--ink); background:#fff; } .btn-line:hover { border-color:var(--ink); }
.btn-del { color:var(--engine); padding:.55rem .6rem; } .btn-del:hover { text-decoration:underline; }
.btn-plain { color:#cfd5dc; padding:0; font-weight:500; } .btn-plain:hover { color:#fff; text-decoration:underline; }
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:1rem 1.2rem; }
.form-grid .full { grid-column:1/-1; }
label { display:block; font-weight:600; margin-bottom:.3rem; }
.hint { display:block; color:var(--steel); font-size:.86rem; font-weight:400; margin:-.1rem 0 .35rem; }
input[type=text],input[type=email],input[type=password],input[type=date],input[type=url],input[type=number],input[type=file],select,textarea { width:100%; font:inherit; padding:.55rem .7rem; border:1.5px solid #b9c0c8; border-radius:var(--radius); background:#fff; color:var(--ink); }
input[type=file] { padding:.45rem; }
textarea { min-height:8rem; resize:vertical; }
textarea.tall { min-height:16rem; }
.check { display:flex; gap:.5rem; align-items:center; font-weight:500; }
.form-actions { display:flex; gap:.8rem; align-items:center; margin-top:1.4rem; }
.pill { display:inline-block; font-size:.8rem; font-weight:700; padding:.12rem .55rem; border-radius:999px; background:var(--mist); }
.pill.new { background:#fbe3e3; color:var(--engine-deep); }
.pill.reviewing { background:#fff3d6; color:#7a5800; }
.pill.accepted { background:#e2f2e7; color:#1f6b3f; }
.pill.declined { background:#e7e9ec; color:#4a525c; }
.filters { display:flex; gap:.4rem; flex-wrap:wrap; margin-bottom:1rem; }
.filters a { padding:.35rem .8rem; border:1px solid var(--line); border-radius:999px; text-decoration:none; color:var(--ink); background:#fff; font-size:.92rem; }
.filters a[aria-current] { background:var(--ink); color:#fff; border-color:var(--ink); }
.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem; }
.photo-card { background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.photo-card img { width:100%; aspect-ratio:1; object-fit:cover; }
.photo-card form { padding:.8rem; display:grid; gap:.5rem; }
.photo-card .row { display:flex; gap:.5rem; align-items:center; justify-content:space-between; }
.thumb { width:56px; height:56px; object-fit:cover; border-radius:4px; background:var(--mist); }
.muted { color:var(--steel); }
.app-section { margin-bottom:1.6rem; }
.app-section h2 { font-size:1.15rem; border-bottom:2px solid var(--ink); padding-bottom:.3rem; }
.app-section dl { display:grid; grid-template-columns:minmax(180px,38%) 1fr; margin:0; }
.app-section dt, .app-section dd { padding:.45rem 0; border-bottom:1px solid var(--line); margin:0; }
.app-section dt { color:var(--steel); padding-right:1rem; font-size:.93rem; }
.app-section dd { white-space:pre-wrap; }
.app-layout { display:grid; grid-template-columns:1fr 300px; gap:1.6rem; align-items:start; }
.app-layout aside { position:sticky; top:1rem; }
.login { max-width:400px; margin:9vh auto; padding:0 1rem; }
.login .panel { padding:2rem; }
.login img { width:56px; margin-bottom:1rem; }
.msg { border-bottom:1px solid var(--line); padding:1rem 0; }
.msg:last-child { border-bottom:0; }
.msg-head { display:flex; justify-content:space-between; gap:1rem; }
.msg p { white-space:pre-wrap; margin:.5rem 0 0; }
.menu-btn { display:none; }
@media (max-width:860px) {
  .shell { grid-template-columns:1fr; }
  .side { position:static; height:auto; padding:.6rem 0; }
  .side nav, .side .group, .side .who, .side form { display:none; }
  .side.open nav, .side.open .group, .side.open .who, .side.open form { display:block; }
  .side .brand { border:0; margin:0; padding-bottom:.6rem; }
  .menu-btn { display:block; position:absolute; right:1rem; top:.9rem; background:none; border:1px solid #445; color:#fff; border-radius:6px; padding:.35rem .7rem; font:inherit; }
  .content { padding:1.4rem 1rem 3rem; }
  .form-grid, .app-layout { grid-template-columns:1fr; }
  .app-section dl { grid-template-columns:1fr; }
  .app-section dt { border:0; padding-bottom:0; }
  table { font-size:.92rem; }
}
dd.list { white-space: normal; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .side, .no-print, .app-layout aside { display:none !important; }
  .shell, .app-layout { display:block; }
  body { background:#fff; font-size:11pt; }
  .content { padding:0; max-width:none; }
  .app-section { break-inside:avoid-page; }
}

/* Password field with eye toggle and rule checklist */
.pw-field { margin-bottom: 1rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-eye { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--steel); border-radius: 4px; line-height: 0; }
.pw-eye:hover { color: var(--ink); background: var(--mist); }
.pw-eye .eye-shut { display: none; }
.pw-eye[aria-pressed="true"] .eye-open { display: none; }
.pw-eye[aria-pressed="true"] .eye-shut { display: inline; }
.pw-rules { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .88rem; display: grid; gap: .2rem; }
.pw-rules li { color: var(--steel); padding-left: 1.4rem; position: relative; }
.pw-rules li::before { content: ''; position: absolute; left: .2rem; top: .35rem; width: .6rem; height: .6rem; border-radius: 50%; border: 1.5px solid #9aa3ad; }
.pw-rules li.ok { color: #1f6b3f; }
.pw-rules li.ok::before { border: 0; width: auto; height: auto; content: '✓'; top: 0; left: .15rem; font-weight: 700; }

/* Permission checkboxes */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem 1.6rem; }
.perm-group { border: 0; padding: 0; margin: 0; }
.perm-group legend { font-weight: 700; font-size: .95rem; margin-bottom: .4rem; padding: 0; }
.perm-group .check { font-weight: 400; align-items: flex-start; margin-bottom: .35rem; }
.perm-group .check input { margin-top: .25rem; accent-color: var(--engine); }
.perm-group input:disabled + * , .perm-group .check:has(input:disabled) { color: var(--steel); }

table.activity td { font-size: .93rem; }
table.activity td.when { white-space: nowrap; color: var(--steel); }
table.activity tr.warn td { background: #fdf3f3; }

/* Phones: keep the page itself from scrolling sideways; wide tables scroll inside their own box instead */
@media (max-width:860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .content { min-width: 0; }
  .content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .content table td, .content table th { min-width: 7rem; }
  .content table td.actions { min-width: 0; }
  .topline h1 { font-size: 1.6rem; overflow-wrap: anywhere; }
}
.perm-groups { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.stats { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
@media (max-width:860px) { .side .brand { width: fit-content; max-width: calc(100% - 7rem); } }

.announce-preview { padding: .7rem 1rem; border-radius: var(--radius); }
.announce-info { background: var(--ink); color: #fff; }
.announce-warning { background: #e8cd86; color: var(--ink); }
.announce-urgent { background: var(--engine-deep); color: #fff; }

.page-toggles { display: grid; gap: .2rem; max-width: 30rem; }
.toggle { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-weight: 400; cursor: pointer; margin: 0; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { flex: none; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: #c3c9d0; position: relative; transition: background .15s; }
.toggle-ui::after { content: ''; position: absolute; top: .2rem; left: .2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: #2e7d4f; }
.toggle input:checked + .toggle-ui::after { transform: translateX(1.1rem); }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .toggle-ui, .toggle-ui::after { transition: none; } }
.side nav a { align-items: center; gap: .5rem; }
.badge { flex: none; line-height: 1.4; }

.album-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.photo-card { position: relative; }
.photo-card select { width: 100%; }
.cover-tag { position: absolute; top: .5rem; left: .5rem; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.photo-card-foot { display: flex; justify-content: space-between; align-items: center; padding: 0 .8rem .8rem; gap: .5rem; }
.photo-card-foot form { display: inline; }
.btn-plain-dark { color: var(--ink); padding: .55rem 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Visitors */
.stats-plain .stat { cursor: default; }
.stats-plain .stat:hover { border-color: var(--line); }
.chart { position: relative; }
.chart svg { width: 100%; height: 240px; display: block; overflow: visible; }
.chart .grid { stroke: #e3e6ea; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .grid.base { stroke: #b9c0c8; }
.chart .tick { fill: var(--steel); font: 12px 'Public Sans', system-ui, sans-serif; }
.chart .bar { fill: var(--ink); }
.chart .hit { fill: transparent; }
.chart .col { outline: none; cursor: default; }
.chart .col:hover .bar, .chart .col:focus .bar { fill: #34466e; }
.chart .col:focus-visible .hit { stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: .85rem; padding: .35rem .6rem; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; z-index: 2; }
.table-view { margin-top: .8rem; }
.table-view summary { cursor: pointer; color: var(--engine); font-weight: 600; font-size: .92rem; }
.table-view table { margin-top: .6rem; max-width: 26rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 1.4rem; }
.two-col .panel { margin-bottom: 1.4rem; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) auto; gap: .8rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.rank li:last-child { border-bottom: 0; }
.rank-name { overflow-wrap: anywhere; }
.rank-bar { height: 10px; background: transparent; }
.rank-bar span { display: block; height: 100%; background: var(--ink); border-radius: 0 4px 4px 0; }
.rank-val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; min-width: 2.5rem; text-align: right; }
.btn-plain-dark { white-space: nowrap; }

/* Owner: private mode */
.site-private { margin-bottom: 1.5rem; }
.site-private h2 { margin-top: 0; }
.site-private h3 { margin: 1.5rem 0 .3rem; font-size: 1.05rem; }
.site-private .inline-form { margin: .5rem 0 0; }
.copy-row { display: flex; gap: .5rem; max-width: 40rem; }
.copy-row input { flex: 1; min-width: 0; font-size: .9rem; }
.btn-text { font: inherit; font-size: .92rem; background: none; border: 0; padding: .3rem 0; color: var(--engine, #9e1b1b); text-decoration: underline; cursor: pointer; }

/* ---- SHVFD additions ---- */
h1,h2,h3 { letter-spacing:.2px; font-weight:600; }
.side .brand { text-transform:uppercase; letter-spacing:.5px; font-weight:600; }
.side { border-right:4px solid var(--engine); }
[hidden] { display:none !important; }
.form-grid .third { grid-column:span 1; }
.grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem 1.2rem; }
@media (max-width:860px) { .grid3 { grid-template-columns:1fr; } }
.form-grid p, .grid3 p { margin:0; }
.check input[type=checkbox] { width:18px; height:18px; accent-color:var(--engine); }
.thumbs { display:flex; flex-wrap:wrap; gap:.7rem; }
.thumbs .t { position:relative; width:120px; height:90px; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); background:var(--mist); }
.thumbs .t img { width:100%; height:100%; object-fit:cover; }
.thumbs .t .x { position:absolute; top:4px; right:4px; width:28px; height:28px; border-radius:50%; border:0; background:rgba(0,0,0,.72); color:#fff; cursor:pointer; font-size:16px; line-height:1; }
.thumbs .t .mv { position:absolute; bottom:4px; left:4px; display:flex; gap:3px; }
.thumbs .t .mv button { width:26px; height:24px; border:0; border-radius:4px; background:rgba(0,0,0,.72); color:#fff; cursor:pointer; font-size:12px; }
.thumbs .t .first { position:absolute; top:4px; left:4px; background:var(--ink); color:#fff; font-size:.7rem; font-weight:700; padding:.1rem .45rem; border-radius:999px; }
.thumbs .add { width:120px; height:90px; border:2px dashed #aeb5bd; border-radius:var(--radius); display:flex; align-items:center; justify-content:center; text-align:center; font-size:.85rem; color:var(--steel); cursor:pointer; background:#fff; font-weight:600; margin:0; }
.thumbs .add input { display:none; }
.denied-note { background:#f3f4f6; border-left:4px solid #9aa3ad; padding:.6rem .9rem; border-radius:0 var(--radius) var(--radius) 0; color:var(--steel); font-size:.92rem; margin:0 0 1rem; }
input:disabled, textarea:disabled, select:disabled { background:#f1f2f4; color:#6b7480; cursor:not-allowed; }
.order-btns { display:inline-flex; gap:.25rem; }
.order-btns button { border:1px solid #aeb5bd; background:#fff; border-radius:4px; width:32px; height:32px; cursor:pointer; }
.order-btns button:disabled { opacity:.35; cursor:default; }
table.calls input { width:4.2rem; padding:.45rem .3rem; text-align:center; }
table.calls th, table.calls td { padding:.45rem .35rem; text-align:center; }
.status-dot { display:inline-block; width:.6rem; height:.6rem; border-radius:50%; margin-right:.35rem; vertical-align:middle; }
.st-in-service { background:#2e7d4f; } .st-reserve { background:#c8a04a; } .st-out-of-service { background:var(--engine); } .st-retired { background:#9aa3ad; }
.pill.paid { background:#e2f2e7; color:#1f6b3f; } .pill.pending { background:#fff3d6; color:#7a5800; } .pill.done { background:#e1e8f7; color:#1F3A93; }
.pill.canceled, .pill.abandoned { background:#e7e9ec; color:#4a525c; }
.notice { background:#fff8e6; border-left:4px solid var(--gold); padding:.7rem 1rem; border-radius:0 var(--radius) var(--radius) 0; margin-bottom:1.4rem; }

/* Allow / Deny permission editor */
.perm-tools { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; margin-bottom:1rem; }
.perm-tools select { width:auto; min-width:16rem; }
.pgroup { border:1px solid var(--line); border-radius:var(--radius); margin-bottom:1rem; background:#fff; }
.pgroup-head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.6rem; padding:.7rem 1rem; background:var(--mist); border-bottom:1px solid var(--line); border-radius:var(--radius) var(--radius) 0 0; }
.pgroup-head h3 { margin:0; font-size:1.05rem; }
.pgroup-head .count { color:var(--steel); font-size:.88rem; font-weight:500; margin-left:.4rem; font-family:'Public Sans',sans-serif; }
.pgroup-head .btn { padding:.3rem .7rem; font-size:.85rem; }
.prow { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.55rem 1rem; border-bottom:1px solid var(--line); }
.prow:last-child { border-bottom:0; }
.prow .lbl { flex:1; }
.prow .lbl small { display:block; color:var(--steel); font-size:.8rem; }
.seg { display:inline-flex; border:1.5px solid #aeb5bd; border-radius:999px; overflow:hidden; flex:none; }
.seg label { margin:0; padding:.3rem .85rem; font-weight:600; font-size:.88rem; cursor:pointer; color:var(--steel); background:#fff; }
.seg input { position:absolute; opacity:0; width:1px; height:1px; }
.seg input:focus-visible + span { outline:3px solid var(--gold); outline-offset:2px; }
.seg label.allow:has(input:checked) { background:#2e7d4f; color:#fff; }
.seg label.deny:has(input:checked) { background:var(--engine); color:#fff; }
.seg.locked { opacity:.55; }
.seg.locked label { cursor:not-allowed; }
.sticky-save { position:sticky; bottom:0; background:#f6f7f8; padding:.8rem 0; display:flex; gap:.8rem; align-items:center; flex-wrap:wrap; border-top:1px solid var(--line); margin-top:1rem; }
.help-format { font-size:.86rem; color:var(--steel); margin:.3rem 0 0; }
