* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5eee7;
    color: #2f1b10;
}

a {
    color: #7a4b2f;
}

.site-header,
header {
    background: #7a4b2f;
    color: #fff;
    padding: 18px 20px;
}

.site-header h1,
header h1 {
    margin: 0 0 14px 0;
    font-size: 22px;
    color: #fff;
}

.site-header nav,
header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.site-header a,
header a,
nav a {
    display: inline-block;
    background: rgba(255,255,255,0.16);
    color: #fff !important;
    text-decoration: none;
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: bold;
}

.site-header a:hover,
header a:hover,
nav a:hover {
    background: rgba(255,255,255,0.28);
}

main {
    padding: 24px;
}

footer {
    padding: 18px 24px;
    color: #2f1b10;
}

h1, h2, h3 {
    color: #3a2114;
}

.btn,
button,
input[type="submit"] {
    display: inline-block;
    background: #8a5636;
    color: #fff !important;
    border: 0;
    border-radius: 7px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: #6f4229;
}

.btn-danger {
    background: #c0392b !important;
}

.btn-danger:hover {
    background: #962d22 !important;
}

input,
textarea,
select {
    border: 1px solid #c9b4a2;
    border-radius: 6px;
    padding: 8px;
    font-family: Arial, sans-serif;
}

textarea {
    width: 100%;
}

.card,
.panel,
.dashboard-card {
    background: #fffaf5;
    border: 1px solid #dcc6b3;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

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

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

th {
    background: #ead9cc;
}

.profile-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.12);
}

.profile-shortcut:hover,
.profile-shortcut.active {
    background: rgba(255, 255, 255, 0.22);
}

.profile-shortcut-icon {
    font-size: 1.2rem;
}

.profile-shortcut-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-shortcut-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    align-items: flex-start;
}

.profile-avatar-block {
    display: flex;
    justify-content: center;
}

.profile-avatar,
.profile-avatar-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
}

.profile-avatar {
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: #f1f1f1;
}

.profile-form {
    width: 100%;
}

.family-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.family-actions a {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #8a5638;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.family-actions a:hover {
    background: #6f4229;
}

.family-actions .danger-link {
    background: #b23b3b !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.family-actions .danger-link:hover {
    background: #8f2d2d !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.family-hero {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: flex-start;
}

.family-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(90px, 1fr));
    gap: 0.75rem;
    min-width: 220px;
}

.family-hero-stats div {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(138, 86, 56, 0.08);
    text-align: center;
}

.family-hero-stats strong {
    display: block;
    font-size: 1.6rem;
}

.family-hero-stats span {
    font-size: 0.85rem;
    opacity: 0.8;
}

.family-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.family-member-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.family-member-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.family-member-avatar,
.family-member-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.family-member-avatar {
    object-fit: cover;
}

.family-member-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1e7dc;
    font-size: 1.8rem;
}

.forum-topic-card h2 a {
    color: inherit;
    text-decoration: none;
}

.forum-topic-card h2 a:hover {
    text-decoration: underline;
}

.forum-message-content {
    margin-top: 1rem;
    line-height: 1.65;
}

.forum-reply-card {
    margin-top: 1rem;
}

/*
|--------------------------------------------------------------------------
| Pages admin familles / events
|--------------------------------------------------------------------------
*/

.page-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

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

.dashboard-number {
    font-size: 2rem;
    font-weight: bold;
    margin-top: 0.4rem;
}

.form-card {
    background: #fffaf5;
    border: 1px solid #dcc6b3;
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-group label {
    font-weight: bold;
    color: #5a3420;
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    min-width: 900px;
}

.inline-admin-form {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.inline-admin-form + .inline-admin-form {
    margin-left: 0.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #e9d7ca;
    color: #4d2f20;
    font-size: 0.78rem;
    font-weight: bold;
}

.badge-admin {
    background: #2e7d32;
    color: #fff;
}

.badge-guest {
    background: #757575;
    color: #fff;
}

.alert {
    padding: 1rem;
    border-radius: 10px;
    font-weight: bold;
}

.alert-success {
    background: #dff4df;
    color: #246b24;
    border: 1px solid #98cf98;
}

.alert-error {
    background: #ffe2e2;
    color: #9b2222;
    border: 1px solid #d99;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    border: 2px dashed #d5bca8;
    border-radius: 12px;
    background: rgba(255,255,255,0.45);
    color: #6f4229;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.content-card {
    background: #fffaf5;
    border: 1px solid #dcc6b3;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-card h2 {
    margin: 0;
}

.content-card h2 a {
    color: inherit;
    text-decoration: none;
}

.content-card h2 a:hover {
    text-decoration: underline;
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.92rem;
}

.card-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #d9c0ad !important;
    color: #4b2c1d !important;
}

.btn-secondary:hover {
    background: #caa78f !important;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

.muted {
    opacity: 0.6;
}

hr {
    border: 0;
    border-top: 1px solid #dcc6b3;
    margin: 2rem 0;
}

.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: none;
    background: #c0392b;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.button-danger:hover {
    background: #a93226;
    transform: translateY(-1px);
}

.button-danger:active {
    transform: translateY(0);
}

/*
|--------------------------------------------------------------------------
| Boutons actions utilisateurs
|--------------------------------------------------------------------------
*/

.user-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.user-card-actions .button,
.user-card-actions .button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: 700;
    transition: all 0.2s ease;
}

.user-card-actions .button {
    background: #8a5636;
    color: #ffffff !important;
}

.user-card-actions .button:hover {
    background: #6f4229;
}

.user-card-actions .button-danger {
    background: #c0392b;
    color: #ffffff !important;
}

.user-card-actions .button-danger:hover {
    background: #a93226;
}

.user-card-actions .button-danger::before {
    content: "🗑️ ";
}

.user-card-actions .button::before {
    content: "✏️ ";
}

.user-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 135px;
    text-decoration: none !important;
}

.user-card-actions .btn-danger {
    background: #c0392b !important;
    color: #ffffff !important;
}

.user-card-actions .btn-danger:hover {
    background: #962d22 !important;
    color: #ffffff !important;
}

.user-card-actions .btn-secondary {
    background: #d9c0ad !important;
    color: #4b2c1d !important;
}

.user-card-actions .btn-secondary:hover {
    background: #caa78f !important;
    color: #4b2c1d !important;
}

/*
|--------------------------------------------------------------------------
| Livre d'Or
|--------------------------------------------------------------------------
*/

.memories-page {
    max-width: 980px;
    margin: 0 auto;
}

.memories-page .page-header {
    background: #fffaf5;
    border: 1px solid #dcc6b3;
    border-radius: 18px;
    padding: 1.4rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.memories-list {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.memory-card {
    background: #fffaf5;
    border: 1px solid #dcc6b3;
    border-radius: 18px;
    padding: 1.4rem;
    box-shadow: 0 5px 18px rgba(0,0,0,0.08);
}

.memory-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.memory-card-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.memory-meta {
    margin: 0;
    color: #7b5c49;
    font-size: 0.9rem;
}

.memory-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.memory-actions a {
    text-decoration: none;
}

.memory-photo img {
    display: block;
    max-width: 100%;
    border-radius: 14px;
    margin: 1rem 0;
}

.memory-content {
    background: #fff;
    border-radius: 14px;
    padding: 1rem;
    line-height: 1.65;
    font-size: 1rem;
    margin: 1rem 0;
}

.memory-reactions,
.memory-comment-reactions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.8rem 0;
}

.reaction-form {
    display: inline-flex;
    margin: 0;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: auto;
    width: auto;
    background: #f3e4d7 !important;
    color: #4d2f20 !important;
    border: 1px solid #d5bca8;
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    line-height: 1;
}

.reaction-btn:hover,
.reaction-btn.is-active {
    background: #8a5636 !important;
    color: #ffffff !important;
}

.reaction-btn-small {
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
}

.memory-reaction-names,
.memory-comment-reaction-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6f4a35;
    margin-bottom: 1rem;
}

.memory-reaction-names div,
.memory-comment-reaction-names div {
    background: #f7eadf;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
}

.memory-comments {
    border-top: 1px solid #e2cdbb;
    padding-top: 1rem;
    margin-top: 1rem;
}

.memory-comments h3 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.memory-comment-item {
    background: #f8efe8;
    border: 1px solid #e0c9b6;
    border-radius: 14px;
    padding: 0.9rem;
    margin-bottom: 0.8rem;
}

.memory-comment-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    color: #7b5c49;
    font-size: 0.88rem;
}

.memory-comment-meta strong {
    color: #3a2114;
}

.memory-comment-item p {
    margin: 0.5rem 0;
    line-height: 1.55;
}

.memory-comment-empty {
    color: #7b5c49;
    font-style: italic;
}

.comment-form {
    margin-top: 1rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    border-radius: 14px;
    resize: vertical;
    background: #fff;
}

.comment-form button {
    margin-top: 0.5rem;
}

@media (max-width: 900px) {
    .page-header {
        flex-direction: column;
    }

    .admin-table {
        min-width: 700px;
    }
}

@media (max-width: 800px) {
    .family-hero {
        flex-direction: column;
    }

    .family-hero-stats {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .profile-card {
        grid-template-columns: 1fr;
    }

    .profile-shortcut-name {
        display: none;
    }

    .memories-page {
        max-width: 100%;
    }

    .memory-card-header {
        flex-direction: column;
    }
}
.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: 1px solid #b91c1c;
}

.btn-danger:hover {
    background: #b91c1c;
    color: #ffffff;
}

.btn-danger:focus {
    outline: 2px solid #fecaca;
    outline-offset: 2px;
}
.memory-video {
    margin-top: 14px;
    margin-bottom: 14px;
}

.memory-video video {
    width: 100%;
    max-height: 420px;
    border-radius: 14px;
    background: #000;
}