:root {
  color-scheme: light;
  --ink: #292e2f;
  --muted: #747a79;
  --green: #4b5859;
  --green-dark: #343c3d;
  --green-pale: #e9ebe8;
  --gold: #c9c3b4;
  --line: #dedfdb;
  --surface: #fbfbf8;
  --canvas: #eff0ed;
  --shadow: 0 7px 24px rgba(39, 44, 44, .06);
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
#blazor-error-ui { display: none; position: fixed; right: 12px; bottom: 12px; z-index: 30; max-width: min(440px, calc(100vw - 24px)); padding: 12px 16px; border: 1px solid #e7c7c0; border-radius: 7px; color: #873e34; background: #fbefec; box-shadow: var(--shadow); font-size: 12px; }
#blazor-error-ui .reload { margin-left: 8px; color: inherit; font-weight: 700; }
#blazor-error-ui .dismiss { margin-left: 8px; cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; flex-direction: column; width: 250px; padding: 27px 19px 21px; color: #f3f3ef; background: #303738; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 5px 35px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; color: #303738; background: #c9c3b4; border-radius: 12px; font-size: 24px; font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Manrope, sans-serif; font-size: 14px; letter-spacing: -.3px; }
.brand small { margin-top: 3px; color: #c1c6c3; font-size: 11px; }
.side-label { margin: 0 8px 12px; color: #aeb5b3; font-size: 9px; font-weight: 700; letter-spacing: 1.25px; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 11px; border: 0; border-radius: 7px; color: #d0d4d1; background: transparent; text-align: left; font-size: 12px; font-weight: 600; }
.nav-link > span:first-child { width: 17px; color: #bec5c2; font-size: 17px; text-align: center; }
.nav-link.active { color: white; background: #4a5354; box-shadow: inset 3px 0 #c9c3b4; }
.nav-link.active > span:first-child { color: #e0ddd3; }
.nav-count { margin-left: auto; padding: 3px 7px; border-radius: 10px; color: #ecece8; background: #626b6b; font-size: 12px; }
.sidebar-bottom { display: flex; align-items: flex-start; gap: 8px; margin-top: auto; padding: 15px 7px 0; border-top: 1px solid #535a5a; color: #c0c5c2; font-size: 12px; line-height: 1.5; }
.sidebar-photo { display: block; width: 100%; height: 96px; margin: auto 0 14px; border-radius: 8px; object-fit: cover; object-position: 50% 58%; }
.sidebar-photo + .sidebar-bottom { margin-top: 0; }
.status-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: #c9c3b4; }
.main-content { min-height: 100vh; margin-left: 250px; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 0 5.3%; border-bottom: 1px solid #e0e1dc; background: rgba(251,251,248,.9); }
.breadcrumbs { color: #898e8c; font-size: 11px; }
.breadcrumbs span { margin: 0 9px; color: #b8bbb6; }
.breadcrumbs strong { color: #414748; font-weight: 600; }
.view { max-width: 1240px; margin: 0 auto; padding: 41px 5.3% 18px; }
.view.hidden, .hidden { display: none !important; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #7a8180; font-size: 9px; font-weight: 700; letter-spacing: 1.05px; }
.eyebrow-line { width: 16px; height: 1px; background: var(--gold); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 8px 0 7px; font-family: Manrope, "Segoe UI", sans-serif; font-size: clamp(24px, 2.4vw, 31px); font-weight: 700; letter-spacing: -1.2px; }
h1 span { color: var(--green); }
.page-description { margin: 0; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; font-size: 11px; font-weight: 700; transition: background .15s, transform .15s, border-color .15s; }
.button:active { transform: translateY(1px); }
.button-primary { border-color: var(--green); color: white; background: var(--green); box-shadow: 0 3px 8px rgba(36, 92, 69, .12); }
.button-primary:hover { border-color: var(--green-dark); background: var(--green-dark); }
.button-outline { border-color: #d7dad6; color: #424a4b; background: var(--surface); }
.button-outline:hover { border-color: #aeb5b2; background: #f5f5f1; }
.button-small { min-height: 32px; padding: 0 11px; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 35px; }
.stat-card { position: relative; min-height: 103px; padding: 17px 18px; overflow: hidden; border: 1px solid #e0e1dc; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.stat-label { color: #777e7c; font-size: 9px; font-weight: 700; letter-spacing: .75px; }
.stat-value { margin-top: 6px; font-family: Manrope, sans-serif; font-size: 25px; font-weight: 700; line-height: 1; letter-spacing: -.7px; }
.stat-note { margin-top: 5px; color: #858b88; font-size: 12px; }
.stat-icon { position: absolute; top: 16px; right: 17px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #596362; background: #eceeeb; font-size: 16px; }
.stat-card:nth-child(2) .stat-icon { color: #716d62; background: #f1efe8; }
.stat-card:nth-child(3) .stat-icon { color: #616a69; background: #e9ebe8; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.directory-heading h2, .card-heading h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 15px; letter-spacing: -.35px; }
.directory-heading p, .card-heading p { margin: 4px 0 0; color: #939c96; font-size: 12px; }
.selection-summary { display: flex; align-items: center; gap: 7px; color: #78847c; font-size: 12px; }
.selection-dot { width: 6px; height: 6px; border-radius: 50%; background: #b4ad9c; }
.text-button { padding: 4px; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; }
.text-button:hover { color: var(--green-dark); text-decoration: underline; }
.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.search-box { display: flex; align-items: center; flex: 1; min-width: 160px; height: 37px; padding: 0 10px; border: 1px solid #e6eae6; border-radius: 6px; background: white; }
.search-box > span { margin-right: 7px; color: #9aa49e; font-size: 20px; line-height: 1; }
.search-box input { flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #a1aaa5; }
kbd { padding: 2px 4px; border: 1px solid #e9ece9; border-radius: 3px; color: #a0a9a3; background: #fafbfa; font-family: inherit; font-size: 8px; white-space: nowrap; }
.filter-select select { height: 37px; padding: 0 28px 0 10px; border: 1px solid #e6eae6; border-radius: 6px; outline: 0; color: #5d6861; background: white; font-size: 12px; }
.select-all-button { min-height: 37px; font-size: 12px; white-space: nowrap; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.contact-card { position: relative; min-width: 0; min-height: 142px; padding: 16px 15px 13px; border: 1px solid #e0e1dc; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.contact-card:hover { transform: translateY(-2px); border-color: #aeb6b3; box-shadow: 0 9px 22px rgba(39, 44, 44, .09); }
.contact-card.selected { border-color: #838d8d; background: #f7f8f5; }
.contact-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.contact-checkbox { position: absolute; top: 11px; right: 11px; width: 14px; height: 14px; accent-color: var(--green); cursor: pointer; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 60px; height: 60px; overflow: hidden; border: 1px solid #e0e2de; border-radius: 50%; color: #505a5a; background: #e9ebe8; font-family: Manrope, sans-serif; font-size: 18px; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-identity { min-width: 0; padding-right: 13px; }
.contact-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.contact-name { flex: 1; min-width: 0; overflow: hidden; margin: 0; color: #292e2f; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.attendance-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 12px; color: #384243; background: #e6e8e4; font-size: 11px; font-weight: 700; white-space: nowrap; }
.contact-phone { overflow: hidden; margin: 5px 0 0; color: #707877; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.whatsapp-number { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 0; border: 0; color: #38835b; background: transparent; font-weight: 600; text-align: left; cursor: pointer; }
.whatsapp-number span { flex: 0 0 auto; font-size: .9em; }
.whatsapp-number:hover { color: #21683f; text-decoration: underline; }
.whatsapp-number:focus-visible { outline: 2px solid #38835b; outline-offset: 3px; border-radius: 2px; }
.contact-notes { overflow: hidden; margin: 9px 0 0; color: #7d8582; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.contact-actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #e7e8e4; }
.contact-action { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 0; border-radius: 4px; color: #687271; background: transparent; font-size: 11px; }
.contact-action:hover { color: var(--green); background: #eef0ed; }
.contact-action.whatsapp-action { color: #38835b; }
.missing-badge { margin-left: auto; padding: 3px 5px; border-radius: 10px; color: #6b6557; background: #efede6; font-size: 12px; white-space: nowrap; }
.empty-state { padding: 62px 15px; border: 1px dashed #d9dcd8; border-radius: 8px; color: #707877; background: var(--surface); text-align: center; }
.empty-state > span { font-size: 25px; }
.empty-state h3 { margin: 11px 0 5px; color: #394142; font-size: 14px; }
.empty-state p { margin: 0; font-size: 11px; }
.page-footer { display: flex; justify-content: center; gap: 7px; margin: 29px 0 0; padding: 13px 0; border-top: 1px solid #dedfdb; color: #858b89; font-size: 9px; }
.page-footer span { color: #827d70; }

.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 13px; max-width: 960px; }
.home-view .area-grid { max-width: none; }
.home-hero { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); min-height: clamp(240px, 30vw, 415px); margin: 0 0 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.home-hero-copy { align-self: center; padding: clamp(23px, 4.2vw, 55px); }
.home-hero-copy h1 { margin: 0 0 12px; font-size: clamp(31px, 4vw, 57px); line-height: 1.05; text-wrap: balance; }
.home-hero-copy h1[tabindex="-1"]:focus { outline: none; }
.home-hero-copy .page-description { font-size: 14px; line-height: 1.45; }
.home-hero-photo { position: relative; min-width: 0; background: #b5c0c4; }
.home-hero-photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
@media (max-width: 600px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .home-hero-copy { padding: 22px; }
  .home-hero-photo { grid-row: 1; aspect-ratio: 2 / 1; }
}
.area-card { display: block; padding: 21px; color: inherit; text-decoration: none; }
.area-card h2 { margin: 14px 0 5px; font-size: 19px; }
.area-card p { margin: 0; color: var(--muted); font-size: 13px; }
.area-arrow { position: absolute; top: 22px; right: 21px; color: var(--green); }
@media (max-width: 600px) {
  .home-view .area-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-content: center; gap: 4px 11px; min-height: 84px; padding: 14px 36px 14px 14px; }
  .home-view .area-card .card-heading-icon { grid-row: span 2; }
  .home-view .area-card h2 { margin: 0; font-size: 16px; }
  .home-view .area-arrow { top: 15px; right: 14px; }
}
.visit-group-filter { display: grid; align-content: center; gap: 4px; min-height: 86px; text-align: left; }
.visit-group-filter .stat-label { font-size: 12px; letter-spacing: 0; color: var(--green); }
.visit-group-filter[aria-pressed="true"], .visit-filter-bar [aria-pressed="true"] { border-color: var(--green); background: var(--green-pale); }
.visit-group-filter:hover, .area-card:focus-visible { border-color: var(--green); }
.visit-group-badge { display: inline-block; max-width: 100%; margin-top: 4px; white-space: normal; }
.visit-contact-identity { padding-right: 0; }
.visit-contact-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.visit-editor-fields { min-width: 0; margin: 0; padding: 0; border: 0; }

.secretary-month, .secretary-share-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.secretary-page-heading { align-items: end; margin-bottom: 20px; }
.secretary-section { margin-bottom: 18px; }
.secretary-month .field-label, .secretary-share-controls .field-label { margin-top: 0; }
.secretary-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.secretary-section-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 12px; }
.secretary-section-heading h2 { margin: 0; font-size: 17px; }
.secretary-section-heading p, .secretary-empty { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.secretary-empty { margin-top: 15px; }
.secretary-row { display: grid; align-items: start; gap: 9px; margin-top: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.secretary-row > label { min-width: 0; }
.secretary-row .button { margin-top: 30px; }
.secretary-visit-row { grid-template-columns: minmax(125px, .7fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1.15fr) auto; }
.secretary-pending { scroll-margin-top: 70px; }
.secretary-pending .secretary-section-heading h2 { font-size: 19px; }
.secretary-pending .secretary-section-heading p, .secretary-pending .secretary-empty { font-size: 14px; line-height: 1.45; }
.secretary-pending-list { margin: 12px 0 0; padding: 0; list-style: none; }
.secretary-pending-entry { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 10px 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.secretary-pending-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.4; }
.secretary-pending-details strong { font-size: 16px; }
.secretary-pending-details a { color: var(--green); text-underline-offset: 2px; }
.secretary-pending-details span { color: var(--muted); }
.secretary-pending .button, .secretary-pending-editor .dialog-actions .button { font-size: 14px; }
.secretary-pending-entry .button { min-height: 38px; padding-inline: 12px; }
.secretary-print-pending { display: none; }
.secretary-pending-editor #pending-editor-title:focus { outline: none; }
.secretary-pending-editor .dialog-heading h2 { font-size: 19px; }
.secretary-pending-editor .field-label { font-size: 12px; }
.secretary-pending-editor .text-field { font-size: 16px; }
.secretary-pending-editor .dialog-actions { flex-wrap: wrap; }

@media (max-width: 640px) {
  .secretary-pending .secretary-section-heading { display: grid; grid-template-columns: minmax(0, 1fr); }
  .secretary-pending .secretary-section-heading > .button { justify-self: start; min-height: 44px; }
  .secretary-pending-entry { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .secretary-pending-details { display: grid; justify-items: start; }
  .secretary-pending-entry .secretary-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .secretary-pending-entry .button { min-height: 44px; }
  .secretary-pending-editor { max-width: 100%; }
}

@media (max-width: 400px) {
  .secretary-pending-editor .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .secretary-pending-editor .dialog-actions [type="submit"] { grid-column: 1 / -1; }
}
.secretary-row-actions, .secretary-share-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.secretary-share-actions a { text-decoration: none; }
.secretary-pdf-status { flex-basis: 100%; max-width: 330px; color: var(--muted); font-size: 12px; }
.secretary-pdf-status:empty { display: none; }
.secretary-recipient-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr)); gap: 8px; }
.secretary-recipient-list .secretary-empty { grid-column: 1 / -1; }
.secretary-recipient { justify-content: start; min-height: 48px; padding: 5px 8px; text-decoration: none; text-align: left; }
.secretary-recipient .avatar { width: 34px; height: 34px; font-size: 12px; }
.secretary-recipient-name { min-width: 0; overflow-wrap: anywhere; }
.secretary-recipient-arrow { flex: 0 0 auto; margin-left: auto; }
.secretary-save { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-bottom: 14px; }
.secretary-responsibles .text-field + .text-field { margin-top: 5px; }
.secretary-view .secretary-report { border-top: 3px solid var(--green); margin-bottom: 26px; }
.secretary-report-header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 10px 16px; margin-bottom: 15px; }
.secretary-report-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.secretary-report-actions a, .secretary-save a { text-decoration: none; }
.secretary-report h2 { margin: 0; font-size: clamp(19px, 2.2vw, 24px); }
.secretary-report-count { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.secretary-draft-note { margin: 0 0 12px; padding: 8px 11px; border-left: 3px solid #a27a13; background: #fff8db; color: #604b11; font-size: 13px; }
#report-heading, #schedule-heading { scroll-margin-top: 70px; }
.secretary-report h3 { margin: 20px 0 8px; font-size: 15px; }
.secretary-report-table { overflow-x: auto; border-radius: 6px; }
.secretary-report table { width: 100%; border-collapse: collapse; font-size: 13px; }
.secretary-report th, .secretary-report td { padding: 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.secretary-report th { background: var(--green-pale); }
.secretary-report td:first-child { white-space: nowrap; }
.secretary-report .secretary-visit-dates { white-space: normal; }
.secretary-visit-dates small { display: block; color: var(--muted); }
.secretary-visit-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.secretary-visit-legend li { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid var(--visit-accent); border-radius: 5px; background: var(--visit-background); color: var(--visit-ink); font-size: 12px; }
.secretary-visit-legend strong { min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.visit-highlight-confirmed { --visit-accent: #37805a; --visit-background: #e8f5eb; --visit-ink: #225239; }
.visit-highlight-upcoming { --visit-accent: #4678ad; --visit-background: #eaf3fc; --visit-ink: #234f7a; }
.visit-highlight-overdue { --visit-accent: #a27a13; --visit-background: #fff8db; --visit-ink: #6a5008; }
.visit-highlight-priority { --visit-accent: #b45409; --visit-background: #ffead1; --visit-ink: #783609; }
.secretary-report tr:is(.visit-highlight-confirmed, .visit-highlight-upcoming, .visit-highlight-priority, .visit-highlight-overdue) > td { background: var(--visit-background); }
.secretary-report tr:is(.visit-highlight-confirmed, .visit-highlight-upcoming, .visit-highlight-priority, .visit-highlight-overdue) > td:first-child { box-shadow: inset 3px 0 var(--visit-accent); }
.secretary-report tr.visit-highlight-priority > td:first-child { box-shadow: inset 5px 0 var(--visit-accent); }
.secretary-highlight-label { margin-top: 3px; color: var(--visit-ink); font-weight: 700; }
.secretary-visit-type { grid-column: 1 / -1; max-width: 225px; }
.secretary-visit-contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.secretary-finalized { padding-top: 30px; }
.secretary-visit-type .field-label, .secretary-follow-up .field-label { margin-top: 0; }
.secretary-follow-up { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; white-space: normal; }
.secretary-follow-up .notice { flex-basis: 100%; margin: 0; }
.secretary-check { display: inline-flex; align-items: center; gap: 6px; min-height: 39px; }
.secretary-status { color: var(--green); font-size: 13px; }
.secretary-save-toast { position: fixed; right: 18px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 15; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 15px; border-radius: 7px; color: #fff; background: #344a3c; box-shadow: var(--shadow); font-size: 14px; }
.secretary-save-toast button { border: 0; padding: 0 4px; color: inherit; background: transparent; font-size: 18px; }
.secretary-row-actions a { text-decoration: none; }
@media (max-width: 760px) { .secretary-save-toast { bottom: calc(72px + env(safe-area-inset-bottom)); } }
.secretary-share-controls, .secretary-preview, .secretary-recipient-list { margin-top: 14px; }
.secretary-preview { font-size: 13px; }
.secretary-preview summary { cursor: pointer; font-weight: 600; }
.secretary-preview pre { margin: 8px 0; padding: 12px; border-radius: 6px; background: var(--canvas); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .secretary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .secretary-row .button { margin-top: 0; }
  .secretary-row-actions { align-self: end; }
}

@media (max-width: 440px) {
  .secretary-row { grid-template-columns: minmax(0, 1fr); }
  .secretary-view .secretary-report { padding: 14px; }
  .secretary-report-actions .button { min-height: 42px; }
}

@media screen and (max-width: 1100px) {
  .secretary-report-table { overflow: visible; }
  .secretary-report-table table, .secretary-report-table tbody { display: block; }
  .secretary-report-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .secretary-report .secretary-visit-record {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "name name" "dates status" "address address" "responsible responsible" "actions actions";
    gap: 8px 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--visit-accent, #aeb7b1);
    border-radius: 8px;
    background: #fff;
  }
  .secretary-report .secretary-report-table .secretary-visit-record > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: break-word;
  }
  .secretary-report .secretary-report-table .secretary-visit-record > td:first-child { box-shadow: none; }
  .secretary-report .secretary-visit-record > td[data-label]::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
  }
  .secretary-report .secretary-report-table .secretary-visit-record > .secretary-visit-name { grid-area: name; font-size: 17px; font-weight: 700; }
  .secretary-visit-dates { grid-area: dates; }
  .secretary-report .secretary-report-table .secretary-visit-record > .secretary-visit-status {
    grid-area: status;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--visit-background, var(--canvas));
  }
  .secretary-visit-address { grid-area: address; }
  .secretary-visit-responsible { grid-area: responsible; }
  .secretary-report .secretary-report-table :is(.secretary-visit-address, .secretary-visit-responsible):empty { display: none; }
  .secretary-report .secretary-report-table .secretary-visit-record > .secretary-visit-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 6px; }
  .secretary-visit-actions .button { min-height: 42px; font-size: 13px; }
  .secretary-follow-up-row, .secretary-follow-up-row > td { display: block; }
  .secretary-follow-up-row { margin: 0 0 10px; border-radius: 8px; background: var(--surface); }
}

@media print {
  body:has(.secretary-report) { background: white; }
  body:has(.secretary-report) :is(.sidebar, .topbar, .secretary-view > :not(.secretary-report), .secretary-report-actions, .secretary-report-edit, .secretary-draft-note) { display: none !important; }
  body:has(.secretary-report) :is(.main-content, .secretary-view, .secretary-report) { min-height: auto; margin: 0; padding: 0; }
  .secretary-view .secretary-report { background: white; border: 0; box-shadow: none; padding: 0; }
  .secretary-report table { min-width: 0; }
  .secretary-print-pending { display: block; }
  .secretary-report-table { overflow: visible; }
  .secretary-report tr { break-inside: avoid; }
  .secretary-report thead { display: table-header-group; }
  .secretary-report h3 { break-after: avoid; }
  .secretary-report th, .secretary-report td { padding: 5px; }
}

@media (max-width: 760px) {
  .visit-filter-bar .search-box { min-width: 0; }
}

.message-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(245px, .75fr); align-items: start; gap: 16px; }
.composer-card, .recipients-card { padding: 20px; border: 1px solid #e0e1dc; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.card-heading-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; color: #686254; background: #efede6; font-size: 18px; }
.card-heading-icon.green-icon { color: #505a5a; background: #e9ebe8; }
.field-label { display: block; margin: 15px 0 7px; color: #7b8880; font-size: 9px; font-weight: 700; letter-spacing: .65px; }
.template-row { display: flex; gap: 7px; }
.template-row select { flex: 1; }
.template-row select, .text-field { width: 100%; min-height: 37px; padding: 9px 10px; border: 1px solid #e4e9e4; border-radius: 5px; outline: 0; color: #39453e; background: #fff; font-size: 11px; }
.text-field:focus, .template-row select:focus { border-color: #879191; box-shadow: 0 0 0 2px #e9ebe8; }
.message-textarea { min-height: 145px; line-height: 1.6; resize: vertical; }
.field-hint { margin: 6px 0 0; color: #969f99; font-size: 9px; line-height: 1.5; }
.field-hint code { padding: 1px 3px; border-radius: 3px; color: #485252; background: #e9ebe8; font-size: 9px; }
.save-template-button { margin-top: 12px; }
.attachment-area { margin-top: 19px; padding-top: 4px; border-top: 1px solid #edf0ed; }
.upload-box { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px; border: 1px dashed #c9ceca; border-radius: 6px; background: #f7f8f5; cursor: pointer; }
.upload-box:hover { border-color: #818a89; }
.upload-box > span:nth-child(2) strong, .upload-box > span:nth-child(2) small { display: block; }
.upload-box > span:nth-child(2) strong { color: #485151; font-size: 12px; }
.upload-box > span:nth-child(2) small { margin-top: 3px; color: #9aa49d; font-size: 9px; }
.upload-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: #4d5858; background: #e9ebe8; font-size: 16px; }
.upload-box input, .photo-upload-button input { display: none; }
.attachment-preview { display: flex; align-items: center; gap: 9px; margin-top: 9px; padding: 8px; border-radius: 5px; background: #f6f8f5; }
.attachment-preview img { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; }
.attachment-preview span { flex: 1; overflow: hidden; color: #59665d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview button { border: 0; color: #8b5e51; background: transparent; font-size: 12px; }
.attachment-note { margin-top: 8px; }
.recipients-column { display: grid; gap: 12px; }
.recipients-card { padding: 18px; }
.recipients-card .card-heading { margin-bottom: 18px; }
.recipient-count { display: flex; align-items: baseline; gap: 6px; padding: 12px 0; border-top: 1px solid #edf0ed; border-bottom: 1px solid #edf0ed; color: #89948d; font-size: 12px; }
.recipient-count span:first-child { color: var(--green); font-family: Manrope, sans-serif; font-size: 22px; font-weight: 700; }
.recipient-chips { display: flex; flex-wrap: wrap; gap: 5px; max-height: 155px; min-height: 43px; margin: 12px 0; overflow-y: auto; align-content: flex-start; }
.recipient-chip { max-width: 100%; overflow: hidden; padding: 5px 7px; border-radius: 12px; color: #465050; background: #e9ebe8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.muted-copy { padding-top: 9px; color: #a0a8a2; font-size: 12px; }
.full-button { width: 100%; }
.full-button:disabled { border-color: #dfe5df; color: #a2aaa4; background: #eef1ed; box-shadow: none; cursor: not-allowed; }
.clear-selection-button { display: block; margin: 7px auto 0; }
.whatsapp-note { display: flex; gap: 7px; margin-top: 13px; padding: 9px; border-radius: 5px; color: #687271; background: #eff1ee; font-size: 9px; line-height: 1.5; }
.whatsapp-note > span { color: #4e8a5e; }
.tip-card { display: flex; gap: 10px; padding: 13px; border: 1px solid #e2dfd5; border-radius: 7px; background: #f3f1ea; }
.tip-icon { color: #817c6e; font-size: 14px; }
.tip-card strong { color: #4c5150; font-size: 12px; }
.tip-card p { margin: 4px 0 0; color: #737977; font-size: 9px; line-height: 1.5; }

.contact-dialog { width: min(440px, calc(100vw - 28px)); max-height: min(90vh, 760px); padding: 23px; overflow: auto; border: 1px solid #dedfdb; border-radius: 10px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 70px rgba(29, 34, 35, .22); }
.contact-dialog::backdrop { background: rgba(39, 44, 44, .48); backdrop-filter: blur(2px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-heading h2 { margin: 7px 0 0; font-family: Manrope, sans-serif; font-size: 20px; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; color: #525b5b; background: #e9ebe8; font-size: 20px; }
.photo-edit-row { display: flex; align-items: center; gap: 10px; }
.photo-edit-preview { display: grid; place-items: center; width: 47px; height: 47px; overflow: hidden; border: 1px solid #dedfdb; border-radius: 50%; color: #4d5858; background: #e9ebe8; font-size: 17px; }
.photo-edit-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload-button { cursor: pointer; }
.presence-field { margin-top: 15px; }
.presence-field .field-label { margin: 0 0 7px; }
.presence-toggle { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 10px 12px; border: 1px solid #dedfdb; border-radius: 6px; background: #f7f8f5; cursor: pointer; }
.presence-toggle input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--green); }
.presence-copy strong, .presence-copy small { display: block; }
.presence-copy strong { color: #394142; font-size: 12px; }
.presence-copy small { margin-top: 4px; color: #747a79; font-size: 12px; line-height: 1.4; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 14px; border-top: 1px solid #edf0ed; }
.toast { position: fixed; right: 22px; bottom: 20px; z-index: 10; max-width: min(390px, calc(100vw - 35px)); padding: 11px 15px; transform: translateY(15px); border-radius: 6px; color: white; background: #3b4445; box-shadow: 0 7px 24px rgba(0,0,0,.18); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { transform: translateY(0); opacity: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 1450px) {
  .view { padding-right: 54px; padding-left: 54px; }
  .topbar { padding-right: max(54px, calc((100% - 1132px) / 2)); padding-left: max(54px, calc((100% - 1132px) / 2)); }
}
@media (max-width: 1100px) {
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view { padding-right: 4%; padding-left: 4%; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: #303738;
    box-shadow: 0 -4px 18px rgba(39, 44, 44, .14);
  }
  .brand, .side-label, .sidebar-bottom, .sidebar-photo { display: none; }
  .main-nav { display: flex; width: 100%; gap: 8px; margin: 0; }
  .nav-link {
    position: relative;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 48px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 11px;
    text-align: center;
  }
  .nav-link > span:first-child { width: auto; font-size: 17px; }
  .nav-link.active { box-shadow: inset 0 2px #c9c3b4; }
  .nav-count { display: none; }
  .main-content { margin: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 52px;
    padding: 0 16px;
    backdrop-filter: blur(10px);
  }
  .breadcrumbs { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar #export-button { flex: 0 0 40px; width: 40px; min-height: 40px; padding: 0; overflow: hidden; font-size: 0; }
  .topbar #export-button span { font-size: 18px; }
  .view { padding: 24px 16px 14px; }
  .page-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 22px; }
  h1 { font-size: clamp(24px, 7vw, 29px); line-height: 1.18; letter-spacing: -.8px; }
  .page-description { max-width: 460px; font-size: 12px; line-height: 1.55; }
  .page-heading > .button { width: max-content; min-height: 44px; margin: 0; padding: 0 14px; font-size: 12px; }
  .stats-grid { gap: 8px; margin-bottom: 27px; }
  .stat-card { min-width: 0; min-height: 91px; padding: 13px 10px 11px; }
  .stat-label { max-width: none; font-size: 8px; line-height: 1.35; letter-spacing: .3px; }
  .stat-value { margin-top: 8px; font-size: 22px; }
  .stat-note { margin-top: 4px; font-size: 9px; line-height: 1.25; }
  .stat-icon { display: none; }
  .directory-heading { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .directory-heading h2 { font-size: 16px; }
  .selection-summary { width: 100%; max-width: none; flex-wrap: nowrap; justify-content: flex-start; font-size: 11px; }
  .selection-summary .text-button { width: auto; margin-left: auto; font-size: 11px; text-align: right; }
  .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 8px; }
  .search-box { grid-column: 1 / -1; width: 100%; min-width: 0; height: 46px; }
  .search-box input { font-size: 15px; }
  .search-box kbd { display: none; }
  .filter-select { min-width: 0; }
  .filter-select select { width: 100%; height: 44px; padding: 0 24px 0 9px; font-size: 11px; }
  .select-all-button { min-height: 44px; padding: 0 10px; font-size: 12px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .contact-card { min-height: 148px; padding: 16px 14px 11px; }
  .contact-card-top { gap: 14px; padding-right: 28px; }
  .contact-checkbox { top: 14px; right: 13px; width: 20px; height: 20px; }
  .avatar { width: clamp(58px, 17vw, 68px); height: clamp(58px, 17vw, 68px); font-size: 20px; }
  .contact-identity { padding-right: 0; }
  .contact-name { font-size: 16px; line-height: 1.3; }
  .attendance-badge { padding: 4px 7px; font-size: 12px; }
  .contact-phone { margin-top: 6px; font-size: 14px; }
  .contact-notes { margin-top: 9px; font-size: 12px; }
  .contact-actions { flex-wrap: wrap; gap: 5px; margin-top: 10px; padding-top: 8px; }
  .contact-action { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .missing-badge { margin-left: auto; font-size: 12px; }
  .message-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .composer-card, .recipients-card { padding: 16px; }
  .card-heading { gap: 9px; margin-bottom: 18px; }
  .card-heading h2 { font-size: 15px; }
  .card-heading p { font-size: 11px; line-height: 1.4; }
  .field-label { margin-top: 16px; font-size: 12px; }
  .template-row { align-items: stretch; gap: 7px; }
  .template-row select, .text-field { min-height: 44px; font-size: 16px; }
  .template-row select { min-width: 0; }
  .template-row .button { min-height: 44px; }
  .message-textarea { min-height: 160px; }
  .field-hint { font-size: 12px; }
  .save-template-button { min-height: 44px; }
  .upload-box { min-height: 64px; }
  .upload-box > span:nth-child(2) strong { font-size: 12px; }
  .upload-box > span:nth-child(2) small { font-size: 12px; }
  .attachment-preview { min-height: 58px; }
  .attachment-preview span, .attachment-preview button { font-size: 11px; }
  .recipient-count { font-size: 11px; }
  .recipient-chips { max-height: 180px; }
  .recipient-chip { padding: 7px 9px; font-size: 12px; }
  .full-button { min-height: 48px; font-size: 12px; }
  .clear-selection-button { min-height: 40px; font-size: 11px; }
  .whatsapp-note, .tip-card p { font-size: 12px; }
  .page-footer { justify-content: flex-start; margin-top: 20px; font-size: 12px; line-height: 1.5; }
  .contact-dialog { width: calc(100vw - 24px); max-height: 85dvh; padding: 18px 16px; }
  .contact-dialog .text-field { font-size: 16px; }
  .presence-toggle { min-height: 64px; }
  .contact-dialog .dialog-actions .button { min-height: 44px; }
  .toast { right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); font-size: 12px; }
}
@media (max-width: 360px) {
  .view { padding-right: 12px; padding-left: 12px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .stats-grid { gap: 6px; }
  .stat-card { padding-right: 7px; padding-left: 7px; }
  .stat-label { font-size: 7px; }
  .stat-note { font-size: 8px; }
  .selection-summary { font-size: 12px; }
  .selection-summary .text-button { font-size: 12px; }
}

.editor-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 14px; background: rgba(39, 44, 44, .48); backdrop-filter: blur(2px); }
.editor-dialog { width: min(520px, calc(100vw - 28px)); }
.editor-dialog .text-field { display: block; min-height: 42px; }
.editor-dialog textarea.text-field { min-height: 94px; }
.editor-dialog .validation-message, .editor-dialog .validation-summary-errors { color: #a4493d; font-size: 12px; }
.notice { margin: 0 0 15px; padding: 11px 13px; border: 1px solid #dfe3dd; border-radius: 6px; font-size: 12px; line-height: 1.5; }
.notice-error { border-color: #e7c7c0; color: #873e34; background: #fbefec; }
.notice-success { border-color: #cddfd0; color: #366441; background: #eef6ee; }
.button-danger { border-color: #e3c9c4; color: #8d4037; background: #fff8f6; }
.button-danger:hover { background: #fae9e5; }
.instrument-list { display: grid; gap: 9px; }
.instrument-row { display: flex; align-items: center; gap: 15px; min-width: 0; padding: 13px 15px; border: 1px solid #e0e1dc; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.instrument-visual, .instrument-photo-preview { display: grid; flex: 0 0 auto; place-items: center; width: 58px; height: 58px; overflow: hidden; border: 1px solid #e0e2de; border-radius: 8px; color: #505a5a; background: #e9ebe8; font-size: 24px; }
.instrument-visual img, .instrument-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.instrument-details { flex: 1; min-width: 0; }
.instrument-details h2 { overflow: hidden; margin: 0; color: #292e2f; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.instrument-details p { margin: 5px 0 0; color: #707877; font-size: 12px; }
.instrument-details p span { padding: 0 3px; color: #a2a7a3; }
.instrument-details small { display: block; overflow: hidden; margin-top: 5px; color: #858b88; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.status-active { color: #3e6b4c; background: #e8f0e8; }
.status-inactive { color: #74684f; background: #f0eee7; }
.instrument-meta { display: grid; flex: 0 0 75px; justify-items: center; gap: 2px; color: #858b88; font-size: 11px; }
.instrument-meta strong { color: #3d4849; font-size: 17px; }
.instrument-actions { display: flex; align-items: center; gap: 4px; }
.instrument-active-toggle { margin-top: 15px; }
.recipient-search { min-width: 0; margin-bottom: 10px; }
.recipient-picker { display: grid; max-height: 315px; overflow-y: auto; }
.recipient-option { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 5px; border-bottom: 1px solid #edf0ed; cursor: pointer; }
.recipient-option input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--green); }
.recipient-option-copy { min-width: 0; }
.recipient-option-copy strong, .recipient-option-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipient-option-copy strong { color: #41494a; font-size: 12px; }
.recipient-option-copy small { margin-top: 3px; color: #89918e; font-size: 11px; }
.template-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid #edf0ed; }
.template-item > div:first-child { min-width: 0; }
.template-item strong { color: #41494a; font-size: 12px; }
.template-item p { display: -webkit-box; overflow: hidden; margin: 4px 0 0; color: #7d8582; font-size: 12px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.template-item-actions { display: flex; flex: 0 0 auto; gap: 2px; }
.templates-card .full-button { margin-top: 12px; }
.recipient-links { display: grid; gap: 8px; margin-top: 16px; }
.recipient-open-link { width: 100%; min-height: 44px; text-decoration: none; text-align: center; }

@media (max-width: 760px) {
  .instrument-row { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .instrument-visual { width: 52px; height: 52px; }
  .instrument-details { flex-basis: calc(100% - 68px); }
  .instrument-meta { flex: 1; grid-auto-flow: column; justify-content: start; justify-items: start; gap: 7px; padding-left: 2px; }
  .instrument-meta strong { font-size: 13px; }
  .instrument-actions { margin-left: auto; }
  .instrument-actions .contact-action { min-height: 40px; }
  .recipient-count { flex-wrap: wrap; }
  .recipient-count .text-button { margin-left: auto; }
  .select-all-button { padding: 0 7px; font-size: 9px; }
  .template-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Entrada no sistema */
.login-shell { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; background: #2e3536; }
.login-photo { position: absolute; inset: 0; background: url("/casa-de-oracao.webp") center / cover no-repeat; opacity: .28; }
.login-card-wrap { position: relative; width: 100%; max-width: 400px; }
.login-card { padding: 30px 28px 26px; border: 1px solid #e0e1dc; border-radius: 10px; background: var(--surface); box-shadow: 0 18px 50px rgba(20, 28, 28, .35); }
.login-card h1 { margin: 10px 0 4px; font-size: 22px; text-align: center; }
.login-mark { display: grid; width: 42px; height: 42px; margin: 0 auto; place-items: center; border-radius: 10px; color: #fff; background: var(--green); font-size: 20px; }
.login-lead { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.login-submit { width: 100%; margin-top: 20px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-user form { margin: 0; }
.topbar-user-name { color: #414748; font-size: 12px; font-weight: 600; text-decoration: none; }
.topbar-user-name small { margin-left: 6px; padding: 2px 7px; border-radius: 10px; color: #596062; background: #e9ebe8; font-size: 10px; font-weight: 700; }

[hidden] { display: none !important; }

/* Mensagem do dia */
.verse-card { position: relative; margin: 0 0 19px; padding: 22px 24px; border: 1px solid #e0e1dc; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.verse-kicker { color: #7b8880; font-size: 10px; font-weight: 700; letter-spacing: .8px; }
.verse-text { margin: 10px 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(17px, 2vw, 22px); line-height: 1.45; color: var(--ink); }
.verse-ref { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.verse-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.verse-notice { margin: 14px 0 0; }
.verse-mine { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid #edf0ed; }
.verse-mine li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0ed; font-size: 12px; }
.verse-mine li > div:first-child { display: grid; gap: 2px; min-width: 0; }
.verse-mine span { color: var(--muted); }
.verse-mine-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.home-stats { margin-bottom: 19px; }

/* Administração */
.admin-card { margin-bottom: 22px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid #edf0ed; text-align: left; vertical-align: middle; }
.admin-table thead th { color: #7b8880; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.admin-table small { display: block; margin-top: 2px; color: #969f99; font-size: 10.5px; font-weight: 400; }
.admin-table tbody th { font-weight: 600; min-width: 220px; }
.admin-select { min-width: 130px; padding: 6px 8px; }
.admin-all { color: var(--muted); font-weight: 600; }
.admin-only-row th, .admin-only-row td { background: #f3f4f1; }
.admin-row-actions { white-space: nowrap; }
.admin-new-user { margin-top: 22px; padding-top: 16px; border-top: 1px solid #edf0ed; }
.admin-new-user h3 { margin: 0 0 4px; font-size: 14px; }
.admin-new-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; margin-bottom: 16px; }
.admin-search { margin-bottom: 8px; max-width: 420px; }
.admin-messages { max-height: 460px; overflow: auto; margin-bottom: 12px; }
.account-form { max-width: 420px; }

/* Por instrumento e orquestra */
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .stats-grid-4 { grid-template-columns: repeat(2, 1fr); } }
.by-instrument-filters, .orchestra-filters { flex-wrap: wrap; }
.instrument-family { margin-bottom: 16px; }
.instrument-row { padding: 12px 0; border-top: 1px solid #edf0ed; }
.instrument-row:first-of-type { border-top: 0; }
.instrument-row-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.instrument-count { display: inline-grid; min-width: 24px; height: 22px; padding: 0 7px; place-items: center; border-radius: 11px; color: #fff; background: var(--green); font-size: 11px; font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip { padding: 5px 11px; border: 1px solid #d7dad6; border-radius: 15px; color: #424a4b; background: var(--surface); font-size: 12px; cursor: pointer; }
.person-chip.present { border-color: #b9d3c0; background: #eef6ee; }
.person-chip:hover { border-color: var(--green); }
.plain-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.orchestra-print-title { display: none; }
.orchestra-naipe { margin-bottom: 22px; }
.orchestra-naipe > h3 { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--green); font-size: 16px; }
.orchestra-naipe > h3 small, .orchestra-bench-title span { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.orchestra-family h4 { margin: 12px 0 8px; color: #596062; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
.orchestra-benches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.orchestra-bench { padding: 10px; border: 1px solid #e0e1dc; border-radius: 8px; background: var(--surface); }
.orchestra-bench-title { margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.orchestra-person { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; opacity: .6; }
.orchestra-person.present { opacity: 1; }
.orchestra-avatar { display: grid; flex: 0 0 auto; width: 26px; height: 26px; overflow: hidden; place-items: center; border-radius: 50%; color: #596062; background: #e9ebe8; font-size: 10px; font-weight: 700; }
.orchestra-avatar img { width: 100%; height: 100%; object-fit: cover; }
@media print {
  body:has(.orchestra-view) :is(.sidebar, .topbar, .page-heading, .orchestra-filters) { display: none !important; }
  body:has(.orchestra-view) :is(.main-content, .orchestra-view) { margin: 0; padding: 0; }
  body:has(.orchestra-view) .orchestra-print-title { display: block; margin: 0 0 12px; font-size: 18px; }
  body:has(.orchestra-view) .orchestra-person { opacity: 1; }
}

/* Ensaios */
.rehearsal-list { display: grid; gap: 14px; }
.rehearsal-card h2 { margin: 6px 0 2px; font-size: 18px; }
.rehearsal-card h2::first-letter { text-transform: uppercase; }
.rehearsal-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.rehearsal-kind { display: inline-block; padding: 2px 9px; border-radius: 10px; color: #fff; background: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.rehearsal-kind.regional { background: #8a6d3b; }
.rehearsal-total { display: grid; min-width: 62px; padding: 8px 10px; place-items: center; border-radius: 8px; background: #e9ebe8; }
.rehearsal-total strong { font-size: 22px; line-height: 1; }
.rehearsal-total span { color: var(--muted); font-size: 10px; }
.rehearsal-leaders { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 6px; }
.leader-badge { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.leader-badge small { display: block; color: var(--muted); font-size: 10px; }
.leader-badge .orchestra-avatar { width: 38px; height: 38px; }
.rehearsal-instruments { margin: 8px 0; }
.rehearsal-visits { margin: 8px 0; padding-left: 18px; font-size: 12px; }
.rehearsal-actions { flex-wrap: wrap; }
.rehearsal-editor { max-width: 760px; }
.editor-section { margin: 20px 0 8px; font-size: 14px; }
.editor-section small { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 400; }
.attendance-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 260px; margin-top: 8px; overflow: auto; }
.attendance-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #e0e1dc; border-radius: 7px; font-size: 12px; cursor: pointer; }
.attendance-item.checked { border-color: #b9d3c0; background: #eef6ee; }
.attendance-item small { display: block; color: var(--muted); font-size: 10px; }
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 8px; }
.count-item { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid #e0e1dc; border-radius: 7px; font-size: 12px; }
.count-item span { flex: 1; }
.visitor-row { display: grid; grid-template-columns: 1.2fr 1.2fr 80px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 640px) { .visitor-row { grid-template-columns: 1fr 1fr; } }
.rehearsal-sheet { max-width: 720px; }
.rehearsal-sheet-actions { display: flex; gap: 8px; margin-bottom: 14px; }
@media print {
  body:has(.rehearsal-sheet) :is(.sidebar, .topbar, .rehearsal-sheet-actions, .page-heading, .rehearsal-list, .notice) { display: none !important; }
  body:has(.rehearsal-sheet) :is(.main-content, .rehearsals-view) { margin: 0; padding: 0; }
  body:has(.rehearsal-sheet) .sheet-backdrop { position: static; padding: 0; background: none; }
  body:has(.rehearsal-sheet) .rehearsal-sheet { max-width: none; border: 0; box-shadow: none; }
}

/* Backup */
.import-preview { margin-top: 16px; padding: 14px 16px; border: 1px solid #dfe3dd; border-radius: 8px; background: #fff; }
.import-preview h3 { margin: 0 0 8px; font-size: 14px; }
.import-preview ul { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.confirm-text { margin: 4px 0 0; font-size: 15px; line-height: 1.5; }
.confirm-dialog { max-width: 380px; }
.confirm-backdrop { z-index: 400; }
