/* Parent Health — application (portal) styles. Builds on styles.css variables. */
.app-page { background: var(--cream); }

.app-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--ink-2); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--teal-100); border-top-color: var(--teal-600); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Top bar */
.pbar { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.pbar .inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 18px; }
.pbar .brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.pbar .brand img { width: 38px; height: 38px; }
.pbar .brand .wm-p { color: var(--brand-navy); } .pbar .brand .wm-h { color: var(--brand-teal); margin-left:.12em; }
.pbar .pnav { display: flex; gap: 4px; margin-left: 10px; flex-wrap: wrap; }
.pbar .pnav a { padding: 8px 14px; border-radius: 999px; font-size: .92rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.pbar .pnav a:hover { background: var(--teal-50); color: var(--teal-700); }
.pbar .pnav a.active { background: var(--teal-600); color: #fff; }
.pbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pbar .who { text-align: right; line-height: 1.1; }
.pbar .who b { font-size: .9rem; color: var(--teal-900); display: block; }
.pbar .who span { font-size: .74rem; color: var(--muted); }
.role-chip { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; }
.role-chip.individual { background: var(--teal-50); color: var(--teal-700); }
.role-chip.doctor { background: #e7e0f0; color: #5b4a86; }
.role-chip.admin { background: #fde8d5; color: #a5590f; }

.pwrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }
.phead { margin-bottom: 22px; }
.phead h1 { font-size: 1.7rem; margin: 0 0 4px; }
.phead p { margin: 0; color: var(--ink-2); }

/* Auth screens */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brandside { background: linear-gradient(150deg, var(--brand-navy), var(--teal-700) 60%, var(--brand-teal)); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-brandside img { width: 76px; height: 76px; background: #fff; border-radius: 18px; padding: 8px; }
.auth-brandside h2 { color: #fff; font-size: 2rem; margin: 22px 0 10px; }
.auth-brandside p { color: #d7ece8; font-size: 1.05rem; max-width: 360px; }
.auth-brandside ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-brandside li { display: flex; gap: 10px; align-items: center; color: #eafffb; font-size: .96rem; }
.auth-formside { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo-sm { display: none; }
.auth-tabs { display: flex; gap: 6px; background: var(--sand); padding: 5px; border-radius: 999px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; padding: 10px; border: none; background: none; border-radius: 999px; font-weight: 600; font-size: .95rem; cursor: pointer; color: var(--ink-2); }
.auth-tabs button.active { background: #fff; color: var(--teal-700); box-shadow: var(--shadow-sm); }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .88rem; color: var(--teal-900); margin-bottom: 6px; }
.field .input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--sans); font-size: .98rem; background: #fff; }
.field .input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-50); }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { background: #fde8e7; color: #b1322e; padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 14px; display: none; }
.form-ok { background: var(--teal-50); color: var(--teal-700); padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 14px; display: none; }
.muted-link { color: var(--teal-600); cursor: pointer; font-weight: 600; }
.divider-or { text-align: center; color: var(--muted); font-size: .82rem; margin: 16px 0; position: relative; }
.divider-or::before, .divider-or::after { content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--line); }
.divider-or::before { left: 0; } .divider-or::after { right: 0; }
.btn-google { width: 100%; justify-content: center; background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-google:hover { background: var(--sand); }

/* Cards / grids */
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); }
.pgrid { display: grid; gap: 18px; }
.pgrid.g2 { grid-template-columns: repeat(2, 1fr); }
.pgrid.g3 { grid-template-columns: repeat(3, 1fr); }
.pgrid.g4 { grid-template-columns: repeat(4, 1fr); }

.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat-tile .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.stat-tile .v { font-family: var(--serif); font-size: 1.7rem; color: var(--teal-900); margin-top: 2px; }

.pkg-card { display: flex; flex-direction: column; }
.pkg-card .price { font-family: var(--serif); font-size: 1.5rem; color: var(--teal-700); margin: 6px 0; }
.pkg-card ul { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 7px; font-size: .9rem; color: var(--ink-2); }
.pkg-card ul li::before { content: "✓ "; color: var(--teal-500); font-weight: bold; }
.pkg-card .btn { margin-top: auto; justify-content: center; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 14px; }
.ptable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 640px; }
.ptable th, .ptable td { padding: 13px 16px; text-align: left; font-size: .92rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable thead th { background: var(--teal-50); color: var(--teal-800); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.ptable tr:last-child td { border-bottom: none; }
.ptable td small { display: block; color: var(--muted); font-size: .8rem; }
.ptable .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.badge.pending { background: #fdf1dd; color: #a5720f; }
.badge.approved, .badge.confirmed, .badge.paid, .badge.completed { background: var(--teal-50); color: var(--teal-700); }
.badge.rejected, .badge.pending_payment { background: #fde8e7; color: #b1322e; }
.badge.info, .badge.reports_uploaded, .badge.sample_collected { background: #e3edf7; color: #2f5d86; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { padding: 11px 16px; border: none; background: none; font-weight: 600; font-size: .93rem; color: var(--ink-2); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--teal-700); border-bottom-color: var(--teal-600); }

/* Payment */
.pay-box { max-width: 460px; margin: 0 auto; text-align: center; }
.pay-qr { width: 260px; height: auto; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; margin: 12px auto; }
.pay-amt { font-family: var(--serif); font-size: 2rem; color: var(--teal-900); }

/* Confirmation */
.confirm-tick { width: 84px; height: 84px; border-radius: 50%; background: var(--teal-50); color: var(--teal-600); display: grid; place-items: center; margin: 0 auto 14px; }

/* Toast */
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--teal-900); color: #fff; padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-lg); font-size: .9rem; opacity: 0; transform: translateY(12px); transition: .3s; }
.toast.in { opacity: 1; transform: none; }
.toast.err { background: var(--alert); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brandside { display: none; }
  .auth-card .logo-sm { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; }
  .auth-card .logo-sm img { width: 44px; height: 44px; }
  .pgrid.g2, .pgrid.g3, .pgrid.g4 { grid-template-columns: 1fr; }
  .field.two { grid-template-columns: 1fr; }
  .pbar .pnav { display: none; }
}
