/* AMERG Admin – extra styles on top of the main site stylesheet. */
body.admin { background: #F4F6F9; }
.admin-user { color: #D6E2F0; font-size: 16px; }
.admin-user a, .linklike { color: #FFDE5A; }
.linklike { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.inline { display: inline; }
.admin-layout { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 24px; padding-bottom: 48px; align-items: flex-start; }
.admin-nav { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; position: sticky; top: 12px; }
.admin-nav a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.admin-nav a:hover { background: #F1F5F9; }
.admin-nav a[aria-current="page"] { background: var(--navy); color: #fff; font-weight: 700; }
.admin-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.admin-title { font-size: 34px; color: var(--navy); margin: 0; }
@media (max-width: 860px) {
  .admin-nav { max-width: none; flex-direction: row; flex-wrap: wrap; position: static; }
  .admin-nav a { padding: 8px 10px; }
}
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.box > :last-child { margin-bottom: 0; }
.box h2 { font-size: 22px; color: var(--navy); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: var(--ink); }
.stat strong { display: block; font-size: 34px; color: var(--navy); line-height: 1.1; }
.stat--alert strong { color: var(--red); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table.list { width: 100%; border-collapse: collapse; font-size: 16px; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { background: #F8FAFC; font-size: 15px; color: var(--muted2); white-space: nowrap; }
table.list tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.record { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.record h3 { margin: 0; font-size: 20px; }
.record dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 16px; }
.record dt { font-weight: 700; color: var(--muted2); }
.record dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.record--done { opacity: .7; }
.chip { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #E2E8F0; color: #334155; }
.chip--open, .chip--high { background: #FEE2E2; color: #7F1D1D; }
.chip--progress, .chip--medium { background: #FEF3C7; color: #78350F; }
.chip--done, .chip--low { background: #DCFCE7; color: #14532D; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; font-size: 15px; }
.bar { height: 14px; background: var(--blue); border-radius: 7px; min-width: 2px; }
.level-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.level-choice label { border: 2px solid #CBD5E1; border-radius: 12px; padding: 14px; display: flex; gap: 10px; align-items: center; font-weight: 700; cursor: pointer; background: #fff; }
.level-choice input { width: 22px; height: 22px; }
.level-choice .lv-auto { border-color: var(--navy); }
.level-choice .lv-normal { border-color: var(--green); }
.level-choice .lv-warning { border-color: #D4A800; background: #FFFBEB; }
.level-choice .lv-emergency { border-color: var(--red); background: #FEF2F2; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb { width: 90px; height: 60px; object-fit: cover; border-radius: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters a { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-size: 16px; }
.filters a[aria-current="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.login-box { max-width: 460px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: #F1F5F9; padding: 2px 6px; border-radius: 4px; word-break: break-all; }
@media print {
  .admin-nav, .site-header, .status, .actions, form, .filters, .no-print { display: none !important; }
  .admin-layout { display: block; }
  .record { break-inside: avoid; }
}

/* Volunteer filters (added 17 Oct 2026, update 2) */
.filter-label { margin: 12px 0 6px; font-weight: 700; }
.filter-result { margin: 0 0 10px; }
.record--overdue { border: 3px solid #C42A0E; box-shadow: 0 0 0 3px #FEE2E2; }
.stat--overdue { background: #FEF2F2; border-color: #C42A0E; }

/* Document cabinet (added 17 Oct 2026, update 2) */
.doc-search label { display: block; margin-bottom: 6px; }
.doc-search__row { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-search__row input { flex: 1 1 260px; min-height: 48px; font: inherit; padding: 8px 12px; border: 2px solid var(--line); border-radius: 10px; }
.doc-cat { margin: 26px 0 10px; font-size: 24px; color: var(--navy); }
.doc-table td { vertical-align: top; }
.doc-table .tag { display: inline-block; margin-top: 4px; text-decoration: none; }
.snippet { display: inline-block; margin-top: 4px; font-style: italic; color: #334155; background: #FFFBEB; padding: 2px 6px; border-radius: 4px; }
.cat-row { align-items: flex-end; }
#categories summary { cursor: pointer; font-size: 18px; }
/* Buttons inside a filter row keep their button look (the "Add" buttons were white on white). */
.filters a.btn { background: var(--navy); color: #fff; border: 2px solid var(--navy); border-radius: 10px; }
.filters a.btn.btn--outline { background: #fff; color: var(--navy); }
.table-wrap { position: relative; } /* keeps hidden screen-reader labels inside the table box on phones */

/* Document cabinet: the buttons in each row sit in one tidy column, all the same width (17 Oct 2026) */
.doc-table td:last-child { width: 150px; }
.doc-table td:last-child .actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.doc-table td:last-child .actions form.inline { display: block; margin: 0; }
.doc-table td:last-child .actions .btn { width: 100%; white-space: nowrap; justify-content: center; }
/* Welfare logins: choose the volunteer for a person on the register (17 Oct 2026) */
.assign { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.assign select { font: inherit; min-height: 40px; padding: 4px 8px; border: 2px solid var(--line); border-radius: 8px; max-width: 100%; }

/* Team updates (added 18 Oct 2026) */
.box__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.box__head h2 { margin: 0; }
.updates { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.update { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--navy); border-radius: 12px; padding: 12px 16px; }
.update--pinned { background: #F5F8FC; }
.update--urgent { border-left-color: #C42A0E; background: #FEF2F2; }
.update__meta { font-size: 16px; color: var(--muted2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.update__text { margin: 6px 0; white-space: normal; overflow-wrap: anywhere; font-size: 18px; }
.update__tags { margin: 4px 0 8px; font-size: 16px; }
.update .actions { margin-top: 6px; }
.update-form__row { display: flex; flex-wrap: wrap; gap: 18px; margin: 6px 0; }
.update-form__tags { margin: 8px 0; }
.update-form__tags summary { cursor: pointer; }
.tag-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; margin-top: 8px; }
details > summary.btn { list-style: none; display: inline-flex; margin: 10px 0; cursor: pointer; }
details > summary.btn::-webkit-details-marker { display: none; }

/* Activity: short column chart for "Visitors each day" (18 Oct 2026). Every day's numbers show on hover, tap or keyboard focus. */
.vchart { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 22px; border-bottom: 1px solid var(--line); }
.vchart__col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: pointer; outline: none; }
.vchart__bar { display: block; width: 100%; max-width: 22px; background: var(--blue); border-radius: 4px 4px 0 0; }
.vchart__bar--zero { height: 2px !important; background: var(--line); border-radius: 0; }
.vchart__val { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 4px; visibility: hidden; }
.vchart__val--show { visibility: visible; }
.vchart__col:hover .vchart__bar, .vchart__col:focus .vchart__bar { background: var(--navy); }
.vchart__col:focus-visible .vchart__bar { outline: 2px solid var(--navy); outline-offset: 2px; }
.vchart__tip { display: none; position: absolute; bottom: calc(100% - 14px); left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap;
  background: var(--navy); color: #fff; font-size: 14px; line-height: 1.35; padding: 6px 10px; border-radius: 8px; box-shadow: 0 4px 12px rgba(15,30,50,.25); pointer-events: none; }
.vchart__col--start .vchart__tip { left: 0; transform: none; }
.vchart__col--end .vchart__tip { left: auto; right: 0; transform: none; }
.vchart__col:hover .vchart__tip, .vchart__col:focus .vchart__tip { display: block; }
.vchart__axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted2); margin-top: 4px; }

/* Coordination (18 Oct 2026): long addresses and links wrap on phones; volunteer drop-downs fit their box. */
.record dd { overflow-wrap: anywhere; }
.record select, .assign select { max-width: 100%; }
@media (max-width: 600px) { .record dl { grid-template-columns: 1fr; } .record dt { margin-top: 6px; } }

/* 18 Oct 2026 (late): Volunteers table fits the page – Edit and Delete sit under each name, notes under the name too. */
table.vol-list td:first-child { min-width: 9.5rem; }
table.vol-list .vol-contact a[href^="tel:"] { white-space: nowrap; }
table.vol-list .vol-contact a[href^="mailto:"] { overflow-wrap: break-word; }
.vol-actions { margin-top: 8px; }
a.chip { text-decoration: none; margin-top: 4px; }
a.chip:hover, a.chip:focus { text-decoration: underline; }
/* "Ask for this to be deleted" (agreed 18 Oct 2026). */
details.ask-delete { display: inline-block; vertical-align: top; }
details.ask-delete > summary { list-style: none; cursor: pointer; }
details.ask-delete > summary::-webkit-details-marker { display: none; }
details.ask-delete[open] { display: block; width: 100%; min-width: 14rem; margin-top: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
details.ask-delete .form { margin-top: 10px; }
.delreq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.delreq-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
.delreq-list .actions { margin-top: 8px; }
