@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;1,9..144,500&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --ink: #1F2A30;
    --muted: #66747C;
    --page: #F4F7F6;
    --sheet: #FFFFFF;
    --line: #E3EAE7;
    --sage: #2F6B5E;
    --sage-deep: #24564B;
    --sage-soft: #E7F3EF;
    --moss: #1F7A4D;
    --moss-bg: #E7F6EE;
    --wine: #A33B32;
    --wine-bg: #FDECEC;
    --shadow: 0 1px 2px rgba(31, 42, 48, 0.04), 0 10px 28px rgba(31, 42, 48, 0.05);
    --font-display: "Fraunces", "Iowan Old Style", Palatino, serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --radius: 16px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--page);
    color: var(--ink);
    line-height: 1.6;
}

body::before {
    display: none;
}

h1, h2, .header h1, .card h2, .stat-card .value {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
}

.header {
    background: var(--sheet);
    color: var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 28px 32px;
}

.header::before {
    height: 0;
    background: transparent;
}

.header h1,
.header p,
.header .breadcrumb,
.breadcrumb,
.header .breadcrumb a,
.breadcrumb a {
    color: var(--muted);
    font-weight: 600;
}

.header h1 {
    color: var(--ink);
    font-size: 34px;
    background: none;
    -webkit-text-fill-color: var(--ink);
    margin-bottom: 4px;
}

.header p {
    color: var(--muted);
}

.breadcrumb a:hover,
.header .breadcrumb a:hover {
    color: var(--sage);
}

.header h1::before {
    content: none;
}

.card {
    background: var(--sheet);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    animation: none;
}

.card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.card h2 {
    color: var(--ink);
    background: none;
    border-bottom: 1px solid var(--line);
    font-size: 28px;
    padding-bottom: 12px;
}

.btn,
.bulletin-preview-link {
    border-radius: 10px;
    box-shadow: none;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-primary,
.bulletin-preview-link,
.btn-edit,
.btn-scales,
.btn-publish {
    background: var(--sage);
    color: #fff;
    border: 1px solid var(--sage);
    box-shadow: none;
}

.btn-primary:hover,
.bulletin-preview-link:hover,
.btn-edit:hover,
.btn-scales:hover,
.btn-publish:hover {
    transform: none;
    background: var(--sage-deep);
    border-color: var(--sage-deep);
    color: #fff;
    box-shadow: none;
}

.btn-secondary {
    background: var(--sheet);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn-secondary:hover {
    transform: none;
    background: var(--page);
    color: var(--ink);
    box-shadow: none;
}

.btn-danger,
.btn-delete {
    background: var(--sheet);
    color: var(--wine);
    border: 1px solid #F0D0CD;
    box-shadow: none;
}

.btn-danger:hover,
.btn-delete:hover {
    transform: none;
    background: var(--wine-bg);
    color: var(--wine);
    box-shadow: none;
}

.btn-sm:disabled,
.btn:disabled {
    opacity: 0.45;
}

.church-page .container {
    max-width: 840px;
}

.church-page .header,
.church-page .card {
    padding: 24px 28px;
}

.church-page .header {
    margin-bottom: 16px;
}

.church-page .header p {
    margin: 0 0 8px;
}

.church-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.church-form .form-group {
    margin-bottom: 16px;
    min-width: 0;
}

.church-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 650;
}

.church-form input,
.church-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
    box-sizing: border-box;
}

.church-form textarea {
    min-height: 112px;
    resize: vertical;
}

.church-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    margin-top: 4px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea,
.form-control,
.filter-group input,
.filter-group select,
.primary-role-select {
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--sheet);
    color: var(--ink);
    font-family: var(--font-body);
    box-shadow: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus,
.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(47, 107, 94, 0.14);
    background-color: #fff;
}

.form-group select,
.filter-group select,
.primary-role-select {
    appearance: none;
    background-color: var(--sheet);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232F6B5E' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 12px;
    min-height: 48px;
    padding: 12px 40px 12px 14px;
    cursor: pointer;
}

.filter-group input[type="text"],
.filter-group input[type="search"],
.filter-group input[type="email"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
}

.filters .btn {
    min-height: 48px;
}

.checkbox-group {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--page);
}

.roles-grid {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.role-checkbox {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--sheet);
}

.checkbox-group:hover,
.role-checkbox:hover {
    background: var(--sage-soft);
    border-color: #C9DDD6;
}

.checkbox-group input,
.role-checkbox input,
.role-checkbox input[type="checkbox"] {
    accent-color: var(--sage);
}

.role-checkbox input[type="checkbox"]:checked + label {
    color: var(--sage-deep);
}

.alert {
    border-radius: 12px;
    box-shadow: none;
    animation: none;
}

.alert-success {
    background: var(--moss-bg);
    color: var(--moss);
    border-left: 4px solid var(--moss);
}

.alert-error {
    background: var(--wine-bg);
    color: var(--wine);
    border-left: 4px solid var(--wine);
}

.alert-success::before,
.alert-error::before {
    border-radius: 50%;
}

.alert-success::before {
    background: var(--moss);
}

.alert-error::before {
    background: var(--wine);
}

.table-container {
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid var(--line);
    background: var(--sheet);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table thead {
    background: var(--page);
}

table th {
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}

table th:first-child,
table th:last-child,
table tbody tr:last-child td:first-child,
table tbody tr:last-child td:last-child {
    border-radius: 0;
}

table td {
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}

table tbody tr:hover {
    background: #F8FBFA;
    transform: none;
    box-shadow: none;
}

.badge,
.badge-role,
.badge-dept,
.badge-count,
.badge-event,
.badge-draft,
.badge-scales {
    border-radius: 999px;
    background: var(--page);
    color: var(--ink);
    border: 0;
}

.badge-active {
    background: var(--moss-bg);
    color: var(--moss);
    border: 0;
}

.badge-inactive {
    background: var(--wine-bg);
    color: var(--wine);
    border: 0;
}

.badge-published {
    background: var(--sage-soft);
    color: var(--sage-deep);
    border: 0;
    border-radius: 999px;
}

.badge::before,
.badge-active::before,
.badge-inactive::before {
    border-radius: 50%;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--sheet);
    color: var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 20px 22px;
}

.stat-card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.stat-card .icon {
    display: none;
}

.stat-card .value {
    color: var(--sage);
    font-size: 40px;
    line-height: 1;
}

.stat-card .label,
.stat-card h3 {
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.reading-tip-card {
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.reading-tip-card img {
    border-radius: 8px;
    box-shadow: none;
}

.modal {
    background: rgba(31, 42, 48, 0.35);
}

.modal-content {
    background: var(--sheet);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.modal-header {
    background: none;
    border-bottom: 1px solid var(--line);
}

.modal-header h3 {
    font-family: var(--font-display);
}

.modal-close {
    background: var(--page);
    color: var(--ink);
    border-radius: 8px;
}

.modal-close:hover {
    transform: none;
    background: var(--wine-bg);
    color: var(--wine);
}

.add-person-link {
    color: var(--sage);
}

.add-person-link:hover {
    color: var(--sage-deep);
    gap: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
    background: #C5D1CC;
    border-radius: 999px;
}

@media (max-width: 768px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 28px;
    }
}

/* Sistema: menu lateral + área de trabalho */
body.app {
    display: block;
    margin: 0;
    padding: 0 0 0 248px;
    min-height: 100vh;
    background: var(--page);
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 248px;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 18px 12px 24px;
    overflow: auto;
    z-index: 30;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    padding: 4px 8px 16px;
}

.side-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--sage);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 18px;
}

.side-brand strong,
.side-brand small {
    display: block;
}

.side-brand strong {
    font-size: 15px;
    line-height: 1.1;
}

.side-brand small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-label {
    margin: 14px 8px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8A969C;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.side-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.side-link:hover {
    background: var(--page);
}

.side-link.is-active {
    background: var(--sage-soft);
    color: var(--sage-deep);
}

.app-main,
body.app .container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 32px 56px;
}

.app-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.app-kicker {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--sage);
}

.app-top h1 {
    margin: 0;
    font-size: 32px;
    background: none;
    -webkit-text-fill-color: var(--ink);
    color: var(--ink);
}

.app-top-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.dash-stats .stat-card {
    text-decoration: none;
    display: block;
}

.dash-stats .stat-card:hover {
    border-color: #C9DDD6;
}

.dash-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dash-panel-head {
    padding: 16px 18px 0;
}

.dash-panel-head h2 {
    margin: 0;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
}

.dash-links {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.dash-links a {
    display: block;
    padding: 16px 18px;
    text-decoration: none;
    color: var(--ink);
    border-top: 1px solid var(--line);
}

.dash-links a span,
.dash-links a small {
    display: block;
}

.dash-links a span {
    font-weight: 700;
    font-size: 15px;
}

.dash-links a small {
    color: var(--muted);
    margin-top: 2px;
    font-size: 13px;
}

.dash-links a:hover {
    background: #F8FBFA;
}

.side-toggle {
    display: none;
}

.side-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.side-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 42, 48, 0.35);
    z-index: 40;
}

.side-backdrop[hidden] {
    display: none;
}

@media screen and (max-width: 900px) {
    body.app {
        padding-left: 0;
    }

    body.app.bulletin {
        padding: 0 0 56px;
    }

    body.app.bulletin .issue {
        margin: 12px 12px 0;
    }

    .side-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 55;
        width: 100%;
        margin: 0;
        padding: 14px 16px;
        border: 0;
        border-bottom: 1px solid var(--line);
        background: #fff;
        color: var(--ink);
        font-family: var(--font-body);
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
    }

    .app-sidebar {
        top: 52px;
        width: min(280px, 88vw);
        height: auto;
        transform: translateX(-105%);
        transition: transform 160ms ease;
        z-index: 50;
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open .app-sidebar {
        transform: none;
    }

    .side-link {
        padding: 12px 10px;
    }

    .dash-stats,
    .dash-links {
        grid-template-columns: 1fr 1fr;
    }

    .app-top {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Home legado */
body.home {
    display: block;
    background: var(--page);
    padding: 48px 20px 72px;
    min-height: 100vh;
}

.home .container {
    max-width: 880px;
}

.home .card {
    padding: 0;
    margin: 0 auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    max-width: 880px;
    text-align: left;
}

.home .logo {
    display: none;
}

.home .masthead {
    background: transparent;
    color: var(--ink);
    padding: 12px 8px 28px;
}

.home .masthead::before {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    background: var(--sage);
    border-radius: 999px;
    margin-bottom: 18px;
}

.home .kicker {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--sage);
    margin-bottom: 8px;
}

.home h1 {
    background: none;
    -webkit-text-fill-color: var(--ink);
    color: var(--ink);
    font-size: clamp(40px, 6vw, 60px);
    line-height: 1.05;
    margin: 0 0 10px;
    font-weight: 500;
}

.home .subtitle {
    color: var(--muted);
    font-size: 17px;
    margin: 0;
    max-width: 34em;
}

.home .menu {
    counter-reset: item;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
    margin: 0;
    padding: 8px 28px 12px;
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.home .menu-item {
    counter-increment: item;
    background: transparent;
    color: var(--ink);
    border-radius: 0;
    box-shadow: none;
    padding: 18px 4px;
    border-bottom: 1px solid var(--line);
}

.home .menu-item::before {
    display: none;
}

.home .menu-item .icon {
    display: none;
}

.home .menu-item h3 {
    font-family: var(--font-body);
    font-size: 16px;
    letter-spacing: 0;
    font-weight: 650;
}

.home .menu-item h3::before {
    content: counter(item, decimal-leading-zero);
    font-family: var(--font-display);
    color: var(--sage);
    margin-right: 10px;
    font-weight: 500;
}

.home .menu-item p {
    color: var(--muted);
    padding-left: 32px;
}

.home .menu-item:hover {
    transform: none;
    background: transparent;
    color: var(--sage-deep);
    box-shadow: none;
}

.home .menu-item:hover p {
    color: var(--muted);
}

.home .menu-item.coming-soon,
.home .menu-item.coming-soon:hover {
    background: transparent;
    color: var(--muted);
    opacity: 1;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.home .coming-soon-badge {
    border-radius: 999px;
    background: var(--page);
    color: var(--muted);
    letter-spacing: 0.06em;
    border: 0;
    padding: 3px 8px;
}

.home .version {
    padding: 18px 8px 0;
    color: var(--muted);
    margin: 0;
}

@media (max-width: 720px) {
    .home .menu {
        grid-template-columns: 1fr;
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Escalas mensais */
.scale-admin {
    background: var(--page) !important;
    color: var(--ink) !important;
    font-family: var(--font-body) !important;
}

.scale-admin h1,
.scale-admin h2,
.scale-admin h3 {
    font-family: var(--font-display) !important;
    letter-spacing: -0.02em;
}

.scale-admin .bg-white,
.scale-admin .month-band {
    background: var(--sheet) !important;
    background-image: none !important;
    color: var(--ink) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    border: 1px solid var(--line) !important;
}

.scale-admin .month-band h2,
.scale-admin .month-band p {
    color: var(--ink) !important;
}

.scale-admin .month-band p {
    color: var(--sage) !important;
}

.scale-admin [class*="rounded"] {
    border-radius: 12px !important;
}

.scale-admin [class*="from-purple-600"],
.scale-admin [class*="to-blue-600"],
.scale-admin [class*="bg-purple-600"],
.scale-admin [class*="from-pink-500"],
.scale-admin [class*="to-purple-500"],
.scale-admin [class*="from-pink-600"] {
    background: var(--sage) !important;
    background-image: none !important;
    color: #fff !important;
    box-shadow: none !important;
}

.scale-admin .month-band[class*="from-purple-600"] {
    background: var(--sheet) !important;
    color: var(--ink) !important;
}

.scale-admin [class*="from-purple-50"],
.scale-admin [class*="from-blue-50"],
.scale-admin [class*="from-pink-50"],
.scale-admin [class*="from-orange-50"],
.scale-admin [class*="from-green"],
.scale-admin [class*="to-cyan"],
.scale-admin [class*="to-yellow"],
.scale-admin [class*="to-purple-50"] {
    background: var(--page) !important;
    background-image: none !important;
    border-color: var(--line) !important;
    color: inherit !important;
}

.scale-admin [class*="text-purple"],
.scale-admin [class*="text-pink"],
.scale-admin [class*="text-blue-800"],
.scale-admin [class*="text-orange"] {
    color: var(--sage) !important;
}

.scale-admin .bg-pink-100 {
    background: var(--sage-soft) !important;
    color: var(--sage-deep) !important;
    border: 0 !important;
}

.scale-admin .bg-gray-200 {
    background: var(--sheet) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
}

.scale-admin .day-card {
    border-width: 1px !important;
    border-color: var(--line) !important;
    box-shadow: var(--shadow) !important;
    transform: none !important;
    background: var(--sheet) !important;
}

.scale-admin .saturday {
    background: var(--sage-soft) !important;
    background-image: none !important;
    color: var(--ink) !important;
    border-color: #D5E7E1 !important;
}

.scale-admin .saturday .text-gray-800,
.scale-admin .saturday .text-gray-700,
.scale-admin .saturday .text-gray-600,
.scale-admin .saturday h3,
.scale-admin .saturday label {
    color: var(--ink) !important;
}

.scale-admin .sunday,
.scale-admin .wednesday {
    background: var(--sheet) !important;
    background-image: none !important;
}

.scale-admin .sunday [class*="bg-green"],
.scale-admin .wednesday [class*="bg-yellow"],
.scale-admin .saturday [class*="bg-gray"] {
    background: var(--sage) !important;
    background-image: none !important;
    color: #fff !important;
}

.scale-admin select,
.scale-admin input,
.scale-admin textarea {
    border-radius: 10px !important;
    border: 1px solid var(--line) !important;
    background: #fff !important;
    color: var(--ink) !important;
    font-family: var(--font-body) !important;
    box-shadow: none !important;
}

.scale-admin a {
    color: var(--sage);
}

/* Boletim público */
body.bulletin {
    background: var(--page);
    margin: 0;
    padding: 32px 16px 72px;
    color: var(--ink);
}

body.app.bulletin {
    padding: 24px 20px 72px 268px;
}

.bulletin .tools {
    position: static;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px 0;
}

.bulletin .month-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.bulletin .month-pick label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.bulletin .month-pick select {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--sheet);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
}

.bulletin .tools a,
.bulletin .tools button {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--sheet);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.bulletin .tools a {
    background: var(--sage);
    border-color: var(--sage);
    color: #fff;
}

.bulletin .issue {
    max-width: 820px;
    margin: 0 auto;
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.bulletin .poster {
    background: var(--sheet);
    color: var(--ink);
    padding: 8px 48px 12px;
}

.bulletin .poster-kicker,
.bulletin .poster-place,
.bulletin .poster-mark {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
}

.bulletin .poster-kicker {
    color: var(--sage);
}

.bulletin .poster-place {
    color: var(--muted);
    margin-top: 2px;
}

.bulletin .poster h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 22px 0 0;
    text-transform: none;
    color: var(--ink);
}

.bulletin .poster-year {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.4;
    margin: 6px 0 0;
    font-weight: 600;
    color: var(--muted);
}

.bulletin .poster-rule {
    width: 48px;
    height: 3px;
    background: var(--sage);
    margin: 22px 0 16px;
    border: 0;
    border-radius: 999px;
}

.bulletin .poster-mark {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
}

.bulletin .poster-range {
    margin: 4px 0 0;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.bulletin .facts {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin: 8px 48px 28px;
    padding: 16px 18px;
    background: var(--page);
    border-radius: 14px;
    border-bottom: 0;
}

.bulletin .facts h2,
.bulletin .sheet h2 .idx {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage);
    margin: 0 0 6px;
}

.bulletin .facts p {
    margin: 0;
    font-size: 15px;
    color: var(--ink);
}

.bulletin .facts strong {
    font-weight: 650;
}

.bulletin .sheet section {
    padding: 8px 48px 36px;
    border-top: 1px solid var(--line);
}

.bulletin .sheet h2 {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.15;
    font-weight: 500;
    margin: 28px 0 18px;
    letter-spacing: -0.02em;
}

.bulletin .sheet h2 .idx {
    display: inline;
    margin: 0 8px 0 0;
}

.bulletin .pastoral-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 24px;
    margin: 0 0 12px;
}

.bulletin .pastoral-body {
    font-size: 17px;
    line-height: 1.7;
    color: #314047;
}

.bulletin .pastoral-body p {
    margin: 0 0 1em;
}

.bulletin .byline {
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-family: var(--font-display);
    font-style: italic;
    text-align: right;
    color: var(--muted);
}

.bulletin .scale-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bulletin .scale-row {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.bulletin .scale-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.bulletin .scale-date .num {
    display: block;
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.bulletin .scale-date .dow {
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.bulletin .role {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px;
    align-items: baseline;
    margin: 0 0 6px;
}

.bulletin .role span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.bulletin .role strong {
    font-weight: 650;
    color: var(--ink);
}

.bulletin .is-sabbath {
    background: var(--sage-soft);
    color: var(--ink);
    padding: 14px 14px;
    margin: 8px 0;
    border-top: 0;
    border-radius: 12px;
}

.bulletin .is-sabbath .scale-date .dow,
.bulletin .is-sabbath .role span {
    color: var(--sage-deep);
}

.bulletin .subblock {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #D5E7E1;
}

.bulletin .subblock h3 {
    margin: 0 0 4px;
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage-deep);
}

.bulletin .birthdays,
.bulletin .events,
.bulletin .ministries,
.bulletin .tips {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bulletin .birthdays {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.bulletin .birthdays li {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--page);
}

.bulletin .birthdays .num {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--sage);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.bulletin .tip {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.bulletin .tip img,
.bulletin .tip .cover-fallback {
    width: 96px;
    height: 136px;
    object-fit: cover;
    background: var(--sage-soft);
    color: var(--sage-deep);
    display: flex;
    align-items: flex-end;
    padding: 10px;
    font-family: var(--font-display);
    font-size: 22px;
    border-radius: 8px;
}

.bulletin .tip h3,
.bulletin .event h3,
.bulletin .ministries h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.bulletin .series {
    color: var(--sage);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.bulletin .events {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bulletin .event img,
.bulletin .event .cover-fallback {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--sage-soft);
    margin-bottom: 10px;
    border-radius: 12px;
}

.bulletin .when {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-transform: none;
    margin-bottom: 6px;
    color: var(--sage);
}

.bulletin .ministries {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bulletin .ministries article {
    border: 1px solid var(--line);
    border-top: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--page);
}

.bulletin .ministries .leader,
.bulletin .ministries .when {
    font-weight: 650;
}

.bulletin .ministries .moto {
    color: var(--muted);
    font-family: var(--font-display);
    font-style: italic;
    white-space: pre-line;
}

.bulletin .colophon {
    padding: 22px 48px 32px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--muted);
}

.bulletin .colophon strong {
    display: block;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

@media screen and (max-width: 720px) {
    .bulletin .poster,
    .bulletin .facts,
    .bulletin .sheet section,
    .bulletin .colophon {
        padding-left: 20px;
        padding-right: 20px;
    }

    .bulletin .facts,
    .bulletin .events,
    .bulletin .ministries,
    .bulletin .tip,
    .bulletin .scale-row {
        grid-template-columns: 1fr;
    }

    .bulletin .facts {
        margin-left: 20px;
        margin-right: 20px;
    }

    .bulletin .role {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bulletin .tools {
        flex-wrap: wrap;
        justify-content: stretch;
        padding-left: 16px;
        padding-right: 16px;
    }

    .bulletin .tools a,
    .bulletin .tools button {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .bulletin .month-pick {
        width: 100%;
        margin-right: 0;
    }

    .bulletin .month-pick label {
        flex: 1;
    }

    .bulletin .month-pick select {
        width: 100%;
        min-width: 0;
    }

    .bulletin .month-pick button {
        flex: 0 0 auto;
    }
}

@page {
    size: auto;
    margin: 0;
}

@media print {
    body.bulletin,
    body.bulletin * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.bulletin {
        background: var(--sheet);
        margin: 0;
        padding: 0;
    }

    .bulletin .tools {
        display: none !important;
    }

    .bulletin .issue {
        max-width: none;
        margin: 0;
        padding: 14mm 12mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .bulletin .scale-row,
    .bulletin .birthdays li,
    .bulletin .tip,
    .bulletin .event,
    .bulletin .ministries article {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .side-toggle,
    .app-sidebar,
    .side-backdrop {
        display: none !important;
    }

    body.app,
    body.app.bulletin {
        padding: 0 !important;
    }
}

/* Telas estreitas: vale para o que já existe e para telas novas que usem as mesmas classes. */
img,
video,
canvas,
iframe {
    max-width: 100%;
}

.tox-tinymce {
    max-width: 100% !important;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

@media screen and (max-width: 768px) {
    :root {
        font-size: 16px;
    }
}

@media screen and (max-width: 720px) {
    body.app .container,
    body.app .app-main {
        padding: 16px 16px 48px;
    }

    .header,
    .card {
        padding: 20px 16px;
    }

    .header h1,
    .app-top h1,
    .card h2 {
        font-size: 26px;
        overflow-wrap: anywhere;
    }

    .form-row,
    .filters,
    .stats,
    .dash-stats,
    .dash-links,
    .church-form .form-row {
        grid-template-columns: 1fr !important;
    }

    .btn-group,
    .actions,
    .reading-tip-card,
    .reading-tip-actions,
    .app-top-actions,
    .scale-admin .flex,
    form[style*="display: flex"],
    div[style*="display: flex"] {
        flex-wrap: wrap !important;
    }

    .reading-tip-card {
        flex-direction: column;
    }

    .modal-content {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        margin: 12px;
        overflow: auto;
    }

    .scale-admin .container {
        padding: 12px !important;
    }

    .scale-admin .p-8,
    .scale-admin .px-12 {
        padding: 16px !important;
    }

    .scale-admin h1,
    .scale-admin .text-4xl {
        font-size: 1.7rem !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media screen and (max-width: 900px) {
    .church-page .container {
        padding: 16px 16px 48px;
    }

    .church-page .header,
    .church-page .card {
        padding: 18px 16px;
    }

    .church-page .header h1 {
        font-size: 28px;
    }

    .church-form .form-row {
        grid-template-columns: 1fr;
    }

    .church-form .btn {
        width: 100%;
    }
}

.ui-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: -4px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--sage);
    flex: 0 0 auto;
}

h1 .ui-icon,
h2 .ui-icon,
h3 .ui-icon,
h4 .ui-icon {
    width: 22px;
    height: 22px;
    vertical-align: -4px;
}

.btn .ui-icon,
.bulletin-preview-link .ui-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: currentColor;
    vertical-align: -3px;
}

.ui-icon-lg {
    display: block;
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
}

.scale-admin h3 .ui-icon,
.scale-admin label .ui-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.header h1::before,
.card h2::before {
    content: none !important;
}

.app-home .app-top h1 {
    font-size: clamp(40px, 5vw, 56px);
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.app-lead {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 16px;
}

.app-home .app-top-actions .btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 12px 16px;
}

.dash-board {
    display: grid;
    grid-template-columns: 1.45fr 0.85fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.dash-panel-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 12px;
}

.dash-panel-row a {
    color: var(--sage);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.dash-culto {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
}

.dash-culto:hover {
    background: #F8FBFA;
}

.dash-culto.is-sabbath {
    background: var(--sage-soft);
}

.dash-culto.is-sabbath:hover {
    background: #DCECE7;
}

.dash-day {
    display: block;
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dash-dow {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dash-culto p {
    margin: 0 0 4px;
    font-weight: 650;
}

.dash-culto p span {
    display: inline-block;
    width: 72px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.dash-check {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
}

.dash-check:hover {
    background: #F8FBFA;
}

.dash-check > div {
    min-width: 0;
}

.dash-check strong,
.dash-check small {
    display: block;
}

.dash-check small {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.dash-status {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--sage-deep);
}

.dash-status.is-missing {
    color: var(--wine);
}

.dash-empty {
    margin: 0;
    padding: 16px 18px 18px;
    color: var(--muted);
}

.dash-birth-panel {
    margin-bottom: 16px;
}

.dash-births {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    padding: 4px 18px 18px;
}

.dash-births div {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--page);
}

.dash-births span {
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1;
    color: var(--sage);
    font-variant-numeric: tabular-nums;
}

.dash-births strong {
    font-weight: 650;
}

@media screen and (max-width: 900px) {
    .dash-board {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 720px) {
    .app-home .dash-stats {
        grid-template-columns: 1fr 1fr !important;
    }

    .dash-culto,
    .dash-check {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.side-foot {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.side-foot small {
    display: block;
    padding: 0 12px 6px;
    color: var(--muted);
    font-size: 12px;
}

body.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 24px 16px 48px;
}

.login-card {
    width: min(440px, 100%);
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 28px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: clamp(36px, 6vw, 44px);
    background: none;
    -webkit-text-fill-color: var(--ink);
}

.login-lead {
    margin: 0 0 22px;
    color: var(--muted);
}

.login-card .form-group {
    margin-bottom: 14px;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
}

.login-card input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
}

.login-card .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    padding: 12px 16px;
    cursor: pointer;
}

.login-card .alert {
    margin: 0 0 16px;
    padding: 12px 14px;
}

.login-switch {
    margin: 18px 0 0;
    text-align: center;
}

.login-switch a {
    color: var(--sage-deep);
    font-weight: 700;
    text-decoration: none;
}

@media screen and (max-width: 720px) {
    .login-card {
        padding: 24px 16px;
    }
}
