:root {
    --ink: #062d25;
    --ink-2: #104838;
    --gold: #d8be73;
    --paper: #faf6eb;
    --surface: #fffdf7;
    --muted: #718076;
    --line: rgba(6, 45, 37, .12);
    --shadow: 0 24px 70px rgba(6, 45, 37, .14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #fbf7ed 0%, #eef5f1 52%, #f8faf8 100%);
    color: var(--ink);
    font-family: Poppins, Inter, Segoe UI, Arial, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.platform-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 286px;
    padding: 28px 22px;
    background: linear-gradient(180deg, #062d25 0%, #0b3a2f 100%);
    color: #fffdf7;
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 10;
}

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

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.brand-mark strong {
    display: block;
    font-size: 20px;
}

.brand-mark small {
    display: block;
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}

.platform-nav {
    display: grid;
    gap: 10px;
}

.platform-nav a {
    padding: 14px 16px;
    border-radius: 18px;
    color: rgba(255, 255, 255, .76);
    font-weight: 800;
}

.platform-nav a:hover {
    background: rgba(255, 255, 255, .09);
    color: white;
}

.platform-nav a.nav-active {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-weight: 900;
    border-left: 3px solid var(--gold);
    padding-left: 13px;
}

.sidebar-note {
    margin-top: auto;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-note span,
.eyebrow {
    display: block;
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.sidebar-note strong {
    display: block;
    margin-top: 6px;
}

.platform-shell {
    margin-left: 286px;
    min-height: 100vh;
    padding: 28px 34px 52px;
}

.topbar {
    min-height: 86px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    margin: 3px 0 0;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 950;
    line-height: 1;
}

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

.user-pill,
.primary-link,
.link-button,
.button-primary,
.button-soft {
    min-height: 46px;
    border-radius: 16px;
    border: 0;
    padding: 12px 18px;
    font-weight: 900;
}

.user-pill,
.button-soft {
    background: rgba(6, 45, 37, .08);
}

.primary-link,
.button-primary {
    background: var(--ink);
    color: white;
    box-shadow: 0 14px 34px rgba(6, 45, 37, .18);
}

.link-button {
    color: #a73535;
    background: transparent;
}

.success-banner,
.validation-summary-errors {
    margin: 20px 0;
    padding: 16px 18px;
    border-radius: 18px;
    font-weight: 800;
}

.success-banner {
    background: #e7f8ec;
    color: #15703a;
    border: 1px solid #8ee1ad;
}

.validation-summary-errors {
    background: #fff0f2;
    color: #c61d45;
    border: 1px solid #ffc0cc;
}

.error-banner {
    margin: 20px 0;
    padding: 16px 18px;
    border-radius: 18px;
    font-weight: 800;
    background: #fff0f2;
    color: #c61d45;
    border: 1px solid #ffc0cc;
}

.sidebar-footer {
    padding: 0 20px 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    opacity: .7;
}

.sidebar-footer a {
    color: var(--muted);
    text-decoration: none;
}

.sidebar-footer a:hover {
    opacity: 1;
    color: rgba(255, 255, 255, .85);
}

.sidebar-footer-sep {
    color: rgba(255, 255, 255, .3);
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--ink);
    color: rgba(255, 255, 255, .9);
    padding: 14px 24px;
    display: none;
    align-items: center;
    justify-content: center;
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 900px;
    width: 100%;
    flex-wrap: wrap;
    font-size: 14px;
}

.cookie-banner-inner a {
    color: var(--gold);
    text-decoration: underline;
}

.cookie-accept-btn {
    background: var(--gold);
    color: var(--ink);
    border: 0;
    padding: 8px 22px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    margin-top: 28px;
    padding: clamp(34px, 5vw, 72px);
    border-radius: 36px;
    background: radial-gradient(circle at 82% 12%, rgba(216, 190, 115, .28), transparent 28%), linear-gradient(135deg, #062d25, #124937);
    color: white;
    box-shadow: var(--shadow);
}

.hero-panel h2 {
    max-width: 820px;
    margin: 12px 0 16px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: .98;
    font-weight: 950;
}

.hero-panel p {
    max-width: 760px;
    color: rgba(255, 255, 255, .82);
    font-size: 19px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-actions .button-soft {
    color: var(--ink);
    background: #fff9e4;
}

.metric-grid,
.card-grid {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

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

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

.metric-card,
.content-card,
.auth-card {
    background: rgba(255, 253, 247, .88);
    border: 1px solid rgba(6, 45, 37, .09);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 24px;
}

.metric-card strong {
    display: block;
    font-size: 42px;
    line-height: 1;
}

.metric-card span,
.muted {
    color: var(--muted);
    font-weight: 800;
}

.content-card {
    padding: 24px;
}

.content-card h3 {
    margin: 0 0 10px;
    font-weight: 950;
}

.grave-card {
    min-height: 252px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.grave-avatar {
    width: 70px;
    height: 70px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(216, 190, 115, .35), rgba(6, 45, 37, .11));
    font-size: 28px;
    font-weight: 950;
}

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

.tag {
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(6, 45, 37, .08);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 900;
}

.service-card {
    border-left: 6px solid var(--gold);
}

.tag-success {
    background: #d6f5e3;
    color: #0f5c2e;
}

.tag-warning {
    background: #fff3cc;
    color: #7a5200;
}

.tag-info {
    background: #daeeff;
    color: #0b4a80;
}

.tag-danger {
    background: #fde8ea;
    color: #8b1a25;
}

.form-section-title {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.fav-btn {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    color: var(--muted);
    transition: all 0.15s;
}

.fav-btn.fav-on {
    color: #c49a00;
    border-color: #d8be73;
    background: rgba(216, 190, 115, .12);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    margin-left: 6px;
    line-height: 1;
}

.notif-row-unread {
    background: rgba(216, 190, 115, .07);
}

.notif-row-unread td:first-child {
    border-left: 3px solid var(--gold);
}

.tomb-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tomb-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 18px;
    background: rgba(6, 45, 37, .06);
}

.tomb-img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(216, 190, 115, .15), rgba(6, 45, 37, .08));
    display: grid;
    place-items: center;
    font-size: 36px;
    color: var(--gold);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.search-box input {
    flex: 1;
}

.search-result-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.search-result-row:last-child {
    border-bottom: none;
}

.search-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(216, 190, 115, .3), rgba(6, 45, 37, .1));
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 950;
    flex-shrink: 0;
    color: var(--ink);
}

.form-shell {
    max-width: 760px;
    margin: 32px auto 0;
}

.auth-card {
    padding: clamp(26px, 4vw, 46px);
}

.form-label {
    font-weight: 900;
    color: var(--ink);
}

.form-control,
.form-select {
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(6, 45, 37, .15);
    font-weight: 700;
}

textarea.form-control {
    min-height: 150px;
}

.table-card {
    overflow: hidden;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th,
.premium-table td {
    padding: 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.premium-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 20px;
    margin-top: 24px;
}

.table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.generated-link-box {
    background: rgba(6, 45, 37, .05);
    border: 1px solid rgba(6, 45, 37, .12);
    border-radius: 20px;
    padding: 20px 22px;
}

.generated-link-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 8px;
}

.generated-link-url {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    word-break: break-all;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.generated-link-expire {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
}

.divider {
    height: 1px;
    background: var(--line);
    margin: 20px 0;
}

/* Map */
.map-outer {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-container {
    height: 70vh;
    min-height: 480px;
    width: 100%;
}

/* Routes */
.route-city-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
}

.route-city-icon {
    font-size: 32px;
    color: var(--gold);
}

.route-stop-list {
    display: grid;
    gap: 16px;
}

.route-stop-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.route-stop-num {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gold), #c49a00);
    color: var(--ink);
    font-weight: 950;
    font-size: 16px;
    display: grid;
    place-items: center;
}

.route-stop-body {
    flex: 1;
    display: flex;
    gap: 16px;
    min-width: 0;
}

.route-stop-img {
    width: 80px;
    height: 80px;
    min-width: 80px;
    object-fit: cover;
    border-radius: 14px;
    flex-shrink: 0;
}

.route-stop-info {
    flex: 1;
    min-width: 0;
}

.route-stop-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Received invitations */
.received-invite-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 4px solid var(--gold);
}

.received-invite-from {
    font-size: 12px;
    font-weight: 900;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.received-invite-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ── Mobil Alt Navigasyon (bottom tab bar) ──────────────────────── */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(180deg, #062d25 0%, #041f1a 100%);
    z-index: 200;
    align-items: flex-start;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 980px) {
    .cookie-banner { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 64px;
    color: rgba(255, 255, 255, .46);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    transition: color 0.15s ease;
    letter-spacing: 0.2px;
    -webkit-tap-highlight-color: transparent;
}

.tab-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.tab-item.tab-active {
    color: var(--gold);
}

.tab-item.tab-active svg {
    filter: drop-shadow(0 0 5px rgba(216, 190, 115, .45));
}

.tab-badge {
    position: absolute;
    top: 9px;
    right: calc(50% - 20px);
    background: #e53e3e;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
    line-height: 14px;
    pointer-events: none;
}

@media (max-width: 980px) {
    /* ── Sidebar → kompakt brand bar ── */
    .platform-sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        min-height: auto;
        inset: auto;
        padding: 11px 16px;
        flex-direction: row;
        align-items: center;
        overflow-x: visible;
        gap: 10px;
        z-index: 50;
    }

    .platform-nav   { display: none; }
    .sidebar-note   { display: none; }
    .sidebar-footer { display: none; }

    .brand-mark span { display: flex; flex-direction: column; }

    /* ── Shell: alt bar için boşluk ── */
    .platform-shell {
        margin-left: 0;
        padding: 16px 16px calc(64px + 20px + env(safe-area-inset-bottom));
    }

    /* ── Topbar sadeleşmesi ── */
    .topbar {
        min-height: 48px;
        padding-bottom: 14px;
        flex-direction: row;
        align-items: center;
        gap: 0;
    }

    .topbar .eyebrow { display: none; }
    .topbar h1       { font-size: clamp(20px, 6vw, 28px); margin: 0; }
    .topbar-actions  { display: flex; gap: 6px; }
    .topbar-actions .user-pill { display: none; }
    .topbar-actions .button-soft { display: none; }
    .topbar-actions .link-button,
    .topbar-actions .primary-link {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 36px;
        border-radius: 12px;
    }
    .topbar-actions .link-button {
        background: rgba(6, 45, 37, .08);
        color: #a73535;
    }

    /* ── Grid'ler ── */
    .metric-grid   { grid-template-columns: repeat(2, 1fr); }
    .card-grid     { grid-template-columns: 1fr; }
    .detail-layout { grid-template-columns: 1fr; }

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

    /* ── Bottom tab bar göster ── */
    .mobile-tab-bar { display: flex; }
}

@media (max-width: 640px) {
    .hero-panel {
        padding: 28px 22px;
        border-radius: 24px;
    }

    .hero-panel h2 {
        font-size: clamp(24px, 8vw, 42px);
    }

    .topbar h1 {
        font-size: clamp(22px, 7vw, 36px);
    }

    .form-shell {
        margin-top: 16px;
    }

    .auth-card {
        padding: 22px 18px;
    }

    /* Tablo başlıklarını gizle, satırları kart gibi göster */
    .premium-table thead { display: none; }

    .premium-table tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
    }

    .premium-table tr:last-child { border-bottom: none; }

    .premium-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 4px 14px;
        border-bottom: none;
        font-size: 13px;
    }

    .premium-table td[data-label]::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
        color: var(--muted);
        letter-spacing: .5px;
        min-width: 72px;
        flex-shrink: 0;
    }

    .metric-card strong {
        font-size: 32px;
    }

    .content-card {
        padding: 18px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 8px;
    }

    .hero-actions a,
    .hero-actions button {
        width: 100%;
        text-align: center;
    }

    .map-container {
        min-height: 360px;
        height: 60vh;
    }

    .route-stop-body {
        flex-direction: column;
    }

    .route-stop-img {
        width: 100%;
        height: 160px;
    }

    .cemetery-card-img img {
        height: 160px;
    }
}

/* Cemetery cards */
.cemetery-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cemetery-card-img {
    width: 100%;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.cemetery-card-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.cemetery-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Lightbox ── */
.ss-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ss-lightbox-overlay.open { display: flex; }
.ss-lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.ss-lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 34px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}
.ss-lightbox-prev,
.ss-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: rgba(255,255,255,.8);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 16px;
    user-select: none;
}
.ss-lightbox-prev { left: 6px; }
.ss-lightbox-next { right: 6px; }
.ss-gallery-thumb {
    cursor: pointer;
    transition: transform .18s, opacity .18s;
}
.ss-gallery-thumb:hover { transform: scale(1.04); opacity: .9; }

/* ── Social Login ──────────────────────────────────────────────── */

.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
}

.button-social:hover { opacity: .88; transform: translateY(-1px); }
.button-social:active { transform: translateY(0); }

.button-google {
    background: #fff;
    color: #3c4043;
    border: 1.5px solid rgba(6, 45, 37, .15);
    box-shadow: 0 2px 8px rgba(6, 45, 37, .06);
}

.button-facebook {
    background: #1877f2;
    color: #fff;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.alert-inline {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.alert-inline.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-inline.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ── Linked Accounts ───────────────────────────────────────────── */

.linked-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.linked-account-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.linked-account-row:last-child {
    border-bottom: none;
}

.linked-account-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.linked-account-icon--email {
    background: rgba(6, 45, 37, .08);
    color: var(--ink-2);
}

.linked-account-icon--google {
    background: #fff;
    border: 1px solid rgba(6, 45, 37, .12);
}

.linked-account-icon--facebook {
    background: #e7f0fd;
    color: #1877f2;
}

.linked-account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.linked-account-info strong {
    font-size: 15px;
    font-weight: 800;
}

.linked-account-info .muted {
    font-size: 13px;
}

.linked-account-badge {
    flex-shrink: 0;
}

.badge-linked {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(22, 101, 52, .1);
    color: #166534;
    font-size: 13px;
    font-weight: 700;
}

.button-sm {
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 10px;
}

.is-linked .linked-account-icon--email,
.is-linked .linked-account-icon--google,
.is-linked .linked-account-icon--facebook {
    box-shadow: 0 0 0 2px rgba(22, 101, 52, .2);
}
