/* ChurchOS admin — self-contained, no build step required */
:root {
  --brand: #7a2e3a;
  --brand-ink: #fff;
  --accent: #c9a227;
  --bg: #f5f4f1;
  --panel: #ffffff;
  --ink: #1d1b19;
  --muted: #6b6560;
  --line: #e6e2dc;
  --ok: #1f7a4d;
  --ok-bg: #e5f4ec;
  --warn: #9a6a00;
  --warn-bg: #fdf3d8;
  --bad: #b3261e;
  --bad-bg: #fbe8e6;
  --info-bg: #eaf0f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
img { max-width: 100%; }

/* Shell */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #1f1a18; color: #d9d3cc; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; padding: .25rem .5rem 1rem; border-bottom: 1px solid #332b28; margin-bottom: .75rem; }
.sidebar .brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: #fff; }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; font-size: .85rem; }
.nav-label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #8c827a; padding: .9rem .6rem .3rem; }
.sidebar a { display: flex; justify-content: space-between; align-items: center; color: #d9d3cc; padding: .45rem .6rem; border-radius: 7px; font-size: .92rem; }
.sidebar a:hover { background: #2c2522; text-decoration: none; color: #fff; }
.sidebar a.active { background: var(--brand); color: var(--brand-ink); }
.sidebar .count { background: var(--accent); color: #1d1b19; border-radius: 99px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.5rem; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .who { color: var(--muted); font-size: .9rem; display: flex; gap: .75rem; align-items: center; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .6rem; font-size: 1.1rem; }
.content { padding: 1.5rem; max-width: 1280px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem; margin-bottom: 1.25rem; }
.page-head p { margin: 0; color: var(--muted); }

/* Panels & grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card > h2:first-child { margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .82rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.brand { border-top: 3px solid var(--brand); }
.stat.accent { border-top: 3px solid var(--accent); }
.stat.ok { border-top: 3px solid var(--ok); }
.stat.bad { border-top: 3px solid var(--bad); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #faf9f7; }
tbody tr:hover { background: #fbfaf8; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
tr.voided td { color: var(--muted); text-decoration: line-through; }
.empty { text-align: center; color: var(--muted); padding: 2rem; }

/* Forms */
form .row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=tel], input[type=url], input[type=search], input[type=color], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #cfc9c1; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input[type=color] { padding: .15rem; height: 2.4rem; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
.error { color: var(--bad); font-size: .8rem; margin-top: .25rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters > div { min-width: 140px; }
.filters label { font-size: .75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .95rem; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; background: var(--brand); color: var(--brand-ink); white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #cfc9c1; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.link { background: none; color: var(--brand); padding: 0; border: 0; }
.btn.sm { padding: .3rem .6rem; font-size: .8rem; }
form.inline { display: inline; }

/* Badges & alerts */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: #eee; color: #444; text-transform: capitalize; }
.badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.approved, .badge.info { background: var(--info-bg); color: #24508f; }
.badge.paid, .badge.success, .badge.active { background: var(--ok-bg); color: var(--ok); }
.badge.rejected, .badge.failed, .badge.cancelled, .badge.voided { background: var(--bad-bg); color: var(--bad); }
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert.success { background: var(--ok-bg); border-color: #b9e0cb; color: #145236; }
.alert.error { background: var(--bad-bg); border-color: #f1c2bd; color: #7a1a14; }
.alert.info { background: var(--info-bg); border-color: #c8d6ea; color: #1d3f72; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 1rem; }
dl.details { display: grid; grid-template-columns: 170px 1fr; gap: .4rem 1rem; margin: 0; }
dl.details dt { color: var(--muted); font-size: .88rem; }
dl.details dd { margin: 0; }

/* Pagination (Laravel bootstrap-5 markup) */
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.pagination .page-link { display: block; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: .85rem; }
.pagination .active .page-link { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled .page-link { color: #aaa; }
nav .small.text-muted, nav p.small { color: var(--muted); font-size: .82rem; margin: .5rem 0 0; }
nav .d-sm-none { display: none; }

/* Bars (budget utilisation) */
.bar { height: 8px; background: #eee9e2; border-radius: 99px; overflow: hidden; min-width: 90px; }
.bar > span { display: block; height: 100%; background: var(--ok); }
.bar > span.over { background: var(--bad); }
.bar > span.near { background: var(--accent); }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #1f1a18, #3a2420); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.auth-card .btn { width: 100%; justify-content: center; }

/* Responsive */
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 20; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .menu-toggle { display: inline-block; }
  .content { padding: 1rem; }
  .g2, .g3 { grid-template-columns: 1fr; }
  dl.details { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .topbar .who span { display: none; } }

/* Print (receipts, vouchers, reports) */
@media print {
  .sidebar, .topbar, .no-print, .filters, .pagination { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; }
}

/* Website registration: possible matches on the register */
.match-box { background: var(--info-bg); border: 1px solid #c8d6ea; border-radius: var(--radius); padding: .9rem 1rem; margin: 0 0 1rem; display: grid; gap: .5rem; }
.match { display: flex; gap: .6rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; cursor: pointer; }
.match input { margin-top: .3rem; }
.match:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.match-box .btn { justify-self: start; }

/* Member approvals: sidebar sub-link, top-bar reminder, list tabs, dashboard card */
.sidebar a.sub-link { padding-left: 2.1rem; font-size: .9rem; }
.notice-pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--accent); color: #fff !important; font-weight: 600; font-size: .85rem; padding: .3rem .75rem; border-radius: 99px; text-decoration: none; animation: notice-in .4s ease both; }
.notice-pill:hover { filter: brightness(.95); }
@keyframes notice-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tabs { display: flex; gap: .3rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--accent); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.card.approvals { border-left: 4px solid var(--accent); }
.card.approvals .plain-list li { align-items: center; }
@media (max-width: 760px) { .notice-pill { font-size: .78rem; padding: .25rem .6rem; } }

/* Church Council list: initials when there is no photo */
.avatar-initials { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; }
