/* =========================================================
   SodoBVTWHue - CSS dùng chung
   Bản này giữ CSS cho bản đồ/vị trí và khôi phục giao diện đăng nhập.
   ========================================================= */

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fb;
    color: #172033;
}

main {
    flex: 1;
    width: 100%;
}

.navbar-brand {
    letter-spacing: .1px;
    white-space: normal;
}

.dashboard-card,
.map-card,
.form-card,
.empty-state {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 1rem;
    box-shadow: 0 4px 18px rgba(16, 24, 40, .045);
}

.dashboard-card {
    padding: 1.25rem;
}

.dashboard-icon {
    font-size: 2rem;
    margin-bottom: .75rem;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.search-bar {
    display: flex;
    gap: .5rem;
}

.search-bar .form-control {
    min-width: 0;
}

.map-card {
    overflow: hidden;
}

.map-preview {
    width: 100%;
    height: 220px;
    background: #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.map-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.form-page {
    max-width: 800px;
    margin: 0 auto;
}

.form-card {
    padding: clamp(1rem, 3vw, 1.75rem);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 18px #0f172a0a;
}

.image-upload-preview {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    background: #f8fafc;
}

.empty-state {
    padding: 3rem 1.25rem;
    text-align: center;
}

.btn {
    min-height: 40px;
}

.form-control,
.form-select {
    min-height: 44px;
}

footer {
    background: #fff;
}

/* Khôi phục giao diện đăng nhập: form nằm trong thẻ có chiều rộng tối đa 430px. */
body.login-page {
    display: block;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 100%);
}

.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 430px;
    margin: auto;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(13, 110, 253, .12);
}

.login-card form,
.login-card .form-control {
    width: 100%;
    max-width: 100%;
}

.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e8f1ff;
    font-size: 2rem;
}

.login-page .form-control {
    border-radius: 10px;
}

.btn {
    border-radius: 10px;
}

/* Trình đánh dấu vị trí trên bản đồ. */
.location-map-editor {
    position: relative;
    display: block;
    max-width: 100%;
    width: 100%;
    line-height: 0;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.location-map-editor img {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
    user-select: none;
    -webkit-user-drag: none;
}

.location-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 34px;
    height: 34px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: #dc2626;
    color: #fff;
    box-shadow: 0 2px 8px #0005;
    line-height: 25px;
    text-align: center;
    pointer-events: none;
    font-size: 12px;
}

@media (min-width: 768px) {
    .login-card {
        padding: 2rem;
    }
}

@media (max-width: 767.98px) {
    .form-card {
        padding: 14px;
    }

    .location-pin {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 575.98px) {
    html {
        font-size: 16px;
    }

    main.container {
        padding-left: .9rem;
        padding-right: .9rem;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-lg-mobile {
        width: 100%;
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .search-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .search-bar .form-control {
        grid-column: 1 / -1;
    }

    .map-preview {
        height: 200px;
    }
}
