:root {
    --primary: #c45c26;
    --primary-hover: #a64b1d;
    --primary-light: #fde8d8;
    --accent: #e08a3d;
    --text-main: #2c2419;
    --text-muted: #7a6a58;
    --bg-page: #f3ead8;
    --bg-card: #fffdf8;
    --bg-header: #3b2a1e;
    --bg-header-muted: #eadcc8;
    --border-color: #e4d5bc;
    --hotel-color: #8b5cf6;
    --restaurant-color: #ef4444;
    --cafe-color: #f59e0b;
    --sightseeing-color: #10b981;
    --shadow-sm: 0 1px 3px rgba(80, 50, 20, 0.08);
    --shadow-md: 0 4px 12px rgba(80, 50, 20, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(80, 50, 20, 0.14), 0 8px 10px -6px rgba(80, 50, 20, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ヘッダー */
.site-header {
    min-height: 64px;
    height: auto;
    background: linear-gradient(180deg, #433022 0%, #3b2a1e 100%);
    color: #f7efe3;
    border-bottom: 1px solid #2a1d14;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 10px 24px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    z-index: 1000;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(43, 28, 16, 0.25);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #f7efe3;
    flex: 0 0 auto;
    min-width: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #e8a054, #c45c26);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(196, 92, 38, 0.45);
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-badge {
    font-size: 0.75rem;
    background: rgba(224, 138, 61, 0.22);
    color: #f0c27a;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.header-search {
    display: flex;
    align-items: center;
    background: rgba(255, 248, 238, 0.1);
    border: 1px solid rgba(247, 239, 227, 0.2);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    width: 280px;
    max-width: 100%;
    flex: 0 1 280px;
    min-width: 180px;
    margin-left: auto;
    color: #eadcc8;
    transition: all 0.2s;
}

.header-search:focus-within {
    background: rgba(255, 248, 238, 0.16);
    border-color: #e08a3d;
    box-shadow: 0 0 0 3px rgba(224, 138, 61, 0.22);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.875rem;
    color: #fffaf2;
    margin-left: 8px;
}

.header-search input::placeholder {
    color: #b8a48c;
}

/* メインレイアウト */
.app-container {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

/* サイドバー */
.sidebar {
    width: 440px;
    background-color: #f6efe3;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 500;
    box-shadow: 2px 0 10px rgba(80, 50, 20, 0.06);
    flex-shrink: 0;
    min-height: 0;
}

/* サイドバーのカテゴリフィルター */
.category-filter {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fffaf2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    border: 1px solid var(--border-color);
    background: #fffdf8;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.filter-btn:hover {
    border-color: #d4b896;
    background: #f6efe3;
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--primary);
    color: #fffaf2;
    border-color: var(--primary);
}

.filter-badge {
    background: rgba(44, 36, 25, 0.08);
    font-size: 0.75rem;
    padding: 1px 6px;
    border-radius: 10px;
}

.filter-btn.active .filter-badge {
    background: rgba(255, 250, 242, 0.25);
    color: #fffaf2;
}

/* スポット一覧 */
.spots-list-header {
    padding: 12px 20px;
    background: #efe4d0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spots-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.spot-card {
    display: flex;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.spot-card:hover {
    border-color: #d4b896;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.spot-card.selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(196, 92, 38, 0.2);
}

.spot-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background-color: #e2e8f0;
}

.spot-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.spot-category-tag {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.cat-hotel {
    background: #f3e8ff;
    color: #7e22ce;
}

.cat-restaurant {
    background: #fee2e2;
    color: #b91c1c;
}

.cat-cafe {
    background: #fef3c7;
    color: #b45309;
}

.cat-nightlife {
    background: #fce7f3;
    color: #be185d;
}

.cat-onsen {
    background: #cffafe;
    color: #0e7490;
}

.cat-museum {
    background: #e7e5e4;
    color: #57534e;
}

.cat-experience {
    background: #ffedd5;
    color: #c2410c;
}

.cat-sightseeing {
    background: #d1fae5;
    color: #047857;
}

.spot-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.spot-desc-short {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

.spot-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.spot-rating {
    color: #eab308;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* マップエリア */
.map-container {
    flex: 1;
    position: relative;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3e6c4;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 100;
    background: #f3e6c4;
    flex-shrink: 0;
}

#map .leaflet-container,
#pickerMap .leaflet-container,
.leaflet-container {
    background: #f3e6c4;
}

/* カテゴリピン用アイコン（SVGマスク） */
.pin-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: var(--pin) center / contain no-repeat;
    mask: var(--pin) center / contain no-repeat;
}

.custom-map-marker .pin-icon {
    width: 18px;
    height: 18px;
    color: #ffffff;
    background-color: #ffffff;
}

/* Leaflet カスタムマーカー */
.custom-map-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    border: 3px solid #ffffff;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.custom-map-marker:hover {
    transform: scale(1.22);
    z-index: 9999 !important;
}

.marker-hotel {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
}

.marker-restaurant {
    background: linear-gradient(135deg, #f87171, #dc2626);
}

.marker-cafe {
    background: linear-gradient(135deg, #fbbf24, #d97706);
}

.marker-nightlife {
    background: linear-gradient(135deg, #f472b6, #db2777);
}

.marker-onsen {
    background: linear-gradient(135deg, #22d3ee, #0891b2);
}

.marker-museum {
    background: linear-gradient(135deg, #a8a29e, #57534e);
}

.marker-experience {
    background: linear-gradient(135deg, #fb923c, #ea580c);
}

.marker-sightseeing {
    background: linear-gradient(135deg, #34d399, #059669);
}

/* ホバーツールチップ */
.leaflet-tooltip-custom {
    background-color: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(4px);
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
    pointer-events: none;
    letter-spacing: 0.01em;
}

.leaflet-tooltip-custom::before {
    border-top-color: rgba(15, 23, 42, 0.9) !important;
}

.popup_a a {
    color: #ffffff;
}

/* ポップアップデザイン */
.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.5 !important;
    width: min(320px, calc(100vw - 48px)) !important;
}

.leaflet-popup.popup-below {
    margin-bottom: 0;
}

.leaflet-popup.popup-below .leaflet-popup-tip-container {
    position: absolute;
    top: 0;
    bottom: auto;
    overflow: visible;
    transform: translateY(-100%) rotate(180deg);
}

.popup-card {
    display: flex;
    flex-direction: column;
}

.popup-image-wrap {
    position: relative;
    width: 100%;
    height: 160px;
    background: #e2e8f0;
}

.popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    color: white;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.badge-hotel {
    background: rgba(126, 34, 206, 0.85);
}

.badge-restaurant {
    background: rgba(220, 38, 38, 0.85);
}

.badge-cafe {
    background: rgba(217, 119, 6, 0.85);
}

.badge-nightlife {
    background: rgba(219, 39, 119, 0.85);
}

.badge-onsen {
    background: rgba(8, 145, 178, 0.85);
}

.badge-museum {
    background: rgba(87, 83, 78, 0.85);
}

.badge-experience {
    background: rgba(234, 88, 12, 0.85);
}

.badge-sightseeing {
    background: rgba(5, 150, 105, 0.85);
}

.popup-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.popup-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.popup-rating {
    color: #eab308;
    font-weight: 700;
}

.popup-desc {
    font-size: 0.825rem;
    color: #475569;
    line-height: 1.5;
    margin-top: 4px;
}

.popup-info-list {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.775rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-info-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.popup-info-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.popup-footer-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.btn-popup-link {
    flex: 1;
    text-align: center;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-popup-link:hover {
    background: var(--primary-hover);
}

.btn-popup-link.is-disabled {
    background: #d9d0c3;
    color: #8a7f72;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* マップ上のクイック操作パネル */
.map-overlay-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 400;
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    max-height: calc(100% - 24px);
    overflow: auto;
}

.map-overlay-controls.is-bottom-right {
    right: auto;
}

.map-overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-toggle-legend {
    display: none;
}

.btn-map-control.btn-toggle-legend {
    display: none;
}

.btn-map-control {
    background: #efe4d0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    white-space: nowrap;
}

.btn-map-control:hover {
    background: #e4d5bc;
    border-color: #d4b896;
}

.btn-map-control.is-active {
    background: var(--primary);
    color: #fffaf2;
    border-color: var(--primary);
}

.map-legend {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-main);
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.map-legend-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.map-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.78rem;
    color: var(--text-main);
}

.map-legend .legend-pin {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(80, 50, 20, 0.25);
    flex-shrink: 0;
}

.map-legend .legend-pin .pin-icon {
    width: 12px;
    height: 12px;
    background-color: #ffffff;
}

.legend-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tooltip-sub {
    font-size: 0.725rem;
    color: #cbd5e1;
    font-weight: normal;
}

/* レスポンシブ */
@media (max-width: 1200px) {
    .sidebar {
        width: 360px;
    }

    .brand-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 900px) {
    .site-header {
        padding: 8px 12px;
        padding-top: max(8px, env(safe-area-inset-top));
        gap: 8px;
    }

    .brand {
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .brand > div {
        min-width: 0;
        overflow: hidden;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        flex-shrink: 0;
    }

    .brand-title {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 42vw;
        display: block;
    }

    .brand-badge {
        display: none;
    }

    .header-search {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .app-container {
        flex-direction: column-reverse;
        min-height: 0;
    }

    .map-container {
        flex: 1 1 52%;
        min-height: 0;
    }

    .sidebar {
        width: 100%;
        flex: 1 1 48%;
        height: auto;
        min-height: 0;
        overflow: hidden;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .category-filter {
        flex-wrap: nowrap;
        flex-shrink: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        padding: 10px 12px;
    }

    .spots-list-header {
        flex-shrink: 0;
    }

    .filter-btn {
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .spots-list-header {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    .spots-list-header span:last-child {
        display: none;
    }

    .spots-list {
        padding: 12px 14px;
        gap: 10px;
    }

    .spot-thumbnail {
        width: 76px;
        height: 76px;
    }

    .spot-card {
        padding: 10px;
        gap: 10px;
    }

    .spot-card:hover {
        transform: none;
    }

    .map-overlay-controls {
        top: 8px;
        right: 8px;
        padding: 6px 8px;
        max-width: calc(100% - 52px);
    }

    .map-overlay-actions {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .btn-toggle-legend,
    .btn-map-control.btn-toggle-legend {
        display: flex;
        width: auto;
        flex: 0 0 auto;
    }

    .btn-map-control {
        width: auto;
        flex: 0 0 auto;
        padding: 6px 8px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .map-legend {
        display: none;
        max-height: 36vh;
        overflow-y: auto;
    }

    .map-legend.is-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
        max-height: 32vh;
        overflow-y: auto;
    }

    .map-legend-label {
        grid-column: 1 / -1;
    }

    .popup-image-wrap {
        height: 72px;
    }

    .popup-body {
        padding: 8px 10px 10px;
        gap: 4px;
    }

    .popup-title {
        font-size: 0.9rem;
    }

    .popup-desc {
        font-size: 0.75rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .leaflet-popup-content {
        width: min(250px, calc(100vw - 32px)) !important;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 0.88rem;
        max-width: 52vw;
    }

    .map-container {
        flex-basis: 48%;
    }

    .sidebar {
        flex-basis: 52%;
    }

    .filter-btn {
        min-height: 36px;
    }
}

@media (max-width: 900px) and (max-height: 520px) {
    .site-header {
        min-height: 0;
        padding: 6px 10px;
        padding-top: max(6px, env(safe-area-inset-top));
    }

    .map-container {
        flex: 1 1 58%;
    }

    .sidebar {
        flex: 1 1 42%;
    }

    .spot-thumbnail {
        width: 56px;
        height: 56px;
    }
}

    .spot-desc-short {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .spot-thumbnail {
        width: 64px;
        height: 64px;
    }
}
/* ==========================================================================
   管理画面 (Admin Dashboard & Map Picker) スタイル
   ========================================================================== */

.admin-body {
    background-color: #f1f5f9;
    height: auto;
    min-height: 100vh;
    max-height: none;
    overflow: auto;
    display: block;
}

html.admin-html {
    height: auto;
    overflow: auto;
}

html.admin-html body.admin-body {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: auto;
    display: block;
}

.admin-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.admin-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.admin-badge {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #38bdf8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.admin-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

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

.admin-container {
    max-width: 1400px;
    margin: 24px auto 60px auto;
    padding: 0 24px;
}

/* アラートメッセージ */
.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.alert-danger ul {
    margin: 6px 0 0 20px;
}

/* ツールバー */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    gap: 8px;
    width: 280px;
}

.search-input-wrap input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.875rem;
}

.category-select {
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    font-size: 0.875rem;
    outline: none;
    color: var(--text-main);
}

.btn-search {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover {
    background: var(--primary-hover);
}

.btn-reset {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    padding: 7px 10px;
}

.admin-count-badge {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* カード共通 */
.admin-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

/* テーブルスタイル */
.table-responsive {
    overflow-x: auto;
}

.admin-table-wrap {
    max-height: min(70vh, calc(100dvh - 260px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-list-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.admin-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.admin-per-page select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    font-size: 0.875rem;
    color: var(--text-main);
}

.admin-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.admin-page-link {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.admin-page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.admin-page-link.is-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.admin-page-link.is-disabled {
    color: #c4b8a8;
    background: #f8f5f0;
    cursor: default;
}

.admin-page-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background-color: #f8fafc;
}

.id-badge {
    font-weight: 700;
    color: #94a3b8;
    font-size: 0.8rem;
}

.table-thumb {
    width: 54px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #e2e8f0;
}

.table-spot-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.table-spot-phone {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.coord-pill {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.table-address {
    color: var(--text-muted);
    font-size: 0.825rem;
}

.table-rating {
    font-weight: 700;
    color: #eab308;
    font-size: 0.85rem;
}

.action-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-action-edit {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-action-edit:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-action-delete {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

/* ボタン各種 */
.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.btn-back:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

/* 登録・編集フォームグリッドレイアウト */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.form-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* マップピッカーパネル */
.map-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.map-picker-guide {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.picker-coords-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-md);
}

.coord-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.coord-input {
    width: 68px;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: monospace;
    font-weight: 700;
    text-align: center;
    color: var(--primary);
    background: #ffffff;
}

.picker-map-wrapper {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    background: #000000;
}

.picker-map {
    width: 100%;
    height: 520px;
    cursor: crosshair !important;
}

.picker-map-hint {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 500;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.btn-fit-map {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-fit-map:hover {
    background: rgba(255, 255, 255, 0.35);
}

.marker-picker {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.4), 0 8px 16px rgba(0,0,0,0.3) !important;
    cursor: grab !important;
    animation: pulsePicker 2s infinite;
}

.marker-picker:active {
    cursor: grabbing !important;
}

@keyframes pulsePicker {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-cancel {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 8px 14px;
}

.btn-submit {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
    .picker-map {
        height: 420px;
    }
}

/* ==========================================================================
   ログイン画面 & 管理者バッジ・ログアウトスタイル
   ========================================================================== */

.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: inherit;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 36px 32px;
    border: 1px solid rgba(255,255,255,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.login-logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.login-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    padding: 11px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-default-hint {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.775rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-default-hint code {
    color: #0369a1;
    font-weight: 700;
    font-size: 0.85rem;
}

.login-back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.825rem;
    transition: color 0.2s;
}

.login-back-link:hover {
    color: var(--primary);
}

/* 管理画面ヘッダーユーザー情報 & ログアウト */
.admin-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-md);
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.btn-logout {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: #fef2f2;
    border: 1px solid #fecaca;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ef4444;
    color: #ffffff;
}

/* ============================================================
   画像アップロード & リアルタイムプレビュー UI
   ============================================================ */
.file-upload-box {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background: #f8fafc;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 12px;
}

.file-upload-box:hover,
.file-upload-box.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    pointer-events: none;
}

.file-upload-icon {
    font-size: 2rem;
    line-height: 1;
}

.file-upload-text {
    font-size: 0.9rem;
    color: var(--text-main);
}

.file-upload-text strong {
    color: var(--primary);
}

.file-upload-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 画像プレビュー */
.image-preview-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.image-preview-wrap {
    position: relative;
    display: inline-block;
    max-width: 260px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #ffffff;
}

.image-preview-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.btn-clear-image {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-clear-image:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.image-preview-status {
    font-size: 0.775rem;
    color: var(--text-muted);
    font-weight: 500;
}

