:root {
  --navy: #1f3864;
  --navy-dark: #14264a;
  --accent: #2f6fed;
  --light-blue: #eaf1fc;
  --border: #d8dee8;
  --text: #23272f;
  --muted: #667085;
  --success: #1e7a3a;
  --success-bg: #e7f6ec;
  --error: #b3261e;
  --error-bg: #fdecea;
  --warn: #92610a;
  --warn-bg: #fff5e0;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f6fa;
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: #fff;
  padding: 14px 0;
}
.header-inner { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 10px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 50px; height: 50px; object-fit: contain; background: #fff; border-radius: 50%; padding: 5px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.brand-name { font-size: 1.35rem; font-weight: 700; }
.brand-sub { font-size: .95rem; opacity: .85; }

.page-content { flex: 1 0 auto; padding: 28px 20px 60px; }

.site-footer {
  flex-shrink: 0;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: #fff;
}

h1, h2, h3 { color: var(--navy); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; margin-top: 2rem; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(20, 38, 74, .06);
}

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: .95rem; }
#lookupMessage:not(:empty) { margin-top: 18px; }
#feeBlocks:not(:empty) { margin-top: 4px; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b9e4c5; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #f3c2bd; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0dca0; }

.notice-closed {
  text-align: center;
  padding: 60px 20px;
}
.notice-closed h1 { font-size: 1.4rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: .88rem; color: var(--navy); }
label .req { color: var(--error); }

input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=password], select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .2s ease, background-color .2s ease;
}
input:hover, select:hover, textarea:hover { border-color: #aab6c8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.field-error { border-color: var(--error) !important; background: var(--error-bg); }

.file-input {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fafbfe;
  transition: border-color .2s ease, background-color .2s ease;
}
.file-input:hover { border-color: var(--accent); background: var(--light-blue); }
.file-input-btn { margin: 0; cursor: pointer; }
.file-input-name { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.file-input-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-input-hidden:focus-visible + .file-input-btn,
.file-input-btn:has(+ .file-input-hidden:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { resize: vertical; min-height: 70px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  border: none;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: #2358c4; }
.btn.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn.btn-secondary:hover { background: var(--light-blue); }
.btn.btn-danger { background: var(--error); }
.btn.btn-success { background: var(--success); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: var(--light-blue); color: var(--navy); font-weight: 700; }
tr:hover td { background: #fafbfe; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-regular { background: var(--light-blue); color: var(--navy); }
.badge-due { background: #fdecea; color: var(--error); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-verified { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--error-bg); color: var(--error); }
.badge-awaiting { background: #eee; color: #555; }

.summary-block { border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px; margin: 18px 0 14px; background: #fafcff; }
.summary-block .row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: .92rem; }
.summary-block .row span:first-child { color: var(--muted); flex-shrink: 0; }
.summary-block .row strong { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-card .num { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.stat-card .label { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* Admin layout */
.admin-wrap { display: flex; align-items: flex-start; min-height: 100vh; }
.admin-sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--navy-dark); color: #fff; padding: 20px 0;
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh; overflow-y: auto;
}
.admin-sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 20px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px;
}
.admin-sidebar .brand img { width: 34px; height: 34px; object-fit: contain; }
.admin-sidebar .brand span { line-height: 1.25; }
.admin-sidebar a {
  display: block; padding: 11px 20px; color: #cfd9ee; text-decoration: none; font-size: .92rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 30px 34px; }
.admin-topbar {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 14px;
  margin: -30px -34px 26px; padding: 10px 34px; min-height: 62px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.profile-menu { margin-left: auto; position: relative; }
.profile-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--light-blue);
  background: var(--navy); color: #fff; font: inherit; font-weight: 700; font-size: .85rem; letter-spacing: .5px;
  cursor: pointer; transition: box-shadow .15s ease;
}
.profile-btn:hover, .profile-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(31, 56, 100, .18); }
.profile-dropdown {
  position: absolute; right: 0; top: 50px; min-width: 240px; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(20, 38, 74, .18); animation: panel-in .14s ease;
}
.profile-dropdown[hidden] { display: none; }
.pd-head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.pd-head strong { color: var(--navy); font-size: .95rem; }
.pd-head span { color: var(--muted); font-size: .8rem; }
.profile-dropdown a, .pd-logout button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: none; background: none;
  border-radius: 8px; color: var(--text); font: inherit; font-size: .9rem; text-align: left; text-decoration: none; cursor: pointer;
}
.profile-dropdown a:hover, .pd-logout button:hover { background: var(--light-blue); }
.pd-logout { margin: 0; }
.pd-logout button { color: var(--error); }

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.sidebar-toggle span { display: block; width: 18px; height: 2px; background: var(--navy); border-radius: 2px; }

.sidebar-backdrop {
  display: block;
  position: fixed; inset: 0;
  background: rgba(20, 38, 74, .45);
  z-index: 999;
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility .45s ease;
}
.sidebar-backdrop.open { opacity: 1; visibility: visible; }

.sidebar-close {
  display: none; position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border: none; border-radius: 8px; padding: 0;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
  transition: background-color .2s ease;
}
.sidebar-close:hover { background: rgba(255, 255, 255, .22); }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 640px; }

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .sidebar-close { display: flex; align-items: center; justify-content: center; }
  .admin-sidebar .brand { padding-right: 60px; }
  .admin-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 260px;
    transform: translateX(-100%);
    transition: transform .45s cubic-bezier(.22, .61, .36, 1);
    z-index: 1000;
    overflow-y: auto;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { padding: 20px 16px 40px; width: 100%; }
  .admin-topbar { margin: -20px -16px 20px; padding: 10px 16px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}

@media (max-width: 520px) {
  .admin-main { padding: 16px 12px 32px; }
  .admin-topbar { margin: -16px -12px 18px; padding: 10px 12px; }
  .admin-sidebar { width: 84vw; }
}

.login-wrap { max-width: 380px; margin: 80px auto; width: 100%; padding: 0 20px; }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.login-brand img { width: 54px; height: 54px; object-fit: contain; }
.login-brand-text { display: flex; flex-direction: column; text-align: left; }
.login-brand-text strong { color: var(--navy); font-size: 1.05rem; }
.login-brand-text span { color: var(--muted); font-size: .85rem; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters input[type="text"] { flex: 3 1 260px; }
.filters select { flex: 1 1 150px; }
.filters input, .filters select { min-width: 0; }
@media (max-width: 640px) {
  .filters input[type="text"], .filters select { flex-basis: 100%; }
}

.pill-nav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-nav a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--navy); text-decoration: none; font-size: .85rem; }
.pill-nav a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.helptext { color: var(--muted); font-size: .85rem; margin-top: 4px; }

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}
.toast {
  background: #fff;
  border-left: 4px solid var(--error);
  box-shadow: 0 6px 18px rgba(20, 38, 74, .18);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .88rem;
  color: var(--text);
  animation: toast-in .22s ease;
}
.toast.hide { animation: toast-out .18s ease forwards; }
.toast.toast-success { border-left-color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

.pill-nav button {
  padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border);
  color: var(--navy); font-size: .85rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background-color .15s ease, color .15s ease;
}
.pill-nav button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pill-nav button:hover:not(.active) { background: var(--light-blue); }

.table-center th, .table-center td { text-align: center; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 38, 74, .45);
  display: flex; align-items: flex-start; justify-content: center; z-index: 1000;
  padding: 40px 20px; overflow-y: auto;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-box {
  background: #fff; border-radius: 14px; padding: 28px 32px; width: 100%; max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28); margin: auto;
  transform: translateY(-14px) scale(.98); transition: transform .18s ease;
}
.modal-backdrop.open .modal-box { transform: translateY(0) scale(1); }
.modal-box.wide { max-width: 900px; }
.modal-box { position: relative; }
.modal-x {
  position: absolute; top: 14px; right: 16px; width: 34px; height: 34px;
  border: none; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0;
  transition: background-color .15s ease, color .15s ease;
}
.modal-x:hover { background: var(--light-blue); color: var(--navy); }
.modal-box h3 { margin: 0 0 18px; color: var(--navy); }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal-actions.split { justify-content: space-between; }
.modal-actions .btn, .modal-cancel { padding: 8px 16px; font-size: .85rem; }

.detail-columns { display: flex; gap: 28px; flex-wrap: wrap; }
.detail-columns .detail-section { flex: 1 1 320px; }

.detail-section { margin-bottom: 18px; }
.detail-section h4 { margin: 0 0 10px; color: var(--navy); font-size: .95rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: .85rem; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-grid .lbl { color: var(--muted); }
.detail-grid .val { font-weight: 600; color: var(--text); }

.activity-list { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.activity-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.activity-list li:last-child { border-bottom: none; }
.activity-empty { color: var(--muted); font-size: .82rem; }

.sibling-note { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: .82rem; margin-top: 10px; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tr { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; padding: 4px 14px; background: #fff; }
  .responsive-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; padding: 9px 0; border-bottom: 1px dashed var(--border); }
  .responsive-table td:last-child { border-bottom: none; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
  .kv-table, .kv-table tbody, .kv-table tr, .kv-table th, .kv-table td { display: block; width: 100%; }
  .kv-table tr { margin-bottom: 8px; }
  .kv-table th { border-bottom: none; padding: 8px 12px 4px; background: transparent; color: var(--muted); font-size: .8rem; }
  .kv-table td { padding: 0 12px 8px; overflow-wrap: anywhere; }
}

.btn.btn-success:hover { background: #17612e; }
.btn.btn-danger:hover { background: #8f1d17; }
.btn.btn-outline-danger { background: #fff; color: var(--error); border: 1px solid #e3b5b1; }
.btn.btn-outline-danger:hover { background: var(--error-bg); }

.modal-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-footer .btn, .modal-footer input[type=text] {
  height: 34px; padding: 0 14px; font-size: .82rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-footer input[type=text] { display: block; width: 100%; }
.footer-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-right { display: flex; gap: 8px; flex-wrap: wrap; }

.confirm-panel {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; padding: 14px 16px;
  background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; font-size: .85rem;
  animation: panel-in .18s ease;
}
.confirm-panel[hidden] { display: none; }
.confirm-panel.danger { background: var(--error-bg); border-color: #f3c2bd; color: #6b1a15; }
.confirm-panel label { font-size: .82rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-panel .sibling-note { margin: 0; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.pay-photo { margin-top: 14px; }
.pay-photo-label { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.pay-thumb {
  display: block; max-width: 100%; max-height: 190px; border-radius: 8px;
  border: 1px solid var(--border); cursor: zoom-in; object-fit: contain; background: #f7f9fc;
}
.pay-photo-hint { color: var(--muted); font-size: .75rem; margin-top: 4px; }

.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(10, 18, 36, .85);
  display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.check-inline { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); font-size: .85rem; cursor: pointer; }
.check-inline input { width: auto; margin: 0; }
textarea[readonly] { background: #f4f6fa; color: var(--muted); }

.badge-expired { background: #eceff3; color: #6b7280; }
.badge-awaiting_upload { background: #eee; color: #555; }

.admin-login-link {
  margin-left: auto; color: #fff; text-decoration: none; font-size: .88rem; font-weight: 600;
  padding: 8px 16px; border: 1px solid rgba(255,255,255,.55); border-radius: 8px;
  transition: background-color .15s ease;
}
.admin-login-link:hover { background: rgba(255,255,255,.14); }

.lightbox-x {
  position: absolute; top: 18px; right: 22px; width: 42px; height: 42px; border: none; border-radius: 50%;
  background: #fff; color: var(--navy); font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: background-color .15s ease;
}
.lightbox-x:hover { background: var(--light-blue); }

.form-group { min-width: 0; }
.form-group select, .form-group input[type=text], .form-group input[type=email], .form-group input[type=tel],
.form-group input[type=date], .form-group input[type=password], .form-group textarea { width: 100%; min-width: 0; max-width: 100%; }
.form-group select { text-overflow: ellipsis; }

.admin-sidebar a { display: flex; align-items: center; gap: 12px; }
.admin-sidebar a i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; opacity: .9; }

.access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfe; }
.access-grid .check-inline { color: var(--text); font-weight: 500; font-size: .88rem; }

.access-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .88rem; }
.access-row.on { color: var(--success); font-weight: 600; }
.access-row.off { color: var(--muted); }

.audit-table { table-layout: auto; }
.audit-table td.audit-details { max-width: 520px; overflow-wrap: anywhere; line-height: 1.45; }
.audit-table td:first-child { white-space: nowrap; }
@media (max-width: 640px) {
  .table-wrap .audit-table { min-width: 0; }
  .audit-table td:first-child { white-space: normal; }
  .audit-table td.audit-details { max-width: none; }
}

.pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; font-size: .85rem; color: var(--muted); }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-links a, .pager-links .current { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--navy); background: #fff; }
.pager-links a:hover { background: var(--light-blue); }
.pager-links .current { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }

.logout-form { margin: 20px 0 0; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; }
.logout-form button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 20px; border: none; background: none;
  color: #cfd9ee; font: inherit; font-size: .92rem; text-align: left; cursor: pointer;
}
.logout-form button:hover { background: rgba(255,255,255,.08); color: #fff; }
.logout-form button i { font-size: 1.05rem; width: 20px; text-align: center; }

.input-icon { position: relative; }
.input-icon > i.bi { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; pointer-events: none; }
.input-icon input { width: 100%; padding-right: 46px; }
.input-icon:focus-within > i.bi { color: var(--accent); }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center; border: none; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.pw-toggle:hover { background: var(--light-blue); color: var(--navy); }

.photo-upload { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.photo-preview {
  width: 92px; height: 118px; border: 1px dashed var(--border); border-radius: 8px; background: #fafbfe;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .75rem; text-align: center; overflow: hidden; flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.applicant-photo { float: right; width: 72px; height: 92px; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; margin: 0 0 8px 12px; }

/* Home page: both action buttons share one size (equal width on desktop, full width and one line on phones). */
.actions-equal .btn { min-width: 330px; text-align: center; white-space: nowrap; }
.actions-equal .btn:not(.btn-secondary) { border: 1px solid transparent; }
@media (max-width: 600px) {
  .actions-equal { flex-direction: column; }
  .actions-equal .btn { min-width: 0; width: 100%; padding: 12px 8px; font-size: clamp(.7rem, 3.4vw, .95rem); }
  .site-header { padding: 10px 0; }
  .header-inner { padding: 0 14px; }
  .brand { gap: 10px; }
  .brand-logo { width: 42px; height: 42px; padding: 4px; }
  .brand-name { font-size: clamp(.85rem, 5vw, 1.35rem); white-space: nowrap; }
  .brand-sub { font-size: .8rem; }
}

/* Payment page bottom row: Upload and Download PDF share one line (equal width); Search Another Application spans the full row below. */
@media (max-width: 600px) {
  .actions-triple .btn { text-align: center; white-space: nowrap; padding: 12px 8px; font-size: clamp(.76rem, 3.6vw, .9rem); flex: 1 1 calc(50% - 6px); min-width: 0; }
  .actions-triple .btn.btn-full { flex: 1 1 100%; }
}

/* Submissions list: View and Edit are the same width; on phones they stack with a gap between them. */
.row-actions { display: flex; gap: 8px; }
.row-actions .btn { flex: 1 1 0; min-width: 64px; text-align: center; }
@media (max-width: 640px) {
  .row-actions { flex-direction: column; }
}

/* Submission view modal on phones: the photo sits above the details instead of floating over them, and the buttons form an even grid
   (Download PDF and Mark Form Received full width; Reject and Verify side by side). */
@media (max-width: 640px) {
  .detail-section .applicant-photo { float: none; display: block; width: 96px; height: 122px; margin: 4px 0 14px; }
  .modal-footer .footer-bar, .modal-footer .footer-right { width: 100%; }
  .modal-footer .footer-right { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .modal-footer .footer-right > .btn { width: 100%; height: 42px; font-size: .88rem; }
  .modal-footer .footer-right > a.btn, .modal-footer .footer-right > #receivedBtn { grid-column: 1 / -1; }
}
