* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --white: #ffffff;
    --text: #1b2430;
    --muted: #5c6b7a;
    --blue: #0f4fa8;
    --blue-dark: #0a3877;
    --red: #c62828;
    --border: #dbe4ee;
    --shadow: 0 12px 30px rgba(15, 79, 168, 0.12);
    --radius: 18px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.header-inner {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 0;
}

.logo-block {
    text-decoration: none;
    color: inherit;
}

.logo-title {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    line-height: 1.05;
}

.logo-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 4px;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.top-nav a {
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 12px;
    transition: 0.2s ease;
}

.top-nav a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.top-nav a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 800;
}

.hero {
    padding: 34px 0 18px;
}

.hero h1 {
    font-size: clamp(28px, 4vw, 48px);
    color: var(--blue-dark);
    margin-bottom: 12px;
}

.hero-text {
    max-width: 900px;
    font-size: 18px;
    color: var(--muted);
}

.map-section {
    padding: 16px 0 30px;
}

.map-layout {
    display: grid;
    grid-template-columns: 1.8fr 0.9fr;
    gap: 22px;
    align-items: stretch;
}

.map-wrap,
.info-panel,
.info-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.map-wrap {
    overflow: hidden;
}

#map {
    width: 100%;
    height: 72vh;
    min-height: 520px;
}

.info-panel {
    padding: 24px;
    min-height: 520px;
}

.info-placeholder h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--blue-dark);
}

.info-placeholder p {
    color: var(--muted);
    font-size: 16px;
}

.place-title {
    font-size: 30px;
    line-height: 1.15;
    margin-bottom: 10px;
    color: var(--blue-dark);
    font-weight: 800;
}

.place-badge {
    display: inline-block;
    background: #e8f1ff;
    color: var(--blue-dark);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 18px;
}

.place-meta {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.place-meta-item {
    padding: 12px 14px;
    background: #f8fbff;
    border: 1px solid #e4edf7;
    border-radius: 14px;
}

.place-meta-item strong {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.place-desc {
    font-size: 16px;
    color: var(--text);
}

.cards-section {
    padding: 0 0 36px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.info-card {
    padding: 22px;
}

.info-card h3 {
    margin-bottom: 10px;
    color: var(--blue-dark);
    font-size: 22px;
}

.info-card p {
    color: var(--muted);
    font-size: 15px;
}

.site-footer {
    background: #0d1c31;
    color: rgba(255, 255, 255, 0.88);
    padding: 18px 0;
    text-align: center;
}

.custom-popup {
    font-size: 14px;
}

.custom-popup strong {
    color: var(--blue-dark);
}

.leaflet-popup-content-wrapper {
    border-radius: 14px;
}

/* =========================
   Responsive map and layout
   ========================= */

@media (max-width: 1100px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .info-panel {
        min-height: auto;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #map {
        height: 60vh;
        min-height: 460px;
    }
}

@media (max-width: 700px) {
    .header-inner {
        justify-content: center;
        text-align: center;
    }

    .top-nav {
        justify-content: center;
    }

    .hero {
        padding-top: 24px;
    }

    .hero-text {
        font-size: 16px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    #map {
        height: 58vh;
        min-height: 380px;
    }

    .info-panel {
        padding: 18px;
    }

    .place-title {
        font-size: 24px;
    }
}

/* =========================
   Auth pages
   ========================= */

.auth-section {
    padding: 50px 0 70px;
}

.auth-card {
    max-width: 520px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 20px 45px rgba(10, 56, 119, 0.14);
    border: 1px solid rgba(10, 56, 119, 0.08);
}

.auth-card h1 {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.2;
    color: #0a3877;
}

.auth-text {
    margin: 0 0 24px;
    color: #4b5563;
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.form-label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    color: #1f2937;
}

.form-label input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 16px;
    outline: none;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-label input:focus {
    border-color: #0a3877;
    box-shadow: 0 0 0 4px rgba(10, 56, 119, 0.12);
}

.auth-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    background: #0a3877;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-button:hover {
    background: #082f63;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(10, 56, 119, 0.22);
}

.auth-button.danger,
.auth-link-button.danger {
    background: #c1121f;
}

.auth-button.danger:hover,
.auth-link-button.danger:hover {
    background: #9f0f19;
}

.auth-bottom-text {
    margin: 22px 0 0;
    text-align: center;
    color: #4b5563;
}

.auth-bottom-text a {
    color: #0a3877;
    font-weight: 800;
    text-decoration: none;
}

.auth-bottom-text a:hover {
    text-decoration: underline;
}

.form-errors {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.form-error {
    padding: 12px 14px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
    border: 1px solid #fecaca;
}

.profile-info {
    display: grid;
    gap: 12px;
    margin: 24px 0;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid #e5e7eb;
}

.profile-row strong {
    color: #1f2937;
}

.profile-row span {
    color: #4b5563;
    text-align: right;
    word-break: break-word;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-link-button {
    flex: 1;
    min-width: 140px;
}

@media (max-width: 600px) {
    .auth-section {
        padding: 30px 0 50px;
    }

    .auth-card {
        padding: 24px 18px;
        border-radius: 20px;
    }

    .auth-card h1 {
        font-size: 26px;
    }

    .profile-row {
        display: grid;
        gap: 5px;
    }

    .profile-row span {
        text-align: left;
    }

    .profile-actions {
        display: grid;
    }
}

/* =========================
   Admin pages
   ========================= */

.admin-page-card {
    width: 100%;
    background: #ffffff;
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 20px 45px rgba(10, 56, 119, 0.14);
    border: 1px solid rgba(10, 56, 119, 0.08);
}

.admin-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 26px;
}

.admin-page-head h1 {
    margin: 0 0 10px;
    font-size: 34px;
    color: #0a3877;
}

.admin-small-button {
    width: auto;
    min-width: 120px;
    padding: 12px 18px;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    white-space: nowrap;
}

.admin-table th {
    background: #0a3877;
    color: #ffffff;
    font-weight: 800;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: #f3f7ff;
}

.role-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.role-admin {
    background: #dbeafe;
    color: #0a3877;
}

.role-editor {
    background: #fef3c7;
    color: #92400e;
}

.role-user {
    background: #e5e7eb;
    color: #374151;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.blocked {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 700px) {
    .admin-page-card {
        padding: 24px 18px;
        border-radius: 20px;
    }

    .admin-page-head {
        display: grid;
    }

    .admin-page-head h1 {
        font-size: 28px;
    }

    .admin-small-button {
        width: 100%;
    }
}

/* =========================
   Admin user actions
   ========================= */

.form-success {
    padding: 12px 14px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    font-weight: 800;
    border: 1px solid #bbf7d0;
    margin-bottom: 18px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-select {
    min-width: 110px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 10px;
    background: #ffffff;
    color: #111827;
    font-weight: 700;
    outline: none;
}

.admin-select:focus {
    border-color: #0a3877;
    box-shadow: 0 0 0 3px rgba(10, 56, 119, 0.12);
}

.admin-action-button {
    border: none;
    border-radius: 10px;
    padding: 9px 12px;
    background: #0a3877;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.admin-action-button:hover {
    background: #082f63;
    transform: translateY(-1px);
}

.admin-action-button.danger {
    background: #c1121f;
}

.admin-action-button.danger:hover {
    background: #9f0f19;
}

.admin-action-button.success {
    background: #15803d;
}

.admin-action-button.success:hover {
    background: #166534;
}

@media (max-width: 700px) {
    .admin-actions,
    .inline-form {
        width: 100%;
    }

    .inline-form {
        display: grid;
    }

    .admin-select,
    .admin-action-button {
        width: 100%;
    }
}

/* =========================
   Admin edit forms
   ========================= */

.admin-form {
    display: grid;
    gap: 22px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-label textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    outline: none;
    background: #ffffff;
    color: #111827;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-label textarea:focus {
    border-color: #0a3877;
    box-shadow: 0 0 0 4px rgba(10, 56, 119, 0.12);
}

.admin-select.full-width {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    padding: 12px 15px;
    font-size: 16px;
}

@media (max-width: 800px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Public cards
   ========================= */

.card-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    padding: 11px 16px;
    border-radius: 12px;
    background: #0a3877;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.card-link-button:hover {
    background: #082f63;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(10, 56, 119, 0.18);
}

/* =========================
   Admin head actions
   ========================= */

.admin-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    .admin-head-actions {
        width: 100%;
        display: grid;
    }
}

/* =========================
   Home stats cards
   ========================= */

.home-stat-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.home-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(15, 79, 168, 0.16);
    border-color: rgba(10, 56, 119, 0.24);
}

.home-stat-number {
    margin: 12px 0;
    font-size: 42px;
    line-height: 1;
    font-weight: 900;
    color: #0a3877;
}