body {
font-family: Arial, sans-serif;
margin: 40px;
color: #222;
background: #fafafa;
}

[hidden] {
display: none !important;
}

.admin-only,
.requires-write,
.requires-write-disable {
visibility: hidden;
}

body.permissions-ready .admin-only,
body.permissions-ready .requires-write,
body.permissions-ready .requires-write-disable {
visibility: visible;
}

input,
button {
font: inherit;
}

button:not(:disabled) {
cursor: pointer;
}

h1,
h2,
h3,
p {
margin-top: 0;
}

nav,
.header-nav {
display: flex;
gap: 12px;
flex-wrap: wrap;
margin-bottom: 20px;
}

.app-nav {
display: flex;
justify-content: space-between;
align-items: center;
gap: 16px;
padding: 16px 18px;
margin-bottom: 20px;
border: 1px solid #d9e2f2;
border-radius: 14px;
background: #ffffff;
}

.app-nav-title {
font-size: 14px;
font-weight: 700;
color: #5b6b85;
text-transform: uppercase;
letter-spacing: 0.05em;
white-space: nowrap;
}

table {
border-collapse: collapse;
width: 100%;
background: #fff;
}

th,
td {
border: 1px solid #ccc;
padding: 8px;
text-align: left;
}

th {
background: #eee;
}

a {
text-decoration: none;
color: #0057b8;
}

.hero {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 24px;
padding: 24px;
margin-bottom: 24px;
border-radius: 16px;
background: linear-gradient(135deg, #f5f7fb 0%, #e7eefc 100%);
border: 1px solid #d9e2f2;
}

.session-bar {
display: flex;
justify-content: flex-end;
margin-bottom: 12px;
}

.session-meta {
display: flex;
align-items: center;
gap: 10px;
background: rgba(255, 255, 255, 0.9);
padding: 8px 10px;
border: 1px solid #dbe3ef;
border-radius: 999px;
}

.hero-copy {
max-width: 640px;
color: #4b5563;
margin-bottom: 0;
}

.hero-nav {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: flex-end;
}

.hero-nav a {
padding: 10px 12px;
background: rgba(255, 255, 255, 0.85);
border: 1px solid #cfd9ec;
border-radius: 999px;
}

.app-nav a,
.header-nav a {
padding: 10px 12px;
background: rgba(255, 255, 255, 0.92);
border: 1px solid #cfd9ec;
border-radius: 999px;
}

.top-spaced {
margin-top: 26px;
}

.app-nav a.active,
.hero-nav a.active,
.header-nav a.active {
background: #dbeafe;
border-color: #93c5fd;
color: #1d4ed8;
font-weight: 700;
}

.eyebrow {
text-transform: uppercase;
letter-spacing: 0.08em;
font-size: 12px;
font-weight: 700;
color: #5b6b85;
margin-bottom: 8px;
}

.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 16px;
margin-bottom: 24px;
}

.stat-card {
display: flex;
flex-direction: column;
gap: 6px;
padding: 18px;
background: #ffffff;
border: 1px solid #dde4ef;
border-radius: 14px;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.stat-label {
font-size: 13px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.04em;
color: #64748b;
margin-bottom: 0;
}

.stat-value {
font-size: 32px;
line-height: 1;
}

.stat-note {
font-size: 13px;
color: #64748b;
}

.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 16px;
margin-bottom: 16px;
}

.padrinho-docs-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
gap: 16px;
}

.padrinho-doc-card {
padding: 16px;
border: 1px solid #d7d7d7;
border-radius: 8px;
background: #fcfcfc;
}

.wrap {
max-width: 960px;
}

.card {
background: #fff;
border: 1px solid #d7d7d7;
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
}

.entity-form {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 14px;
}

#anexoForm {
margin-bottom: 16px;
}

#padrinhoForm {
margin-bottom: 16px;
}

.entity-form label {
display: flex;
flex-direction: column;
gap: 6px;
font-weight: 700;
}

.form-file {
grid-column: 1 / -1;
}

.entity-form input,
.entity-form select {
padding: 10px 12px;
border: 1px solid #cbd5e1;
border-radius: 8px;
background: #fff;
font-size: 16px;
font-weight: 400;
}

.combo-shell {
position: relative;
display: flex;
align-items: stretch;
min-width: 0;
}

.combo-shell input {
width: 100%;
padding-right: 42px;
}

.combo-trigger {
position: absolute;
top: 1px;
right: 1px;
bottom: 1px;
width: 38px;
border: 0;
border-left: 1px solid #cbd5e1;
border-radius: 0 8px 8px 0;
background: #f8fafc;
display: flex;
align-items: center;
justify-content: center;
}

.combo-trigger-icon {
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 7px solid #475569;
}

.combo-dropdown {
position: absolute;
top: calc(100% + 4px);
left: 0;
right: 0;
z-index: 30;
display: flex;
flex-direction: column;
max-height: 220px;
overflow-y: auto;
padding: 4px;
border: 1px solid #cbd5e1;
border-radius: 10px;
background: #fff;
box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.combo-option,
.combo-empty {
padding: 10px 12px;
border: 0;
border-radius: 8px;
background: transparent;
text-align: left;
}

.combo-option.active,
.combo-option:hover {
background: #e8f0ff;
}

.combo-empty {
color: #64748b;
}

.filters-row input,
.filters-row select {
font-size: 16px;
font-weight: 400;
}

.entity-form input[type="file"] {
padding: 8px;
line-height: 1.2;
}

.checkbox-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 8px;
grid-column: 1 / -1;
}

.checkbox-field {
flex-direction: row !important;
align-items: center;
font-weight: 400 !important;
}

.form-actions {
grid-column: 1 / -1;
display: flex;
gap: 8px;
justify-content: flex-start;
}

.filters-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
}

.compact-filters {
margin-bottom: 16px;
}

.toolbar {
display: flex;
justify-content: space-between;
align-items: flex-end;
gap: 12px;
flex-wrap: wrap;
margin-bottom: 16px;
}

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

.filters-row label {
display: flex;
flex-direction: column;
gap: 6px;
font-weight: 700;
}

.filters-row input,
.filters-row select {
padding: 10px 12px;
border: 1px solid #cbd5e1;
border-radius: 8px;
background: #fff;
}

.actions-cell {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}

.link-button {
padding: 0;
border: 0;
background: transparent;
color: #15803d;
cursor: pointer;
}

.link-button.danger {
color: #b42318;
}

.link-button.accent {
color: #9a6700;
}

.main-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 16px;
margin-bottom: 24px;
}

.header-left {
display: flex;
gap: 16px;
align-items: center;
}

.paroquia-logo-placeholder {
display: flex;
align-items: center;
justify-content: center;
min-width: 110px;
min-height: 72px;
padding: 8px;
border: 1px dashed #b8b8b8;
border-radius: 8px;
background: #fff;
}

.paroquia-nome-row {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 4px;
}

.sectionTitle {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
margin-bottom: 12px;
}

.muted,
.sistema-nome,
.small {
color: #555;
}

.row {
display: flex;
gap: 8px;
align-items: center;
margin-top: 8px;
}

.secondary {
padding: 8px 12px;
border: 1px solid #b9c3d0;
background: #f1f5f9;
border-radius: 6px;
}

.tiny {
padding: 4px 8px;
font-size: 12px;
}

.status {
margin-top: 12px;
padding: 10px 12px;
border-radius: 6px;
background: #eef2ff;
}

.status.warn {
background: #fff7db;
color: #6e5600;
}

.status.ok {
background: #dcfce7;
color: #166534;
}

.status.err {
background: #fee2e2;
color: #991b1b;
}

.pending-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 24px;
height: 24px;
padding: 0 8px;
border-radius: 999px;
font-size: 13px;
font-weight: 700;
}

.pending-indicator.ok {
background: #dcfce7;
color: #166534;
}

.pending-indicator.warn {
background: #fff7db;
color: #6e5600;
}

.login-body {
min-height: 100vh;
margin: 0;
display: grid;
place-items: center;
background: linear-gradient(180deg, #edf3ff 0%, #f8fafc 100%);
}

.login-shell {
width: 100%;
max-width: 460px;
padding: 24px;
}

.login-card {
background: #fff;
border: 1px solid #d7dfea;
border-radius: 16px;
padding: 24px;
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.login-form {
display: flex;
flex-direction: column;
gap: 14px;
margin-top: 18px;
}

.login-form label {
display: flex;
flex-direction: column;
gap: 6px;
font-weight: 700;
}

.login-form input {
padding: 10px 12px;
border: 1px solid #cbd5e1;
border-radius: 8px;
background: #fff;
}

button:disabled,
input:disabled {
opacity: 0.6;
cursor: not-allowed;
}

@media (max-width: 800px) {
body {
margin: 20px;
}

.hero,
.main-header,
.app-nav {
flex-direction: column;
}

.hero-nav,
.header-nav,
.app-nav nav {
justify-content: flex-start;
}

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