/* Westcountry Secure PHP Kit — core styles (KIT CORE — put project styles in project.css).
   Served through style.php, which swaps the {{tokens}} for the brand colours in config.php.
   No CSS variables and no outside fonts, so it works everywhere under the strict security policy. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #F4F1EA; color: #1F2A33; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.4; padding-bottom: env(safe-area-inset-bottom); }
h1, h2, h3, .top-title strong { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-weight: 700; color: #14233C; }
.top-title strong { color: #FDFAF4; }
h2 { font-size: 1.15rem; margin: 18px 0 10px; }
h3 { font-size: 1rem; margin: 14px 0 8px; }
a { color: #2E7D5B; }
.muted { color: #66717A; }
.small { font-size: .85rem; }
.pad { padding: 16px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.text-bad { color: #C0392B; }
code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: .9em; }

/* ── top bar & tabs ── */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; background: #14233C; color: #FDFAF4; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
.top-logo { width: 40px; height: 40px; border-radius: 50%; background: #FDFAF4; object-fit: cover; }
.top-title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.top-title span { font-size: .78rem; opacity: .8; font-style: italic; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); color: #FDFAF4; width: 42px; height: 42px; border-radius: 10px; font-size: 1.2rem; cursor: pointer; }
.icon-btn.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 19; display: flex; gap: 4px; overflow-x: auto; background: #FDFAF4; border-bottom: 1px solid #E3DCCB; padding: 6px 8px; -webkit-overflow-scrolling: touch; }
.tabs button { flex: 0 0 auto; background: none; border: 0; padding: 9px 14px; border-radius: 999px; font: 600 .95rem -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #14233C; cursor: pointer; }
.tabs button.active { background: #14233C; color: #FDFAF4; }
.tabs .tab-cog { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; }
.tabs .tab-cog svg { display: block; }
.view { max-width: 980px; margin: 0 auto; padding: 12px 12px 40px; }
.foot { text-align: center; font-size: .78rem; color: #66717A; padding: 18px 0 30px; }

/* ── login ── */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #FDFAF4; border-radius: 16px; padding: 26px 22px; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.login-card h1 { text-align: center; margin: 6px 0 16px; font-size: 1.35rem; }
.login-logo { display: block; width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; object-fit: cover; }

/* ── cards ── */
.card { background: #FDFAF4; border: 1px solid #E3DCCB; border-radius: 14px; padding: 14px; margin: 0 0 10px; }
.card.tight { padding: 10px 12px; }
.card.click { cursor: pointer; }
.card-row { display: flex; align-items: flex-start; gap: 10px; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 700; font-size: 1.02rem; }
.card-sub { font-size: .88rem; color: #66717A; margin-top: 2px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: #FDFAF4; border: 1px solid #E3DCCB; border-radius: 14px; padding: 12px; }
.stat b { display: block; font: 700 1.5rem -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #14233C; }
.stat span { font-size: .85rem; color: #66717A; }

/* ── pills & badges ── */
.pills { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; }
.pill { flex: 0 0 auto; border: 1px solid #E3DCCB; background: #FDFAF4; color: #14233C; border-radius: 999px; padding: 7px 12px; font: 600 .88rem -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; cursor: pointer; }
.pill.active { background: #2E7D5B; border-color: #2E7D5B; color: #fff; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; background: #e9e6df; color: #1F2A33; }
.b-good { background: #d8ecd0; color: #2f6b1b; }
.b-bad { background: #fbe1dd; color: #a12a1d; }
.b-warn { background: #fdebd0; color: #8a5a00; }
.b-off { background: #ddd; color: #555; }
.b-strong { background: #14233C; color: #FDFAF4; }
.b-gold { background: #C8951A; color: #fff; }

/* ── buttons & forms ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid #E3DCCB; background: #fff; color: #14233C; font: 600 .92rem -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; }
.btn-primary { background: #14233C; border-color: #14233C; color: #FDFAF4; }
.btn-go { background: #2E7D5B; border-color: #2E7D5B; color: #fff; }
.btn-gold { background: #C8951A; border-color: #C8951A; color: #fff; }
.btn-danger { background: #fff; border-color: #C0392B; color: #C0392B; }
.btn-sm { min-height: 34px; padding: 5px 10px; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
label { display: block; font-weight: 600; font-size: .88rem; margin: 10px 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 20px; height: 20px; flex: 0 0 auto; }
.menu-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.menu-checks label.check { margin: 4px 0; }
.menu-order { max-width: 420px; }
.mo-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #E3DCCB; }
.mo-row:first-child { border-top: 0; }
.mo-row strong { flex: 1; }
.mo-n { width: 22px; text-align: right; color: #66717A; font-size: .85rem; }
input, select, textarea { width: 100%; padding: 10px 11px; border: 1px solid #E3DCCB; border-radius: 9px; background: #fff; color: #1F2A33; font: 16px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.alert { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: .92rem; }
.alert-bad { background: #fdecea; border: 1px solid #C0392B; color: #8f2318; }
.alert-warn { background: #fff4dc; border: 1px solid #C8951A; }
.alert-ok { background: #e9f4e2; border: 1px solid #8DB82E; }

/* ── tables ── */
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; background: #FDFAF4; border-radius: 12px; overflow: hidden; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid #E3DCCB; text-align: left; }
.tbl th { background: #14233C; color: #FDFAF4; font-weight: 600; }
.scroll-x { overflow-x: auto; }

/* ── date boxes on a computer (1.8.1): typed date + calendar button; iPad/iPhone keep Apple's picker ── */
.k-datewrap { display: flex; gap: 6px; align-items: stretch; width: 100%; }
.k-datewrap .k-date { flex: 1 1 auto; min-width: 8.5em; }
.k-date-bad { border-color: #C0392B !important; box-shadow: 0 0 0 2px rgba(192,57,43,.15); }
.k-datebtn { flex: 0 0 auto; border: 1px solid #E3DCCB; background: #fff; border-radius: 9px; padding: 0 10px; font-size: 1rem; cursor: pointer; }
.k-datebtn:hover { border-color: #2E7D5B; }
.k-datebtn:disabled { opacity: .45; cursor: default; }
.k-cal { position: fixed; z-index: 70; width: 268px; background: #FDFAF4; border: 1px solid #E3DCCB; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 10px; font-size: .9rem; }
.k-cal-head { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; }
.k-cal-head select { width: auto; padding: 5px 4px; font-size: .9rem; flex: 1 1 auto; }
.k-cal-head button, .k-cal-foot button { border: 1px solid #E3DCCB; background: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; color: #1F2A33; }
.k-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.k-cal-dow { color: #66717A; font-size: .75rem; font-weight: 600; padding: 2px 0 4px; }
.k-cal-grid button { border: 0; background: transparent; border-radius: 8px; padding: 6px 0; cursor: pointer; font: inherit; color: #1F2A33; }
.k-cal-grid button:hover { background: #F4F1EA; }
.k-cal-grid button.today { box-shadow: inset 0 0 0 1px #2E7D5B; }
.k-cal-grid button.on { background: #14233C; color: #FDFAF4; }
.k-cal-grid button:disabled { color: #E3DCCB; cursor: default; background: transparent; }
.k-cal-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* ── modal & toast ── */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: #FDFAF4; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 18px; } }
.modal-card h2 { margin-top: 0; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: #14233C; color: #FDFAF4; padding: 12px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; max-width: calc(100% - 24px); box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.toast[hidden] { display: none; }
.toast button { background: #C8951A; color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 700; cursor: pointer; }
.toast.bad { background: #8f2318; }

/* ── security screens ── */
.activity { padding: 0; margin: 0; }
.activity li { font-size: .85rem; padding: 6px 0; border-bottom: 1px solid #E3DCCB; list-style: none; }
.activity li.sec { border-left: 3px solid #C8951A; padding-left: 8px; }
.qr { display: block; width: 220px; height: 220px; margin: 10px auto; background: #fff; padding: 10px; border-radius: 10px; border: 1px solid #E3DCCB; }
.secret { font: 600 1.05rem ui-monospace, Menlo, monospace; letter-spacing: .06em; text-align: center; background: #fff; border: 1px dashed #E3DCCB; border-radius: 8px; padding: 8px; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font: 600 1rem ui-monospace, Menlo, monospace; background: #fff; border: 1px solid #E3DCCB; border-radius: 10px; padding: 12px; text-align: center; }
.gate { max-width: 560px; margin: 20px auto; }
.dev { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed #E3DCCB; font-size: .9rem; }
.dev > div { flex: 1; min-width: 0; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: #66717A; font-size: .85rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid #E3DCCB; }
.btn-passkey { background: #FDFAF4; border-color: #14233C; }
#pk-setup-msg:empty, #pk-msg:empty { display: none; }

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .top-title span { display: none; }
  .tabs { gap: 2px; padding: 6px 4px; }
  .tabs button { padding: 8px 9px; font-size: .88rem; }
}
/* Westcountry.au 2026 (c) */
