/* Tìm trạm sạc — frontend */
.tts-wrap {
    font-family: inherit;
    color: #222;
    line-height: 1.5;
}
.tts-wrap *, .tts-wrap *::before, .tts-wrap *::after { box-sizing: border-box; }

.tts-layout {
    display: flex;
    min-height: 680px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
    background: #fff;
}

/* Sidebar */
.tts-sidebar {
    width: 380px;
    min-width: 320px;
    max-width: 42%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8ecef;
    background: #fff;
}
.tts-sidebar-head {
    padding: 24px 20px 12px;
}
.tts-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}
.tts-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.tts-filters {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tts-search-wrap,
.tts-select-wrap {
    position: relative;
}
.tts-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}
.tts-search,
.tts-select {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 40px;
    border: 1px solid #dde2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    appearance: none;
}
.tts-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}
.tts-search:focus,
.tts-select:focus {
    outline: none;
    border-color: #1464f4;
    box-shadow: 0 0 0 3px rgba(20, 100, 244, .12);
}
.tts-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: .7;
}

.tts-btn-nearest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border: 1px solid #1464f4;
    border-radius: 8px;
    background: #fff;
    color: #1464f4;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, color .2s;
}
.tts-btn-nearest:hover {
    background: #1464f4;
    color: #fff;
}
.tts-btn-nearest.is-loading { opacity: .6; pointer-events: none; }

.tts-list-head {
    padding: 8px 20px;
    font-size: 13px;
    color: #666;
    border-top: 1px solid #eef0f2;
}

.tts-station-list {
    list-style: none;
    margin: 0;
    padding: 0 12px 16px;
    overflow-y: auto;
    flex: 1;
    max-height: 420px;
}
.tts-station-item {
    padding: 14px 12px;
    margin-bottom: 8px;
    border: 1px solid #e8ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.tts-station-item:hover {
    border-color: #1464f4;
    box-shadow: 0 2px 8px rgba(20, 100, 244, .1);
}
.tts-station-item.is-active {
    background: #1464f4;
    border-color: #1464f4;
    color: #fff;
}
.tts-station-item.is-active .tts-item-address,
.tts-station-item.is-active .tts-item-meta,
.tts-station-item.is-active .tts-item-dist {
    color: rgba(255, 255, 255, .85);
}
.tts-item-name {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}
.tts-item-address {
    margin: 0 0 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}
.tts-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}
.tts-item-dist {
    font-size: 12px;
    color: #1464f4;
    font-weight: 600;
}
.tts-item-nocoords {
    font-size: 11px;
    color: #b32d2e;
    font-weight: 600;
}
.tts-station-item.is-active .tts-item-nocoords { color: #ffcdd2; }
.tts-station-item.is-active .tts-item-dist { color: #fff; }
.tts-item-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.tts-item-status.is-active { background: #e6f7ed; color: #1a9e4a; }
.tts-item-status.is-maintenance { background: #ffebee; color: #c62828; }
.tts-item-status.is-planned { background: #e8eaf0; color: #666; }
.tts-station-item.is-active .tts-item-status {
    background: rgba(255,255,255,.2);
    color: #fff;
}

.tts-btn-view {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #1464f4;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
}
.tts-station-item.is-active .tts-btn-view {
    background: #fff;
    color: #1464f4;
}
.tts-btn-view:hover { opacity: .9; }

.tts-empty {
    padding: 24px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}
.tts-empty.is-hidden { display: none !important; }

/* Map */
.tts-map-col {
    flex: 1;
    position: relative;
    min-height: 680px;
}
.tts-map {
    width: 100%;
    height: 100%;
    min-height: 680px;
    z-index: 1;
    background: #dfe6ec;
}
/* Bản đồ 1 tông xám xanh */
.tts-wrap .tts-map .leaflet-tile-pane {
    filter: grayscale(0.72) sepia(0.12) saturate(0.55) hue-rotate(182deg) brightness(1.06) contrast(0.92);
}
.tts-wrap .tts-map .leaflet-container {
    background: #d8e0e8;
}
.tts-map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 680px;
    padding: 24px;
    background: #f5f7fa;
    text-align: center;
}
.tts-map-error p {
    margin: 0;
    max-width: 360px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Detail panel on map */
.tts-detail {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 500;
    width: 340px;
    max-width: calc(100% - 32px);
    max-height: calc(100% - 32px);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    padding: 20px;
}
.tts-detail.is-hidden { display: none !important; }
.tts-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}
.tts-detail-close:hover { background: #e0e0e0; color: #222; }
.tts-detail-badge {
    display: inline-block;
    font-size: 12px;
    color: #1464f4;
    font-weight: 600;
    margin-bottom: 6px;
}
.tts-detail-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    padding-right: 24px;
}
.tts-detail-status {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}
.tts-detail-status.is-active { color: #1a9e4a; }
.tts-detail-status.is-maintenance { color: #e53935; }
.tts-detail-status.is-planned { color: #666; }
.tts-detail-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef0f2;
}
.tts-detail-section:last-of-type { border-bottom: none; }
.tts-detail-label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
}
.tts-detail-address {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
    line-height: 1.45;
}
.tts-detail-directions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1464f4;
    text-decoration: none;
}
.tts-detail-directions:hover { text-decoration: underline; }
.tts-detail-list {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 14px;
    color: #555;
}
.tts-detail-list li { margin-bottom: 4px; }
.tts-detail-phone {
    margin: 0;
    font-size: 14px;
    color: #555;
}
.tts-detail-phone a { color: #1464f4; text-decoration: none; font-weight: 600; }

.tts-btn-detail-full {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #222;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    margin-top: 4px;
}
.tts-btn-detail-full:hover { background: #111; }

/* Full modal */
.tts-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.tts-modal[hidden] { display: none !important; }
.tts-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}
.tts-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    padding: 28px 24px 24px;
}
.tts-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tts-modal-close:hover { background: #e0e0e0; }
.tts-modal-content h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    padding-right: 32px;
}
.tts-modal-row {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef0f2;
}
.tts-modal-row:last-child { border-bottom: none; margin-bottom: 0; }
.tts-modal-row h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
}
.tts-modal-row p,
.tts-modal-row ul {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}
.tts-modal-row ul { padding-left: 18px; }

body.tts-modal-open { overflow: hidden; }

/* Pin marker */
.tts-marker-wrap {
    background: transparent !important;
    border: none !important;
}
.tts-pin {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
    transition: transform 0.15s ease;
}
.tts-pin.is-selected {
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
    transform: translateY(-2px);
}
.tts-wrap .leaflet-popup { display: none !important; }

@media (max-width: 900px) {
    .tts-layout {
        flex-direction: column;
        min-height: auto;
    }
    .tts-sidebar {
        width: 100%;
        max-width: 100%;
        max-height: none;
    }
    .tts-station-list { max-height: 320px; }
    .tts-map-col { min-height: 400px; }
    .tts-map { min-height: 400px; }
    .tts-detail {
        top: auto;
        bottom: 16px;
        left: 16px;
        right: 16px;
        width: auto;
    }
}
