:root {
    --ink: #2b2b2b;
    --paper: #faf9f7;
    --line: #ddd8d0;
    --muted: #8a8378;
    --accent: #6b7c6e;
    --high: #a8543f;
    --done-bg: #eef1ec;
    --pending-bg: #faf6ec;
    --cancelled-bg: #f4eeee;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 40px;
    width: 320px;
    text-align: center;
}

.login-box h1 {
    font-size: 1.3rem;
    margin: 0 0 4px;
    font-weight: normal;
}

.subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0 0 24px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input, select {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #fff;
    color: var(--ink);
}

.alert {
    padding: 8px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.alert-error {
    background: #f4eeee;
    color: var(--high);
    border: 1px solid #e3cfc9;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 36px 24px 80px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: normal;
    margin: 0 0 4px;
    letter-spacing: 0.2px;
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    padding: 9px 16px;
    border-radius: 3px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { border-color: var(--muted); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover { background: #5b6a5d; }

.btn-secondary {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-ghost {
    border-color: transparent;
    color: var(--muted);
}

.table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.88rem;
}

thead th {
    text-align: left;
    padding: 12px 14px;
    background: #f2f0eb;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--line);
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

.task-cell { font-family: 'Georgia', serif; font-size: 0.95rem; }

.row-done { background: var(--done-bg); }
.row-pending { background: var(--pending-bg); }
.row-cancelled { background: var(--cancelled-bg); opacity: 0.8; }

.row-done .task-cell { text-decoration: line-through; color: var(--muted); }
.row-cancelled .task-cell { text-decoration: line-through; color: var(--muted); }

.badge {
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-high {
    background: #f4e3dd;
    color: var(--high);
}

.badge-normal {
    background: #eceae4;
    color: var(--muted);
}

.status-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
}

.chk {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--muted);
}

.chk input { cursor: pointer; }

.note-cell {
    font-size: 0.82rem;
    color: var(--muted);
    font-style: italic;
    max-width: 220px;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
}

.btn-delete:hover { color: var(--high); }

.empty-row td {
    text-align: center;
    color: var(--muted);
    font-style: italic;
    padding: 30px;
}

.hidden { display: none; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(43, 43, 43, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal {
    background: #fff;
    border-radius: 5px;
    padding: 28px;
    width: 360px;
    max-width: 90vw;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.modal h2 {
    font-family: 'Georgia', serif;
    font-weight: normal;
    font-size: 1.2rem;
    margin: 0 0 18px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-head h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover { color: var(--ink); }

.modal form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.date-cell {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

.actions-cell {
    white-space: nowrap;
}

.btn-edit {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px 6px;
}

.btn-edit:hover { color: var(--accent); }

.modal label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.site-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Página pública (landing) ===== */

.landing-body {
    background: #16233a;
    min-height: 100vh;
    padding: 24px 20px 60px;
}

.landing-container {
    max-width: 680px;
    margin: 0 auto;
}

.landing-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    align-items: center;
}

.tab-btn {
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    padding: 10px 22px;
    background: transparent;
    color: #c9b174;
    border: 1px solid #3a4a66;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
}

.tab-btn.active {
    background: #1e2f4d;
    color: #e8d9a8;
    border-color: #c9b174;
}

.tab-link {
    margin-left: auto;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.78rem;
    color: #7d8aa3;
    text-decoration: none;
    border: 1px solid #3a4a66;
    border-radius: 4px;
    padding: 8px 14px;
}

.tab-link:hover { color: #c9b174; border-color: #c9b174; }

.memorial-card {
    background: linear-gradient(180deg, #1e2f4d 0%, #16233a 100%);
    border: 1px solid #c9b174;
    border-radius: 6px;
    padding: 10px;
}

.memorial-frame {
    border: 1px solid #8a7845;
    border-radius: 4px;
    padding: 36px 28px;
    text-align: center;
}

/* mae.png já é circular com moldura dourada — não aplicar borda extra */
.memorial-photo {
    display: block;
    width: 190px;
    height: auto;
    margin: 0 auto 24px;
}

.memorial-title {
    font-family: 'Georgia', serif;
    font-weight: normal;
    font-size: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #e8d9a8;
    margin: 0 0 18px;
}

.memorial-text {
    color: #e9ecf2;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 18px;
    text-align: justify;
    text-align-last: center;
    hyphens: auto;
}

.memorial-name {
    font-family: 'Georgia', serif;
    font-weight: normal;
    font-size: 1.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #d9bf7f;
    margin: 6px 0 10px;
}

.memorial-dates {
    color: #d9bf7f;
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 0 0 26px;
}

.memorial-quote {
    color: #c9b174;
    font-style: italic;
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 26px 0 0;
}

.program-block {
    border-top: 1px solid #3a4a66;
    padding-top: 20px;
    margin-top: 20px;
}

.program-heading {
    font-family: 'Georgia', serif;
    font-weight: normal;
    font-size: 1.15rem;
    color: #d9bf7f;
    margin: 0 0 8px;
}

.program-tba { font-style: italic; color: #aab4c6; }

.memorial-family {
    border-top: 1px solid #3a4a66;
    margin-top: 26px;
    padding-top: 22px;
}

.memorial-names {
    color: #e9ecf2;
    font-family: 'Georgia', serif;
    font-size: 0.98rem;
    line-height: 1.9;
    text-align: center;
    margin: 0;
}

/* ===== Página de aprovações ===== */

.approval-hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 22px;
}

.approval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.approval-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 18px;
    text-align: center;
}

.approval-card h3 {
    font-weight: normal;
    font-size: 1.05rem;
    margin: 0 0 12px;
}

.approval-card img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.approval-card p {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 12px 0 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

@media (max-width: 640px) {
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .toolbar { flex-wrap: wrap; }
    .memorial-frame { padding: 26px 20px; }
    .memorial-name { font-size: 1.35rem; }
    .memorial-dates { flex-direction: column; gap: 4px; }
    .landing-tabs { flex-wrap: wrap; }
    .tab-link { margin-left: 0; }
}
