:root {
    --bg: #f3ede2;
    --panel: #fffaf2;
    --panel-strong: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --line: #e4d9c7;
    --accent: #d35d47;
    --accent-dark: #a73f32;
    --success: #256f4f;
    --warning: #926a00;
    --shadow: 0 18px 50px rgba(58, 42, 17, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(211, 93, 71, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(37, 111, 79, 0.16), transparent 30%),
        var(--bg);
}

.auth-page-body {
    min-height: 100vh;
}

.auth-page-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-page-card {
    width: min(560px, 100%);
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid rgba(228, 217, 199, 0.7);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-page-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.auth-page-brand p,
.auth-page-copy {
    margin: 6px 0 0;
    color: var(--muted);
}

.auth-page-card h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.auth-status-panel {
    margin-top: 18px;
}

.auth-helper-link-anchor {
    color: var(--accent-dark);
    font-weight: bold;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 290px;
    padding: 28px 20px;
    background: rgba(34, 24, 18, 0.92);
    color: #fff7ef;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand p {
    margin: 4px 0 0;
    color: rgba(255, 247, 239, 0.68);
    font-size: 13px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ef8f5a, #d35d47);
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item,
.ghost-button,
.primary-button,
.post-actions a,
.detail-actions a,
.detail-actions button {
    border: 0;
    border-radius: 16px;
    padding: 13px 16px;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-item {
    text-align: left;
    background: rgba(255, 255, 255, 0.07);
    color: #fff7ef;
}

.nav-item.active,
.nav-item:hover {
    background: rgba(211, 93, 71, 0.92);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.session-box {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
}

.session-box p {
    margin: 6px 0 0;
    color: rgba(255, 247, 239, 0.72);
    font-size: 13px;
}

.ghost-button {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.sidebar .ghost-button {
    color: #fff7ef;
    border-color: rgba(255, 255, 255, 0.18);
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), #ef8f5a);
    color: #fff;
    box-shadow: 0 14px 30px rgba(211, 93, 71, 0.24);
}

.nav-item:hover,
.ghost-button:hover,
.primary-button:hover {
    transform: translateY(-1px);
}

.ghost-button[disabled],
.detail-actions button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.main-panel {
    flex: 1;
    padding: 26px;
}

.topbar,
.panel {
    background: rgba(255, 250, 242, 0.86);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(228, 217, 199, 0.7);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.topbar {
    padding: 24px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topbar h1,
.list-header h2,
.admin-box h2,
.modal-panel h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.topbar p {
    margin: 8px 0 0;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

.panel {
    margin-top: 18px;
    padding: 20px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(37, 111, 79, 0.12);
    color: var(--success);
    font-size: 13px;
    font-weight: bold;
}

.badge.warning {
    background: rgba(146, 106, 0, 0.12);
    color: var(--warning);
}

.badge.error {
    background: rgba(167, 63, 50, 0.14);
    color: var(--accent-dark);
}

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

.compact-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.toolbar input {
    min-width: 0;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--panel-strong);
    color: var(--text);
}

textarea {
    resize: vertical;
}

.chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.tag.is-warning {
    background: rgba(146, 106, 0, 0.12);
    color: var(--warning);
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.pool-promo {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 18px;
    padding: 24px;
    border-radius: 26px;
    border: 1px solid rgba(211, 93, 71, 0.18);
    background:
        radial-gradient(circle at top right, rgba(211, 93, 71, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(255, 248, 239, 0.98), rgba(255, 255, 255, 0.96));
    box-shadow: 0 18px 44px rgba(58, 42, 17, 0.08);
}

.pool-promo-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(211, 93, 71, 0.12);
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: bold;
}

.pool-promo h2 {
    margin: 14px 0 10px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    font-family: Georgia, "Times New Roman", serif;
}

.pool-promo p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.pool-promo-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.pool-promo-points span {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(228, 217, 199, 0.95);
    font-size: 14px;
}

.pool-promo-contact {
    padding: 22px;
    border-radius: 22px;
    background: rgba(34, 24, 18, 0.94);
    color: #fff7ef;
    display: grid;
    gap: 12px;
    align-content: start;
}

.pool-promo-contact p {
    color: rgba(255, 247, 239, 0.78);
}

.pool-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ef8f5a, #d35d47);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 14px 30px rgba(211, 93, 71, 0.28);
}

.pool-doc-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 247, 239, 0.14);
    color: #fff7ef;
    text-decoration: none;
    font-weight: bold;
}

.pool-doc-link:hover,
.pool-contact-link:hover {
    transform: translateY(-1px);
}

.home-map-cta {
    margin-top: 18px;
    display: flex;
    justify-content: flex-start;
}

.stat-card,
.post-card,
.message-card,
.vet-card,
.admin-post-card {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
}

.stat-card {
    padding: 16px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    margin-top: 8px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.post-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.clickable-card {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.clickable-card:hover,
.clickable-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(58, 42, 17, 0.16);
    border-color: rgba(211, 93, 71, 0.34);
    outline: none;
}

.post-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eadcca;
}

.post-body {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.post-meta,
.subtle,
.field small {
    color: var(--muted);
    font-size: 13px;
}

.tag-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(211, 93, 71, 0.12);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: bold;
}

.tag.is-success {
    background: rgba(37, 111, 79, 0.12);
    color: var(--success);
}

.post-actions,
.actions-row,
.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-link-button,
.share-link-button {
    border-radius: 999px;
    padding: 18px 26px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 68px;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    font-size: 17px;
    line-height: 1;
    letter-spacing: 0;
}


.detail-link-button {
    color: #fff;
    background: linear-gradient(135deg, #6a5cff, #4f46b6);
    box-shadow: 0 16px 30px rgba(79, 70, 182, 0.22);
    font-weight: bold;
}

.share-link-button {
    color: #fff;
    background: linear-gradient(135deg, #e16a4c, #f08d57);
    box-shadow: 0 16px 30px rgba(225, 106, 76, 0.24);
    font-weight: bold;
}

.detail-link-button:hover,
.share-link-button:hover {
    transform: translateY(-1px);
}

.action-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 15px;
    line-height: 1;
    font-weight: bold;
}

.post-actions form,
.actions-row form,
.detail-actions form,
.topbar-actions form {
    display: inline-flex;
    margin: 0;
}

.post-card button,
.admin-post-card button,
.message-card button,
.vet-card button {
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 8px;
}

.location-cta-box {
    align-items: start;
}

.full-width-button {
    width: 100%;
}

.field-span-2 {
    grid-column: span 2;
}

.inline-field {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.stack-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.message-card,
.vet-card,
.admin-post-card {
    padding: 16px;
}

.drawer,
.modal {
    position: fixed;
    inset: 0;
    z-index: 70;
}

.drawer {
    z-index: 60;
}

.drawer-backdrop,
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 16, 20, 0.48);
}

.drawer-panel,
.modal-panel {
    position: relative;
    z-index: 1;
    background: #fffaf2;
    border-radius: 28px 28px 0 0;
    max-width: 760px;
    margin: auto;
    padding: 26px;
    box-shadow: var(--shadow);
}

.drawer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.drawer-panel {
    width: min(760px, calc(100vw - 24px));
    max-height: 88vh;
    overflow: auto;
}

.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-panel {
    width: min(560px, 100%);
    border-radius: 28px;
    padding-top: 58px;
}

.map-modal-panel {
    width: min(1180px, 100%);
}

.auth-helper-row {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
}

.social-auth-block {
    margin-top: 18px;
}

.social-auth-divider {
    position: relative;
    text-align: center;
    margin-bottom: 14px;
}

.social-auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(228, 217, 199, 0.95);
}

.social-auth-divider span {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 0 14px;
    color: var(--muted);
    background: #fffaf2;
}

.google-login-panel {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.social-auth-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.auth-helper-link {
    border: 0;
    background: transparent;
    color: var(--accent-dark);
    font-weight: bold;
    cursor: pointer;
    padding: 0;
}

.drawer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(31, 41, 51, 0.08);
    font-size: 28px;
    cursor: pointer;
}

.detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
    margin-top: 18px;
    max-width: 720px;
}

.gallery-thumb {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: block;
    width: 100%;
}

.detail-gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    background: #eadcca;
    cursor: pointer;
    display: block;
    box-shadow: 0 10px 24px rgba(58, 42, 17, 0.12);
}

.gallery-thumb:focus-visible img {
    outline: 3px solid rgba(211, 93, 71, 0.42);
    outline-offset: 2px;
}

.detail-section {
    margin-top: 18px;
}

.detail-map-section {
    display: grid;
    gap: 12px;
}

.detail-map-frame {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 26px rgba(58, 42, 17, 0.08);
}

.detail-map-frame iframe {
    display: block;
    width: 100%;
    height: 280px;
    border: 0;
}

.detail-map-actions {
    display: flex;
    justify-content: flex-start;
}

.all-posts-map-layout {
    display: grid;
    gap: 18px;
}

.all-posts-map-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.all-posts-map-stage {
    position: relative;
    min-height: 460px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(211, 93, 71, 0.16);
    background: #eadfce;
}

.all-posts-map-canvas {
    position: absolute;
    inset: 0;
}

.all-posts-map-canvas .leaflet-container {
    width: 100%;
    height: 100%;
    background: #eadfce;
}

.leaflet-popup-button {
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    color: #fff;
    background: linear-gradient(135deg, #6a5cff, #4f46b6);
    font-weight: bold;
    cursor: pointer;
}

.all-posts-map-note {
    position: absolute;
    left: 20px;
    bottom: 20px;
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid rgba(228, 217, 199, 0.8);
    box-shadow: 0 14px 28px rgba(58, 42, 17, 0.12);
    z-index: 2;
}

.all-posts-map-note span {
    color: var(--muted);
    font-size: 13px;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gallery-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, 0.88);
}

.gallery-shell {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    gap: 16px;
    align-items: center;
}

.gallery-figure {
    margin: 0;
    display: grid;
    gap: 12px;
    justify-items: center;
}

.gallery-figure img {
    width: 100%;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
}

.gallery-figure figcaption {
    color: #fffaf2;
    font-size: 14px;
}

.gallery-nav,
.gallery-close {
    border: 0;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.gallery-nav {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 34px;
}

.gallery-nav[disabled] {
    opacity: 0.35;
    cursor: default;
}

.gallery-close {
    position: absolute;
    top: -10px;
    right: 8px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 30px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-box:last-child {
    grid-column: span 2;
}

.empty-state {
    padding: 20px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 1180px) {
    .card-grid,
    .grid-stats,
    .admin-grid,
    .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 920px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: auto;
        height: auto;
        position: static;
    }

    .form-grid,
    .compact-grid,
    .card-grid,
    .grid-stats,
    .admin-grid,
    .toolbar {
        grid-template-columns: 1fr;
    }

    .field-span-2,
    .admin-box:last-child {
        grid-column: span 1;
    }

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

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .all-posts-map-stage {
        min-height: 360px;
    }

    .gallery-shell {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 8px;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .pool-promo {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(211, 93, 71, 0.14), transparent 28%),
            radial-gradient(circle at bottom right, rgba(37, 111, 79, 0.12), transparent 24%),
            var(--bg);
    }

    .main-panel {
        padding: 14px;
    }

    .home-map-cta .primary-button {
        width: 100%;
    }

    .pool-contact-link {
        width: 100%;
    }

    .all-posts-map-filters {
        display: grid;
        grid-template-columns: 1fr;
    }


    .panel,
    .topbar {
        padding: 16px;
        border-radius: 18px;
    }

    .sidebar {
        padding: 18px 14px;
        gap: 12px;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .brand {
        gap: 10px;
    }

    .brand strong {
        font-size: 15px;
    }

    .brand p {
        font-size: 12px;
    }

    .nav-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-item {
        min-height: 48px;
        padding: 10px 12px;
        font-size: 14px;
        justify-content: flex-start;
    }

    .sidebar-footer {
        gap: 8px;
    }

    .session-box {
        padding: 12px;
    }

    .session-box p {
        font-size: 12px;
        margin-top: 4px;
    }

    .topbar-actions,
    .detail-actions,
    .post-actions,
    .actions-row {
        width: 100%;
    }

    .topbar-actions a,
    .topbar-actions button,
    .detail-actions a,
    .detail-actions button,
    .post-actions a,
    .post-actions button,
    .actions-row a,
    .actions-row button {
        width: 100%;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar p {
        font-size: 13px;
    }

    .detail-link-button,
    .share-link-button,
    .primary-button,
    .ghost-button {
        min-height: 58px;
    }

    .detail-link-button,
    .share-link-button {
        font-size: 16px;
        padding: 16px 20px;
    }

    .action-icon {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    .detail-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .gallery-lightbox {
        padding: 12px;
    }

    .gallery-shell {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
    }

    .gallery-figure img {
        max-height: 68vh;
        border-radius: 18px;
    }

    .all-posts-map-note {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 420px) {
    .nav-list {
        grid-template-columns: 1fr 1fr;
    }

    .detail-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}
