:root { color-scheme: only light; }
/* HG Ministry admin. Plain and practical: forms, lists and an uploader. */

@font-face {
  font-family: "DM Sans";
  src: url("../assets/fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --ink: #0b0b0b; --gray: #6b6b6b; --mist: #f5f5f3; --line: #e0e0de; --white: #fff;
  --danger: #b3261e; --ok: #2f6b3c;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 1rem/1.55 var(--font); color: var(--ink); background: var(--mist); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0 0 1em; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; white-space: nowrap; }
.brand .logo { display: block; width: auto; height: 34px; aspect-ratio: 2152 / 1724; fill: currentColor; }
.brand span { padding-left: 12px; border-left: 1px solid var(--line); color: var(--gray); }
.sprite { position: absolute; }

/* ---------- buttons and fields ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink);
  font: 500 0.95rem/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--ink); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); background: #fdf1f0; }
.btn--small { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.linklike { padding: 4px 0; border: 0; background: none; color: var(--ink); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

label { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 500; color: var(--ink); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--ink); font: 400 1rem/1.4 var(--font);
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.hint { margin: 6px 0 0; font-size: 0.85rem; font-weight: 400; color: var(--gray); }
.form-msg { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fdf1f0; color: var(--danger); font-size: 0.9rem; }
.form-msg.is-ok { background: #eef6ef; color: var(--ok); }

.form { display: grid; gap: 18px; max-width: 720px; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: start; }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
fieldset { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); display: grid; gap: 16px; }
legend { padding: 0 8px; font-weight: 500; color: var(--ink); }

/* ---------- sign-in screens ---------- */

.gate { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.gate__note { color: var(--gray); }
.gate__card { width: min(100%, 420px); padding: clamp(24px, 5vw, 40px); border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.45); }
.gate__card h1 { margin: 26px 0 8px; font-size: 1.75rem; }
.gate__lede { color: var(--gray); }
.gate__card form { display: grid; gap: 16px; margin-top: 22px; }
.gate__links { display: grid; justify-items: start; gap: 6px; margin-top: 20px; font-size: 0.9rem; }
.gate__foot { margin: 24px 0 0; font-size: 0.9rem; }

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

.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px clamp(16px, 4vw, 40px); background: var(--white); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; margin-right: auto; overflow-x: auto; max-width: 100%; }
.tabs button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--gray); font: 500 0.95rem var(--font); white-space: nowrap; cursor: pointer; }
.tabs button:hover { background: var(--mist); }
.tabs button[aria-current="true"] { background: var(--ink); color: #fff; }
.top__user { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; color: var(--gray); }

.panel { width: min(100% - 2 * clamp(16px, 4vw, 40px), 1160px); margin: 0 auto; padding-block: clamp(24px, 4vw, 44px) 96px; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.panel__head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.panel__sub { margin: 6px 0 0; color: var(--gray); }
.back { display: inline-block; margin-bottom: 14px; font-size: 0.9rem; }
.empty { padding: 40px 20px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; color: var(--gray); background: var(--white); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--mist); color: var(--gray); font-size: 0.78rem; font-weight: 500; }
.pill--live { background: #fdecec; color: var(--danger); }
.pill--ok { background: #eef6ef; color: var(--ok); }
.note { padding: 14px 16px; border-left: 3px solid var(--ink); border-radius: 0 10px 10px 0; background: var(--white); color: var(--gray); font-size: 0.92rem; }

/* ---------- folders ---------- */

/* Links tab */
.linkrow { min-width: 0; }
.linkrow h3 .pill { margin-left: 4px; }
.linkrow__address { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.82rem !important; color: var(--ink) !important; overflow-wrap: anywhere; }

/* The full web address under the "Web address" box */
.address-full { display: block; margin-top: 6px; color: var(--ink); overflow-wrap: anywhere; }

/* A folder's own web address, with a Copy button */
.sharelink { margin-bottom: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.sharelink__row { display: flex; gap: 8px; margin-top: 6px; }
.sharelink__row input { flex: 1; min-width: 0; color: var(--gray); }
.sharelink__row .btn { flex: none; }

/* An event's own sign-up questions */
.questions-head { display: grid; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.questions { display: grid; gap: 12px; }
.question { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--mist); }
.question__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.question__label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; }
.options { display: grid; gap: 8px; margin-bottom: 8px; }
.option { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(90px, 1fr) auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .option { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Sub-folders inside an open folder */
.subfolders { margin-bottom: 24px; }
.subfolders__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.subfolders__head .subhead { margin: 0; }
.folders--small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }

.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.folder { border: 1px solid var(--line); border-radius: 14px; background: var(--white); overflow: hidden; }
.folder button { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.folder__cover { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--mist) center / cover no-repeat; color: #b9b9b7; font-size: 0.85rem; }
.folder__body { padding: 14px 16px 16px; }
.folder__body h3 { font-size: 1.05rem; }
.folder__body p { margin: 4px 0 0; font-size: 0.875rem; color: var(--gray); }

.drop { display: grid; place-items: center; gap: 8px; padding: 34px 20px; border: 2px dashed #c4c4c2; border-radius: 16px; background: var(--white); text-align: center; color: var(--gray); transition: background-color 0.2s, border-color 0.2s; }
.drop.is-over { border-color: var(--ink); background: #fafaf9; }
.drop strong { color: var(--ink); font-weight: 500; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.queue { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
.queue li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); }
.queue .is-done { color: var(--ok); }
.queue .is-failed { color: var(--danger); }
.queue span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; }
.item { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.item__thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--mist) center / cover no-repeat; overflow: hidden; }
.item__kind { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 0.72rem; }
.item__cover { position: absolute; right: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 0.72rem; font-weight: 500; }
.item input[type="text"] { min-height: 38px; padding: 6px 10px; font-size: 0.9rem; }
.item__actions { display: flex; gap: 6px; }
.item__actions .btn { flex: 1; }

/* ---------- lists (events, admins) ---------- */

.rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.row h3 { font-size: 1.05rem; }
.row p { margin: 2px 0 0; font-size: 0.875rem; color: var(--gray); }
.row__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row p .pill { margin-right: 4px; }
.table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td:nth-child(5) { max-width: 260px; white-space: pre-wrap; color: var(--gray); }
.subhead { margin: 30px 0 12px; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray); }
.preview-img { display: block; max-width: 260px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- toasts ---------- */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; max-width: min(92vw, 380px); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 0.92rem; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.6); }
.toast.is-error { background: var(--danger); }

@media (max-width: 720px) {
  .top__user span { display: none; }
  .tabs { order: 3; width: 100%; }
}

/* Admins: what each person can use */
.check--top { align-items: flex-start; }
.check--top input { flex: none; margin-top: 3px; }
.check--top > span { display: grid; gap: 2px; }
.check--top strong { font-weight: 600; }
.access { gap: 14px; }
.access__areas { display: grid; gap: 12px; margin-left: 28px; padding-left: 14px; border-left: 2px solid var(--line); }

/* Front door */
.door-unlock__box { display: grid; gap: 8px; margin: 18px 0 8px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.door-unlock { min-height: 64px; font-size: 1.05rem; }
.door-unlock__status:empty { display: none; }
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.door-setup { margin-top: 34px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.door-setup summary { cursor: pointer; font-weight: 600; }
.door-setup > .btn { margin: 6px 0 16px; }
.codebox { width: 100%; margin-top: 6px; font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow: auto; }
.door-setup .steps { margin: 14px 0; padding-left: 20px; display: grid; gap: 8px; }
.door-setup > label { margin: 8px 0 12px; }
.phones { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.phones li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 10px; border-radius: 8px; background: var(--mist); font-size: 0.9rem; }
.pill--open { background: #fff4e5; color: #b45309; }
.row p .pill--open, .row p .pill--ok { margin: 0 6px 4px 0; }
.subhead-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.subhead-row .subhead { margin: 0; }


.row__meta { color: var(--gray); font-size: 0.86rem; }
