.crud-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.crud-form h2.h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.crud-form__fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crud-form__group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.crud-form__group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

.crud-form__row {
    display: flex;
    gap: 1rem;
}

.crud-form__row .crud-form__group {
    flex: 1;
}

.crud-form__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.crud-stop-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.crud-stop-row__index {
    font-weight: 600;
    min-width: 1.5rem;
}

.form-control--small {
    max-width: 120px;
}

.link-editor__input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-editor__input--url {
    flex: 2;
}

.link-editor__input--title {
    flex: 1;
}

.link-viewer {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-viewer__instagram {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.link-viewer__title {
    font-size: 0.8rem;
    color: #5c636a;
    margin-top: 0.25rem;
}

.link-viewer__link a {
    color: #0d6efd;
    text-decoration: none;
}

.link-viewer__link a:hover {
    text-decoration: underline;
}

.geocode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 8px;
}

.geocode-row .btn {
    font-size: 12px;
    white-space: nowrap;
}

.geocode-row__label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    min-width: 90px;
    display: flex;
    align-items: center;
}

.crud-segment-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fff;
}

.crud-segment-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.crud-segment-card__header strong {
    margin-right: auto;
}

.btn-route {
    background: #1976d2;
    color: #fff;
    border: none;
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

.btn-route:hover {
    background: #1565c0;
    color: #fff;
}

.btn-route:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-route--osm {
    background: #388e3c;
}

.btn-route--osm:hover {
    background: #2e7d32;
    color: #fff;
}

.btn-route--gmap-link {
    background: #f57c00;
    color: #fff;
    text-decoration: none;
}

.btn-route--gmap-link:hover {
    background: #ef6c00;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 768px) {
    .crud-form__row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .link-editor__input-row {
        flex-direction: column;
    }
}

/* --- Place search --- */
.search-layout {
    display: flex;
    gap: 1.5rem;
}

.search-panel {
    width: 480px;
    flex-shrink: 0;
    max-width: 100%;
}

.search-map-container {
    flex: 1;
    min-height: 500px;
    position: relative;
}

.search-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.search-result-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.search-result-card:hover {
    border-color: #86b7fe;
    background: #f8f9ff;
}

.search-result-card--selected {
    border-color: #198754;
    background: #f0fdf4;
}

.search-result-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-result-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-result-card__rating {
    font-weight: 600;
    color: #f59e0b;
    font-size: 0.85rem;
}

.search-result-card__details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.search-result-card__actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 1024px) {
    .search-layout {
        flex-direction: column;
    }

    .search-panel {
        width: 100%;
    }

    .search-map-container,
    .search-map {
        min-height: 400px;
    }
}


/* Tagi */
.tag-editor__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 1.75rem;
    align-items: center;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.85em;
    line-height: 1.5;
}

.tag-chip--sm {
    font-size: 0.75em;
    padding: 0.05rem 0.45rem;
    margin: 0.1rem 0.15rem 0.1rem 0;
}

.tag-chip__remove {
    border: none;
    background: transparent;
    color: #1565c0;
    cursor: pointer;
    font-size: 1.05em;
    line-height: 1;
    padding: 0 0 0 0.15rem;
}

.tag-chip__remove:hover {
    color: #c62828;
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.5rem 0 0.75rem;
}

.tag-filter__label {
    font-size: 0.85em;
    color: #5c636a;
    margin-right: 0.25rem;
}

.tag-filter__btn {
    border: 1px solid #ced4da;
    background: #f8f9fa;
    color: #495057;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8em;
    cursor: pointer;
}

.tag-filter__btn:hover {
    border-color: #90caf9;
    background: #e3f2fd;
}

.tag-filter__btn--active {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
}

.tag-filter__clear {
    border: none;
    background: transparent;
    color: #c62828;
    font-size: 0.8em;
    cursor: pointer;
    text-decoration: underline;
}
