:root {
  --navy: #0d1b3e;
  --navy-2: #1a3a6b;
  --gold: #c5a55a;
  --gold-light: #d4b96a;
  --background: #f6f7f9;
  --card: #fff;
  --text: #121826;
  --muted: #6b7280;
  --line: #e2e5ea;
  --soft: #eef0f3;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --shadow: 0 4px 12px rgb(13 27 62 / .07);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; stroke-width: 1.8; }
.hidden, .visually-hidden { display: none !important; }
.mobile-only { display: none; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: 256px;
  display: flex; flex-direction: column; color: #fff; background: var(--navy);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid rgb(255 255 255 / .1); }
.sidebar-brand strong { display: block; font: 700 13px "Plus Jakarta Sans", sans-serif; }
.sidebar-brand small { display: block; margin-top: 3px; color: rgb(147 197 253 / .6); font-size: 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  object-fit: contain; color: var(--navy); background: #fff; font-weight: 800;
}
.sidebar nav { flex: 1; padding: 12px; overflow: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding: 11px 12px;
  border-radius: 9px; color: rgb(219 234 254 / .72); font-size: 14px; font-weight: 600; transition: .2s;
}
.sidebar nav a:hover { color: #fff; background: rgb(255 255 255 / .06); }
.sidebar nav a.active { color: var(--gold); background: rgb(197 165 90 / .17); }
.sidebar nav svg { width: 17px; height: 17px; }
.sidebar .nav-arrow { width: 14px; height: 14px; margin-left: auto; }
.sidebar .nav-parent {
  width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding: 11px 12px;
  border: 0; border-radius: 9px; color: rgb(219 234 254 / .72); background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; transition: .2s;
}
.sidebar .nav-parent:hover { color: #fff; background: rgb(255 255 255 / .06); }
.sidebar .nav-caret { width: 14px; height: 14px; margin-left: auto; transition: transform .2s; }
.nav-group.expanded .nav-caret { transform: rotate(180deg); }
.nav-children { display: none; margin: 0 0 4px 16px; padding-left: 10px; border-left: 1px solid rgb(255 255 255 / .12); }
.nav-group.expanded .nav-children { display: block; }
.nav-children a { padding: 9px 12px; font-size: 13px; }
.sidebar-user { padding: 16px; border-top: 1px solid rgb(255 255 255 / .1); }
.sidebar-profile {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  color: #fff; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer;
}
.sidebar-profile:hover { background: rgb(255 255 255 / .07); }
.sidebar-profile > svg { width: 15px; height: 15px; flex: none; color: rgb(147 197 253 / .55); }
.sidebar-avatar {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; overflow: hidden;
  color: var(--navy); border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); font-weight: 800;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy small { display: block; padding: 0; }
.sidebar-user-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { margin-top: 4px; color: rgb(147 197 253 / .6); font-size: 11px; }
.sidebar-user > #logout-button {
  width: 100%; display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 9px 11px;
  color: #fca5a5; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
}
.sidebar-user > #logout-button:hover { background: rgb(239 68 68 / .1); }
.sidebar-user > #logout-button svg { width: 17px; }

.shell { min-height: 100vh; padding-left: 256px; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 56px; display: none; align-items: center;
  justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / .86); backdrop-filter: blur(12px);
}
.topbar small { color: var(--muted); }
.content { width: 100%; max-width: 1248px; margin: auto; padding: 24px; }

.welcome-card {
  margin-bottom: 22px; padding: 25px; color: #fff; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--navy), var(--navy-2));
}
.welcome-card h1 { margin: 0; font: 700 24px "Plus Jakarta Sans", sans-serif; }
.welcome-card p { margin: 6px 0 0; color: rgb(191 219 254 / .75); font-size: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card, .panel, .table-card, .member-card, .calendar-panel {
  border: 1px solid rgb(226 229 234 / .7); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.stat-card { display: flex; align-items: center; justify-content: space-between; padding: 20px; }
.stat-card-link { transition: border-color .2s, box-shadow .2s, transform .2s; }
.stat-card-link:hover, .stat-card-link:focus-visible {
  border-color: rgb(197 165 90 / .55); outline: 0; box-shadow: 0 8px 20px rgb(13 27 62 / .12); transform: translateY(-2px);
}
.stat-card span { display: block; color: var(--muted); font-size: 14px; }
.stat-card strong { display: block; margin-top: 4px; font: 700 30px "Plus Jakarta Sans", sans-serif; }
.stat-card svg { width: 32px; height: 32px; color: var(--navy-2); opacity: .58; }
.stat-card:nth-child(2) svg { color: var(--green); }
.stat-card:nth-child(3) svg { color: var(--amber); }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.panel { padding: 20px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.panel-title h2 { display: flex; align-items: center; gap: 9px; margin: 0; font: 700 17px "Plus Jakarta Sans", sans-serif; }
.panel-title h2 svg { color: var(--gold); }
.panel-title a { color: var(--navy-2); font-size: 13px; font-weight: 600; }
.stack-list { display: grid; gap: 8px; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: 9px; background: rgb(238 240 243 / .6);
}
.list-row.clickable { width: 100%; color: inherit; border: 0; text-align: left; cursor: pointer; }
.list-row.clickable:hover { background: var(--soft); }
.date-tile {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; align-content: center;
  color: #fff; border-radius: 9px; background: var(--navy); line-height: 1;
}
.date-tile strong { font-size: 14px; }
.date-tile small { margin-top: 3px; font-size: 9px; opacity: .68; text-transform: uppercase; }
.list-copy { min-width: 0; flex: 1; }
.list-copy strong, .list-copy small { display: block; }
.list-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.list-copy small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.badge-navy { color: var(--gold); background: var(--navy); }
.badge-green { color: #047857; background: #d1fae5; }
.badge-red { color: #b91c1c; background: #fee2e2; }
.badge-amber { color: #b45309; background: #fef3c7; }
.empty-message { padding: 24px; color: var(--muted); text-align: center; font-size: 14px; }
.loading-list:empty::after { content: "Carregando..."; display: block; padding: 24px; color: var(--muted); text-align: center; }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 24px "Plus Jakarta Sans", sans-serif; }
.page-heading h1 svg { color: var(--gold); }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.document-heading-actions { display: flex; align-items: center; gap: 9px; }
.document-breadcrumbs { display: flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.document-breadcrumbs span { display: inline-flex; align-items: center; gap: 4px; }
.document-breadcrumbs svg { width: 13px; height: 13px; }
.document-breadcrumbs button { padding: 0; color: inherit; border: 0; background: transparent; cursor: pointer; }
.document-breadcrumbs button:hover { color: var(--gold); }
.document-breadcrumbs button[aria-current="page"] { cursor: default; }
.folder-description {
  display: flex; align-items: center; gap: 11px; margin-bottom: 16px; padding: 15px 17px;
  color: #fff; border-radius: var(--radius); background: linear-gradient(100deg, var(--navy), var(--navy-2));
  font-size: 14px;
}
.folder-description svg { width: 20px; height: 20px; color: var(--gold-light); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 9px 15px; border: 0; border-radius: 9px; font-weight: 700; font-size: 14px; cursor: pointer; transition: .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { color: #fff; background: var(--navy); }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { color: var(--navy); background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.btn-danger { color: #fff; background: var(--red); }
.btn-success { color: #fff; background: var(--green); }
.btn-muted { color: var(--text); background: var(--soft); }
.btn-block { width: 100%; }
.icon-button {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  color: inherit; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
}
.icon-button:hover { background: rgb(255 255 255 / .1); }

.search-box { position: relative; margin-bottom: 18px; }
.search-box svg { position: absolute; top: 50%; left: 13px; width: 17px; color: var(--muted); transform: translateY(-50%); }
.search-box input {
  width: 100%; min-height: 44px; padding: 10px 14px 10px 42px; border: 1px solid transparent;
  border-radius: var(--radius); outline: 0; background: var(--card); box-shadow: 0 1px 3px rgb(0 0 0 / .04);
}
.search-box input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgb(26 58 107 / .1); }

.calendar-panel { overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 15px; color: #fff; background: var(--navy); }
.calendar-toolbar > div { text-align: center; }
.calendar-toolbar small { display: block; margin-bottom: 2px; color: rgb(219 234 254 / .62); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.calendar-toolbar h2 { margin: 0; font: 700 19px "Plus Jakarta Sans", sans-serif; }
.session-agenda { display: grid; gap: 18px; padding: 18px; background: #f3f4f6; }
.session-month { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 2px 8px rgb(13 27 62 / .04); }
.session-month > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--line); background: #fafafa; }
.session-month > header span { font: 700 15px "Plus Jakarta Sans", sans-serif; }
.session-month > header small { color: var(--muted); font-size: 11px; }
.session-month-list { display: grid; }
.session-row { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 15px; border: 0; border-bottom: 1px solid var(--line); color: inherit; background: #fff; text-align: left; }
.session-row:last-child { border-bottom: 0; }
button.session-row { cursor: pointer; transition: .18s; }
button.session-row:hover { background: #f8fafc; box-shadow: inset 3px 0 var(--gold); }
.session-row.locked { color: #9ca3af; background: #f8f9fa; cursor: not-allowed; }
.session-row > svg { width: 17px; height: 17px; flex: none; margin-left: auto; color: var(--muted); }
.session-row.locked > svg { color: #9ca3af; }
.session-indicators { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); }
.session-indicators svg { width: 17px; height: 17px; flex: none; }
.session-date { width: 45px; height: 48px; flex: none; display: grid; place-items: center; align-content: center; border-radius: 9px; color: #fff; background: var(--navy); line-height: 1; }
.session-date small { margin-bottom: 3px; color: var(--gold-light); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.session-date strong { font-size: 19px; }
.locked .session-date { color: #6b7280; background: #e5e7eb; }
.locked .session-date small { color: #9ca3af; }
.session-row-copy { min-width: 0; flex: 1; }
.session-row-copy strong, .session-row-copy small { display: block; }
.session-row-copy strong { font-size: 14px; }
.session-row-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.session-row-copy .session-password-pending { color: var(--red); font-weight: 700; }
.session-detail-head { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.session-summary-field { margin-top: 16px; }
.session-summary-field p { margin: 4px 0 0; padding: 12px; border-radius: 8px; background: var(--soft); line-height: 1.55; }
.password-generator { display: flex; align-items: stretch; gap: 8px; }
.password-generator input { min-width: 0; flex: 1; }
.guest-access-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 13px; margin-top: 16px; padding: 14px; border: 1px solid rgb(197 165 90 / .35); border-radius: 10px; background: #fffbeb; }
.guest-access-panel > div:first-child strong, .guest-access-panel > div:first-child small { display: block; }
.guest-access-panel > div:first-child small { margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.guest-access-panel > .form-group { grid-column: 1 / -1; margin: 0; }
.guest-access-code { display: inline-block; margin-top: 4px; padding: 7px 12px; border: 1px solid rgb(197 165 90 / .55); border-radius: 8px; background: #fff; color: var(--navy); font: 800 22px/1 monospace; letter-spacing: .2em; }
.guest-registration-page #guest-session-password { text-transform: uppercase; letter-spacing: .18em; font-family: monospace; font-weight: 800; }
.external-guest-form { display: flex; align-items: end; gap: 9px; margin: 12px 0; padding: 12px; border-radius: 9px; background: var(--soft); }
.external-guest-form .form-group { min-width: 0; flex: 1; margin: 0; }
.external-guest-list { display: grid; gap: 8px; margin-top: 11px; }
.external-guest-row { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 9px; background: #fffbeb; }
.external-guest-row.approved { background: #f0fdf4; }
.external-guest-row.requested { border: 1px solid rgb(197 165 90 / .35); }
.external-guest-row > svg { flex: none; color: var(--amber); }
.external-guest-row.approved > svg { color: var(--green); }
.external-guest-row .list-copy strong { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.external-guest-row .list-copy a { color: var(--navy); }
.external-guest-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.external-guest-actions .btn-small { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.session-detail-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.session-detail-section > h3, .session-detail-section .panel-title h3 { margin: 0; font-size: 15px; }
.session-documents { display: grid; gap: 8px; margin-top: 11px; }
.session-documents .document-row { color: inherit; }
.session-documents .document-row:hover { background: #e5e7eb; }
.session-upload-disclosure { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.session-upload-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; color: var(--navy); cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; }
.session-upload-disclosure > summary::-webkit-details-marker { display: none; }
.session-upload-disclosure > summary span { display: flex; align-items: center; gap: 8px; }
.session-upload-disclosure > summary svg { width: 17px; height: 17px; transition: transform .18s; }
.session-upload-disclosure[open] > summary { border-bottom: 1px solid var(--line); background: #fff; }
.session-upload-disclosure[open] > summary > svg { transform: rotate(180deg); }
.session-upload-section { padding: 14px; }
.session-file-rows { display: grid; gap: 10px; margin-top: 10px; }
.session-file-row { position: relative; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.session-file-row legend { padding: 0 5px; color: var(--navy); font-size: 11px; font-weight: 800; }
.session-file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.session-file-grid textarea { min-height: 62px; resize: vertical; }
.session-file-grid input[type="file"] { min-height: 62px; padding: 8px; }
.session-file-remove { position: absolute; top: -10px; right: 8px; width: 28px; height: 28px; color: var(--red); background: #fff; box-shadow: 0 2px 8px rgb(13 27 62 / .12); }
.session-file-remove svg { width: 14px; height: 14px; }
.session-file-add { margin-top: 10px; }
.muted-label, .form-help-inline { color: var(--muted); font-weight: 500; }
.form-help-inline { overflow-wrap: anywhere; line-height: 1.4; }

.member-list { display: grid; gap: 10px; }
.member-card { overflow: hidden; }
.member-summary { display: flex; align-items: center; gap: 10px; width: 100%; padding: 15px; }
.member-profile-trigger { min-width: 0; flex: 1; display: flex; align-items: center; gap: 14px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--navy); font-weight: 800; }
.member-main { min-width: 0; flex: 1; }
.member-main strong { display: block; }
.member-main small { display: block; margin-top: 4px; color: var(--muted); }
.birthday-soon { color: var(--red); font-weight: 700; }
.member-actions { display: flex; gap: 5px; }
.whatsapp-link {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px;
  color: #047857; border: 1px solid #a7f3d0; border-radius: 8px; background: #ecfdf5;
  font-size: 12px; font-weight: 700;
}
.whatsapp-link:hover { color: #065f46; border-color: #6ee7b7; background: #d1fae5; }
.whatsapp-link svg { width: 15px; height: 15px; }
.member-detail { padding: 16px; border-top: 1px solid var(--line); background: #fcfcfd; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; font-size: 13px; }
.detail-item span { display: block; color: var(--muted); font-size: 11px; }
.detail-item strong { display: block; margin-top: 2px; word-break: break-word; }
.masonic-history-section { margin-top: 20px; padding: 2px 0 0; }
.masonic-history-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--gold);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.masonic-history-title svg { width: 15px; height: 15px; }
.masonic-history-timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0 0 0 28px; list-style: none; }
.masonic-history-timeline::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 5px; width: 2px; background: #e2d4ac; }
.masonic-history-timeline li { position: relative; min-height: 58px; padding-bottom: 12px; }
.masonic-history-timeline li:last-child { padding-bottom: 0; }
.masonic-history-timeline li::before {
  content: ""; position: absolute; z-index: 1; top: 7px; left: -27px; width: 10px; height: 10px;
  border: 2px solid var(--card); border-radius: 50%; background: var(--gold);
}
.masonic-history-card { padding: 11px 13px; border-radius: 10px; background: #f2f3f5; }
.masonic-history-card p { display: flex; align-items: flex-start; gap: 7px; margin: 0; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.45; }
.masonic-history-card p span { white-space: pre-wrap; }
.masonic-history-card time { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.masonic-history-increase-icon { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--gold); }
.masonic-history-empty { margin: 0; padding: 14px; color: var(--muted); border-radius: 9px; background: var(--soft); font-size: 13px; }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy), var(--navy-2)); }

.table-card { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--soft); font-size: 12px; }
td.muted { color: var(--muted); }
.presence-dot { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-weight: 800; }
.presence-dot.yes { color: #047857; background: #d1fae5; }
.presence-dot.no { color: #b91c1c; background: #fee2e2; }
.segmented { display: flex; padding: 3px; border-radius: 9px; background: var(--soft); }
.segmented button { padding: 8px 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.segmented button.active { color: #fff; background: var(--navy); }
.frequency-list { display: grid; gap: 10px; }
.frequency-card { padding: 15px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.frequency-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }

.financial-table th, .financial-table td { vertical-align: middle; }
.financial-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.financial-table-title { display: flex; align-items: center; min-height: 61px; padding: 0 15px; border-bottom: 1px solid var(--line); background: #fff; }
.financial-table-title h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--navy); font: 700 16px "Plus Jakarta Sans", sans-serif; }
.financial-table-title h2 svg { width: 19px; color: var(--gold); }
.my-charges-group + .my-charges-group { border-top: 1px solid var(--line); }
.my-charges-group h3 { margin: 0; padding: 12px 15px; color: var(--navy); background: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.my-charges-group .empty-message { margin: 0; padding: 20px 15px; }
.my-charges table { font-size: 13px; }
.my-charges td { vertical-align: middle; }
.my-charges td:first-child { min-width: 180px; }
.my-charge-description, .my-charges small { display: block; }
.my-charge-description { font-weight: 400; }
.my-charges small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.my-account-balance { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: baseline; padding: 14px 15px; border-bottom: 1px solid var(--line); background: #fff; }
.my-account-balance span { color: var(--navy); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.my-account-balance strong { font-variant-numeric: tabular-nums; }
.my-account-balance small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.general-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.general-report-card { display: flex; flex-direction: column; overflow: hidden; }
.general-report-card .financial-table-title { flex: none; justify-content: space-between; gap: 12px; }
.general-report-badge { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.general-report-scroll { flex: 1; max-height: 429px; overflow: auto; }
.general-report-scroll th { position: sticky; top: 0; z-index: 1; }
.general-report-scroll table { font-size: 13px; }
.general-report-scroll td { vertical-align: middle; }
.general-report-scroll td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.report-brother-link { color: var(--navy-2); text-decoration: underline; text-underline-offset: 2px; }
.report-brother-link:hover { color: var(--gold); }
.general-frequency-list { padding: 14px 15px; }
.general-frequency-list .frequency-card { border: 1px solid var(--line); box-shadow: none; }

.brother-report-picker { margin-bottom: 22px; }
.brother-report-form { display: flex; align-items: flex-end; gap: 12px; }
.brother-report-form .form-group { flex: 1; min-width: 0; }
.brother-report-picker .operation-status { margin-top: 14px; }
.brother-report-balance { border: 1px solid rgb(226 229 234 / .7); border-radius: var(--radius); box-shadow: var(--shadow); }
.brother-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.brother-report-card { display: flex; flex-direction: column; overflow: hidden; }
.brother-report-card .financial-table-title { flex: none; }
/* Roughly 15 rows tall, so older records stay reachable by scrolling inside the card. */
.brother-report-scroll { flex: 1; max-height: 660px; overflow: auto; }
.brother-report-card-compact .brother-report-scroll { max-height: 429px; }
.brother-report-scroll th { position: sticky; top: 0; z-index: 1; }
.brother-report-scroll table { font-size: 13px; }
.brother-report-scroll td { vertical-align: middle; }
.brother-report-scroll td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.brother-report-profile { display: grid; gap: 14px; padding: 16px 15px; }
.brother-report-identity { display: flex; align-items: center; gap: 12px; }
.brother-report-avatar { width: 56px; height: 56px; font-size: 20px; }
.brother-report-identity strong { display: block; font: 700 15px "Plus Jakarta Sans", sans-serif; }
.brother-report-identity small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.brother-report-fields { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13px; }
.brother-report-fields dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.brother-report-fields dd { margin: 0; overflow-wrap: anywhere; }
.brother-report-profile h3 { margin: 0; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.brother-report-dependents { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.brother-report-dependents li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 8px; background: var(--soft); font-size: 13px; }
.brother-report-dependents small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.brother-report-profile .empty-message { padding: 14px; border-radius: 8px; background: var(--soft); }

.charges-table td { vertical-align: middle; }
.charge-detail-summary { display: grid; gap: 5px; margin-bottom: 16px; padding: 13px; border-radius: 9px; background: var(--soft); }
.charge-detail-summary span { color: var(--muted); font-size: 13px; }
.charge-member-list { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: min-content; align-content: start; gap: 7px; max-height: 280px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.charge-member-list > .charge-member-option { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; align-content: center; gap: 9px; min-width: 0; min-height: 43px; margin: 0; padding: 9px 11px; border-radius: 7px; background: #fff; cursor: pointer; font-weight: 600; }
.charge-member-list > .charge-member-option input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; }
.charge-member-list > .charge-member-option span { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.charge-member-option small { color: var(--muted); font-weight: 500; }
.currency-input { display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.currency-input:focus-within { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgb(30 64 175 / .12); }
.currency-input span { display: grid; place-items: center; padding: 0 12px; color: var(--navy); border-right: 1px solid var(--line); background: var(--soft); font-weight: 800; }
.currency-input input { min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
.currency-input input:focus { box-shadow: none; }
.financial-table tbody tr:hover { background: #fafbfc; }
.library-groups { display: grid; gap: 20px; }
.library-group { overflow-x: auto; }
.library-group-title { justify-content: space-between; }
.library-group-title > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.library-table { min-width: 760px; }
.library-table th, .library-table td { vertical-align: middle; }
.library-table tbody tr.library-main-row:hover, .library-table tbody tr.library-main-row:hover + .library-description-row { background: #fafbfc; }
.library-title-cell { min-width: 210px; }
.library-description-row td { padding-top: 0; border-top: 0; color: var(--muted); }
.library-description-row span { display: block; margin-bottom: 3px; color: var(--navy); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.library-description-row p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.library-sort-button {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; color: inherit;
  border: 0; background: transparent; cursor: pointer; font: inherit;
}
.library-sort-button svg { width: 14px; height: 14px; color: var(--muted); }
.library-sort-button.active { color: var(--navy); }
.library-sort-button.active svg { color: var(--gold); }
.library-links { display: flex; flex-wrap: wrap; gap: 7px; min-width: 180px; }
.library-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--navy-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.library-links a:hover { text-decoration: underline; }
.library-links svg { width: 14px; height: 14px; }
.library-actions-cell { width: 88px; text-align: center; }
.library-row-actions { display: inline-flex; gap: 4px; }
.library-delete-button { color: var(--red); }
.financial-description { min-width: 220px; }
.financial-value-column { min-width: 135px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.financial-actions-column { width: 94px; text-align: center; }
.financial-debit { color: var(--red); font-weight: 700; }
.financial-credit { color: var(--green); font-weight: 700; }
.financial-description-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 0; color: var(--navy-2);
  border: 0; background: transparent; text-align: left; font-weight: 700; cursor: pointer;
}
.financial-description-link:hover span { text-decoration: underline; }
.financial-description-link svg { width: 15px; height: 15px; flex: none; color: var(--gold); }
.financial-actions { display: flex; justify-content: center; gap: 3px; }
.financial-actions .icon-button { width: 34px; height: 34px; }
.financial-actions .icon-button:hover { background: var(--soft); }
.financial-actions .financial-delete { color: var(--red); }
.financial-balance-row td { padding-top: 16px; padding-bottom: 16px; border-top: 2px solid var(--navy); border-bottom: 0; background: #f8f9fb; }
.financial-balance-row td:first-child { color: var(--navy); text-align: right; }
.financial-opening-balance-row td { background: var(--soft); }
.financial-opening-balance-row td:nth-child(2) { color: var(--navy); font-weight: 700; }
.financial-file-preview { display: grid; place-items: center; min-height: 320px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.financial-file-preview-image { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; }
.financial-file-preview-pdf { width: 100%; height: 65vh; border: 0; background: #fff; }
.dashboard-charge-row { gap: 10px; }
.dashboard-charge-value { margin-left: auto; color: var(--red); white-space: nowrap; font-size: 13px; }
.dashboard-financial-total { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; color: var(--navy); border-top: 2px solid var(--navy); background: #f8f9fb; font-size: 13px; }
.dashboard-financial-total strong { font-size: 14px; font-variant-numeric: tabular-nums; }

.folder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.folder-card {
  display: flex; align-items: flex-start; gap: 13px; min-height: 142px; padding: 20px; color: var(--text);
  border: 2px solid transparent; border-radius: var(--radius); background: var(--card);
  box-shadow: 0 2px 5px rgb(0 0 0 / .03); text-align: left; cursor: pointer; transition: .2s;
}
.folder-card:hover { border-color: rgb(197 165 90 / .35); transform: translateY(-2px); box-shadow: var(--shadow); }
.folder-icon { width: 45px; height: 45px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--navy-2); background: #eff6ff; }
.folder-icon.gold { color: #d4b96a; background: #eef0f5; }
.folder-icon.green { color: #059669; background: #ecfdf5; }
.folder-icon.purple { color: #7c3aed; background: #f5f3ff; }
.folder-icon.orange { color: #d97706; background: #fffbeb; }
.folder-card-copy { min-width: 0; flex: 1; }
.folder-card strong, .folder-card small { display: block; }
.folder-card strong { font-size: 14px; }
.folder-card small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.folder-chevron { width: 17px; height: 17px; flex: none; margin-top: 8px; color: var(--muted); }
.document-list { display: grid; gap: 8px; }
.document-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 9px; background: var(--soft); }
.document-row > svg { color: var(--navy-2); }
.document-actions { display: flex; gap: 4px; margin-left: auto; }
.document-actions .icon-button:hover { background: #fff; }
.document-actions .ai-summary-button { color: #b58b22; background: #fffbeb; }
.document-actions .ai-summary-button.has-summary { color: var(--green); background: #ecfdf5; }
.ai-summary-loading { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; }
.ai-summary-loading small { color: var(--muted); }
.ai-summary-loading .spinner { width: 34px; height: 34px; border: 3px solid #e5e7eb; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
.ai-summary-view { display: grid; gap: 16px; }
.ai-summary-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-radius: 9px; background: #fffbeb; }
.ai-summary-meta span { display: inline-flex; align-items: center; gap: 7px; color: #8a6818; font-weight: 700; }
.ai-summary-meta svg { width: 17px; height: 17px; }
.ai-summary-meta small { color: var(--muted); }
.ai-summary-content { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; white-space: pre-wrap; line-height: 1.65; }

.gallery-page { min-height: 260px; }
.gallery-album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.gallery-album-card { overflow: hidden; padding: 0; color: var(--text); border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.gallery-album-card:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgb(15 23 42 / .12); }
.gallery-album-cover { position: relative; height: 210px; display: grid; place-items: center; overflow: hidden; color: #94a3b8; background: linear-gradient(145deg, #e8edf5, #f8fafc); }
.gallery-album-cover > svg { width: 48px; height: 48px; }
.gallery-album-cover > img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery-album-card:hover .gallery-album-cover > img { transform: scale(1.025); }
.gallery-album-cover > span { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; color: #fff; border-radius: 999px; background: rgb(13 27 62 / .82); backdrop-filter: blur(6px); font-size: 11px; font-weight: 700; }
.gallery-album-cover > span svg { width: 14px; height: 14px; }
.gallery-album-copy { display: grid; gap: 5px; padding: 15px; }
.gallery-album-copy small { color: #8a6818; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.gallery-album-copy strong { font: 700 16px "Plus Jakarta Sans", sans-serif; }
.gallery-album-copy > span { min-height: 36px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gallery-album-copy em { display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 4px; color: var(--navy-2); font-size: 11px; font-style: normal; font-weight: 700; }
.gallery-album-copy em svg { width: 13px; height: 13px; flex: none; }
.gallery-empty { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.gallery-empty > svg { width: 45px; height: 45px; color: var(--gold); }
.gallery-empty h2, .gallery-empty p { margin: 0; }
.gallery-album-page { display: grid; gap: 18px; }
.gallery-back { justify-self: start; }
.gallery-album-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.gallery-album-header h2 { margin: 8px 0 7px; font: 700 24px "Plus Jakarta Sans", sans-serif; }
.gallery-album-header p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.55; white-space: pre-wrap; }
.gallery-album-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.gallery-album-actions .btn { white-space: nowrap; }
.gallery-album-date, .gallery-session-link { display: inline-flex; align-items: center; gap: 6px; }
.gallery-album-date { color: #8a6818; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.gallery-album-date svg, .gallery-session-link svg { width: 15px; height: 15px; }
.gallery-session-link { margin-top: 13px; color: var(--navy-2); font-size: 12px; font-weight: 700; }
.photo-thumb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-thumb-grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.photo-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; padding: 0; border: 0; border-radius: 9px; background: #e5e7eb; cursor: zoom-in; }
.photo-thumb-wrap { position: relative; min-width: 0; }
.photo-thumb-wrap .photo-thumb { width: 100%; }
.photo-thumb-actions { position: absolute; top: 7px; right: 7px; display: flex; gap: 4px; opacity: 0; transform: translateY(-3px); transition: opacity .15s ease, transform .15s ease; }
.photo-thumb-wrap:hover .photo-thumb-actions, .photo-thumb-wrap:focus-within .photo-thumb-actions { opacity: 1; transform: translateY(0); }
.photo-thumb-actions .icon-button { width: 30px; height: 30px; color: var(--navy); border: 1px solid rgb(255 255 255 / .7); background: rgb(255 255 255 / .94); box-shadow: 0 3px 10px rgb(15 23 42 / .18); }
.photo-thumb-actions .icon-button:hover { background: #fff; }
.photo-thumb-actions .photo-delete-button { color: var(--red); }
.photo-thumb::after { content: ""; position: absolute; inset: 0; border: 2px solid transparent; border-radius: inherit; transition: border-color .15s ease, background .15s ease; }
.photo-thumb:hover::after, .photo-thumb:focus-visible::after { border-color: var(--gold); background: rgb(13 27 62 / .08); }
.photo-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .2s ease; }
.photo-thumb:hover img { transform: scale(1.035); }
.gallery-empty-album { grid-column: 1 / -1; padding: 70px 20px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; }
.album-session-link-field { margin-bottom: 16px; padding: 14px; border: 1px solid #dbeafe; border-radius: 10px; background: #eff6ff; }
.session-photo-section { padding: 15px; border: 1px solid #fde68a; border-radius: 11px; background: #fffbeb; }
.session-photo-albums { display: grid; gap: 13px; margin-top: 11px; }
.session-photo-album { padding: 11px; border: 1px solid rgb(197 165 90 / .35); border-radius: 9px; background: #fff; }
.session-photo-album-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.session-photo-album-head > div { display: grid; gap: 2px; }
.session-photo-album-head small { color: var(--muted); font-size: 11px; }
.session-photo-album-head a { color: var(--navy-2); font-size: 12px; font-weight: 700; }

body.lightbox-open { overflow: hidden; }
.photo-lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 22px; color: #fff; background: rgb(3 7 18 / .94); animation: fade .15s ease-out; }
.photo-lightbox-close { position: fixed; top: 18px; right: 18px; z-index: 2; width: 42px; height: 42px; display: grid; place-items: center; color: #fff; border: 1px solid rgb(255 255 255 / .25); border-radius: 50%; background: rgb(255 255 255 / .1); cursor: pointer; }
.photo-lightbox-close:hover { background: rgb(255 255 255 / .2); }
.photo-lightbox-stage { width: 100%; height: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 16px; }
.photo-lightbox-stage figure { min-width: 0; max-width: min(1200px, 100%); max-height: calc(100vh - 44px); display: grid; justify-self: center; gap: 10px; margin: 0; }
.photo-lightbox-stage img { max-width: 100%; max-height: calc(100vh - 105px); justify-self: center; object-fit: contain; border-radius: 5px; box-shadow: 0 20px 70px rgb(0 0 0 / .45); }
.photo-lightbox-stage figcaption { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #e5e7eb; font-size: 12px; }
.photo-lightbox-stage figcaption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-lightbox-stage figcaption span { flex: none; color: #94a3b8; }
.photo-lightbox-nav { width: 50px; height: 50px; display: grid; place-items: center; color: #fff; border: 1px solid rgb(255 255 255 / .22); border-radius: 50%; background: rgb(255 255 255 / .1); cursor: pointer; }
.photo-lightbox-nav:hover { background: rgb(255 255 255 / .2); }
.photo-lightbox-nav svg { width: 28px; height: 28px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px;
  background: rgb(0 0 0 / .52); animation: fade .15s ease-out;
}
.modal {
  width: min(680px, 100%); max-height: 88vh; overflow: auto; padding: 22px; border-radius: 14px;
  background: var(--card); box-shadow: 0 24px 70px rgb(0 0 0 / .25); animation: pop .18s ease-out;
}
.modal.small { width: min(520px, 100%); }
.modal.wide { width: min(960px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h2 { margin: 0; font: 700 18px "Plus Jakarta Sans", sans-serif; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.document-meta-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column: 1 / -1; gap: 13px; }
.document-view-toggle { display: flex; gap: 8px; margin: -8px 0 16px; }
.document-view-toggle .btn { min-width: 112px; }
.document-view-toggle .btn.active { color: #fff; border-color: var(--navy); background: var(--navy); }
.form-group { display: grid; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { color: var(--muted); font-size: 12px; font-weight: 700; }
.required-note { color: #ef4444; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #f8f9fa;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgb(26 58 107 / .08); }
.form-group textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.form-actions button:disabled { cursor: wait; opacity: .65; }
.session-delete-button { margin-right: auto; }
.form-help { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.profile-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-photo-row > div { display: grid; justify-items: start; gap: 6px; }
.profile-photo-row small, .profile-password-title small { color: var(--muted); font-size: 11px; }
.profile-photo {
  width: 76px; height: 76px; flex: none; display: grid; place-items: center; overflow: hidden;
  color: #fff; border-radius: 50%; background: var(--navy); font-size: 26px; font-weight: 800;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-password-title { display: grid; gap: 3px; margin: 20px 0 11px; padding-top: 16px; border-top: 1px solid var(--line); }
.section-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; margin: 7px 0 0; color: var(--gold); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.section-label::before, .section-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.masonic-history-editor { grid-column: 1 / -1; display: grid; gap: 10px; }
.masonic-history-editor > p { margin: 0; color: var(--muted); font-size: 12px; }
#masonic-history-rows { display: grid; gap: 10px; }
.masonic-history-editor-row {
  display: grid; grid-template-columns: 150px 180px minmax(0, 1fr) 38px; align-items: end; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9fa;
}
.dependent-editor-row { grid-template-columns: minmax(0, 1fr) 180px 38px; }
.masonic-history-editor-row textarea { min-height: 68px; }
.masonic-history-remove { margin-bottom: 3px; color: var(--red); background: #fff; }
.masonic-history-remove:hover { background: #fee2e2; }
.masonic-history-editor > .btn { justify-self: start; }
.check-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 8px; background: var(--soft); cursor: pointer; }
.check-row input { width: 17px; height: 17px; accent-color: var(--green); }
.attendance-transfer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 11px; }
.attendance-column { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.attendance-column > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: #fff; font-size: 12px; }
.attendance-column-present { border-color: #bbf7d0; background: #f0fdf4; }
.attendance-people { display: grid; align-content: start; gap: 5px; min-height: 120px; max-height: 280px; padding: 7px; overflow-y: auto; }
.attendance-person { display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; padding: 8px 9px; border: 1px solid transparent; border-radius: 7px; color: var(--text); background: #fff; text-align: left; cursor: pointer; font-size: 12px; }
.attendance-person:hover { border-color: var(--gold); background: #fffbeb; }
.attendance-person span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attendance-person svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.attendance-column-present .attendance-person svg { color: var(--green); }
.attendance-readonly { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 11px; }
.attendance-readonly > span { display: flex; align-items: center; gap: 7px; padding: 8px 9px; border-radius: 7px; background: #f0fdf4; font-size: 12px; }
.attendance-readonly svg { width: 14px; height: 14px; color: var(--green); }
.attendance-filters { display: flex; align-items: end; gap: 14px; margin-bottom: 18px; }
.attendance-year-field { width: min(220px, 100%); flex: none; }
.attendance-filters .search-box { flex: 1; margin-bottom: 0; }

.financial-documents-area { margin-top: 22px; }
.financial-documents-folder-grid { max-width: 560px; margin-bottom: 0; grid-template-columns: minmax(0, 1fr); }
.financial-documents-folder-grid .folder-card { min-height: 112px; padding: 16px 20px; }
.financial-documents-area .panel { margin-top: 0; }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 260px; padding: 12px 15px; color: #fff; border-radius: 9px; background: var(--navy); box-shadow: 0 10px 30px rgb(0 0 0 / .2); animation: slide .2s ease-out; }
.toast.error { background: var(--red); }
.operation-status {
  margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: 9px;
  font-size: 13px; font-weight: 600; line-height: 1.45;
}
.operation-status.success { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.operation-status.error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
#upload-form-status { margin: 14px 0 0; }
.alert { margin-bottom: 15px; padding: 11px; border-radius: 8px; font-size: 13px; text-align: center; }
.alert-error { color: #fecaca; border: 1px solid rgb(248 113 113 / .3); background: rgb(239 68 68 / .18); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 18px; color: #fff; background: linear-gradient(135deg, var(--navy), var(--navy-2), var(--navy)); }
.login-wrap { width: min(440px, 100%); }
.first-access-wrap { width: min(520px, 100%); }

.check-options { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 10px 0 2px; }
.check-option { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.check-option input { width: auto; accent-color: var(--gold); }
.login-brand { margin-bottom: 28px; text-align: center; }
.brand-mark-large { width: 80px; height: 80px; margin: 0 auto 15px; font-size: 29px; box-shadow: 0 12px 28px rgb(0 0 0 / .2); }
.login-brand h1 { margin: 0; font: 700 23px "Plus Jakarta Sans", sans-serif; }
.login-brand p { margin: 6px 0 0; color: rgb(191 219 254 / .7); font-size: 14px; }
.login-card { padding: 30px; border: 1px solid rgb(255 255 255 / .1); border-radius: var(--radius); background: rgb(255 255 255 / .09); backdrop-filter: blur(12px); box-shadow: 0 20px 50px rgb(0 0 0 / .24); }
.login-card label { display: block; margin: 0 0 7px; color: #dbeafe; font-size: 13px; font-weight: 600; }
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-group label { color: #dbeafe; }
.login-card .form-help { margin: 0 0 18px; color: rgb(219 234 254 / .7); line-height: 1.45; }
.guest-registration-page .login-card h2 { margin: 0 0 8px; color: #fff; font: 700 19px "Plus Jakarta Sans", sans-serif; }
.guest-form-copy { margin: 0 0 20px; color: rgb(219 234 254 / .7); font-size: 13px; line-height: 1.5; }
.guest-session-summary { display: grid; gap: 4px; margin-bottom: 20px; padding: 13px; border: 1px solid rgb(197 165 90 / .35); border-radius: 9px; background: rgb(13 27 62 / .38); }
.guest-session-summary strong { color: var(--gold-light); }
.guest-session-summary span { color: #dbeafe; font-size: 13px; }
.guest-registration-page .btn-block + .btn-block { margin-top: 9px; }
.guest-registration-success { text-align: center; }
.guest-registration-success > svg { width: 48px; height: 48px; margin-bottom: 12px; color: #6ee7b7; }
.guest-registration-success p { margin: 0; color: #dbeafe; line-height: 1.55; }
.field-icon { position: relative; margin-bottom: 18px; }
.field-icon svg { position: absolute; top: 50%; left: 12px; width: 17px; color: rgb(147 197 253 / .55); transform: translateY(-50%); }
.field-icon input { width: 100%; padding: 12px 13px 12px 40px; color: #fff; border: 1px solid rgb(255 255 255 / .12); border-radius: 8px; outline: 0; background: rgb(255 255 255 / .05); }
.field-icon input::placeholder { color: rgb(147 197 253 / .42); }
.field-icon input:focus { border-color: rgb(197 165 90 / .65); box-shadow: 0 0 0 3px rgb(197 165 90 / .12); }
.empty-state { display: grid; place-items: center; gap: 15px; min-height: 60vh; text-align: center; }
.empty-state > svg { width: 50px; height: 50px; color: var(--gold); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay { position: fixed; inset: 0; z-index: 40; display: none; background: rgb(0 0 0 / .5); }
  .mobile-overlay.open { display: block; }
  .shell { padding-left: 0; }
  .mobile-only { display: grid; }
  .topbar { display: flex; padding: 0 16px; }
  .content { padding: 18px; }
  .stats-grid { grid-template-columns: 1fr; }
  .two-columns { grid-template-columns: 1fr; }
  .financial-summary-grid { grid-template-columns: 1fr; }
  .brother-report-grid { grid-template-columns: 1fr; }
  .general-report-grid { grid-template-columns: 1fr; }
  .brother-report-form { flex-direction: column; align-items: stretch; }
  .folder-grid { grid-template-columns: 1fr 1fr; }
  .gallery-album-grid { grid-template-columns: 1fr 1fr; }
  .photo-thumb-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .content { padding: 14px; }
  .welcome-card { padding: 20px; }
  .welcome-card h1 { font-size: 20px; }
  .responsive-heading { align-items: stretch; flex-direction: column; }
  .responsive-heading .document-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .responsive-heading .document-heading-actions .btn { width: 100%; }
  .responsive-heading .document-heading-actions .btn:only-child { grid-column: 1 / -1; }
  .page-heading h1 { font-size: 21px; }
  .folder-grid { grid-template-columns: 1fr; }
  .gallery-album-grid { grid-template-columns: 1fr; }
  .gallery-album-cover { height: 230px; }
  .gallery-album-header { align-items: stretch; flex-direction: column; padding: 17px; }
  .gallery-album-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .gallery-album-actions .btn { width: 100%; }
  .gallery-album-actions .btn:last-child { grid-column: 1 / -1; }
  .photo-thumb-actions { opacity: 1; transform: none; }
  .photo-thumb-grid, .photo-thumb-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-lightbox { padding: 12px; }
  .photo-lightbox-stage { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 6px; }
  .photo-lightbox-nav { width: 40px; height: 40px; }
  .photo-lightbox-close { top: 10px; right: 10px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .document-meta-row { grid-template-columns: 1fr; grid-column: auto; }
  .form-group.full, .section-label { grid-column: auto; }
  .masonic-history-editor { grid-column: auto; }
  .masonic-history-editor-row { grid-template-columns: 1fr 1fr 38px; }
  .masonic-history-editor-row .form-group:first-child { grid-column: 1 / 2; }
  .masonic-history-editor-row .form-group:nth-child(3) { grid-column: 1 / 3; }
  .dependent-editor-row { grid-template-columns: minmax(0, 1fr) 130px 38px; }
  .dependent-editor-row .form-group:first-child { grid-column: auto; }
  .dependent-editor-row .masonic-history-remove { grid-column: auto; }
  .session-agenda { padding: 10px; }
  .session-row { padding: 11px; }
  .session-detail-head { grid-template-columns: 1fr; }
  .password-generator, .external-guest-form { align-items: stretch; flex-direction: column; }
  .external-guest-row { align-items: flex-start; flex-wrap: wrap; }
  .external-guest-actions { width: 100%; justify-content: flex-end; }
  .guest-access-panel { grid-template-columns: 1fr; }
  .guest-access-panel > .form-group { grid-column: auto; }
  .session-file-grid { grid-template-columns: 1fr; }
  .attendance-filters { align-items: stretch; flex-direction: column; }
  .attendance-year-field { width: 100%; }
  .member-summary { flex-wrap: wrap; }
  .member-profile-trigger { flex-basis: 100%; }
  .member-whatsapp { margin-left: 56px; }
  .member-actions { display: none; }
  .login-card { padding: 23px; }
}
