html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body:has(.map-page-full) {
    overflow: hidden;
    margin-bottom: 0;
}

.app-shell:has(.map-page-full) {
    height: 100vh;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    border-bottom: 1px solid #e0eaf5;
    background: #fff;
}

.app-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1d385a;
    text-decoration: none;
}

.app-topbar-search {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.app-topbar-search input {
        width: 100%;
        border: 1px solid #c3d0e0;
        border-radius: 8px;
        padding: 7px 14px;
        font-size: 13px;
        background: #f4f7fb;
}

.app-topbar-search input:focus {
        outline: none;
        border-color: #1d385a;
        background: #ffffff;
        box-shadow: 0 0 0 0.15rem rgba(29, 56, 90, 0.12);
}

.app-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1d385a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.app-user-meta {
    line-height: 1.25;
}

.app-user-meta .app-user-name {
        font-weight: 600;
        color: #1d385a;
        font-size: 13px;
}

.app-user-meta .app-user-role {
        color: #6b7a90;
        font-size: 11px;
}

.app-user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.app-user-logout {
    border: none;
    background: none;
    color: #6b7a90;
    font-size: 12px;
    padding: 4px 8px;
}

.app-user-logout:hover {
    color: #1d385a;
}
.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.app-sidebar {
    width: 160px;
    flex-shrink: 0;
    background: #1d385a;
    color: #fff;
    padding: 16px 0;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-sidebar-nav .nav-link {
        display: block;
        color: rgba(255, 255, 255, .75);
        padding: 10px 24px;
        font-size: 14px;
}

.app-sidebar-nav .nav-link.active {
            background: rgba(255, 255, 255, .15);
            color: #fff;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}


.app-main--full {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.app-main {
    flex: 1;
    padding: 24px;
}


/* Full-bleed map page: header + sidebar float over the map instead of pushing it */
.app-shell:has(.map-page-full) {
    position: relative;
    height: 100vh;
}

    .app-shell:has(.map-page-full) .app-topbar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    }

    .app-shell:has(.map-page-full) .app-body {
        position: absolute;
        inset: 0;
    }

    .app-shell:has(.map-page-full) .app-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 2000;
        box-shadow: 2px 0 16px rgba(0, 0, 0, .18);
    }

    .app-shell:has(.map-page-full) .app-content > footer {
        display: none;
    }


.auth-body {
    margin: 0;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
}

.auth-hero {
    flex: 1 1 45%;
    display: none;
    position: relative;
    color: #fff;
    padding: 40px;
    background-image: linear-gradient(180deg, rgba(29, 56, 90, 0.75) 0%, rgba(29, 56, 90, 0.95) 100%), url('/images/auth-hero.jpg');
    background-size: cover;
    background-position: center;
    flex-direction: column;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .auth-hero {
        display: flex;
    }
}

.auth-hero-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.auth-hero-tagline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    font-weight: 600;
    font-size: 1.5rem;
    max-width: 320px;
}

.auth-hero-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .4);
    font-size: .9rem;
    flex-shrink: 0;
}

.auth-panel {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: #f4f7fb;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(20, 40, 70, 0.08);
    padding: 32px 28px;
}

.auth-card-wide {
    max-width: 480px;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1d385a;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: #6b7a90;
    font-size: .9rem;
    margin-bottom: 24px;
}

.auth-card .form-label {
    font-weight: 600;
    font-size: .8rem;
    color: #1d385a;
}

.auth-card .form-control,
.auth-card .form-select {
    border-radius: 10px;
    border: 1px solid #d7e0ec;
    padding: 10px 12px;
}

    .auth-card .form-control:focus,
    .auth-card .form-select:focus {
        border-color: #1d385a;
        box-shadow: 0 0 0 0.2rem rgba(29, 56, 90, .15);
    }

.auth-password-wrap {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #6b7a90;
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px 6px;
}

    .auth-password-toggle:hover {
        color; #1d385a;
    }

.auth-submit {
    background: #1d385a;
    border-color: #1d385a;
    border-radius: 10px;
    font-weight: 600;
    padding: 10px;
}

    .auth-submit:hover {
        background: #16293f;
        border-color: #16293f;
        color: #fff;
    }

.auth-role-toggle {
    display: flex;
    border: 1px solid #d7e0ec;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

    .auth-role-toggle button {
        flex: 1;
        border: none;
        background: #fff;
        color: #1d385a;
        font-weight: 600;
        font-size: .85rem;
        padding: 10px;
    }

        .auth-role-toggle button.active {
            background: #1d385a;
            color: #fff;
        }

.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: .9rem;
    color: #6b7a90;
}

    .auth-footer-link a {
        color: #1d385a;
        font-weight: 600;
        text-decoration: none;
    }

        .auth-footer-link a:hover {
            text-decoration: underline;
        }
/* ===== Need / Resource list pages (#63 Figma alignment) ===== */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

    .page-header h1 {
        font-size: 1.4rem;
        font-weight: 700;
        color: #1d385a;
        margin-bottom: 2px;
    }

    .page-header p {
        color: #6b7a90;
        font-size: .85rem;
        margin-bottom: 0;
    }

.btn-brand {
    background: #1d385a;
    border-color: #1d385a;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: .85rem;
}

    .btn-brand:hover {
        background: #16293f;
        border-color: #16293f;
        color: #fff;
    }

.btn-outline-brand {
    border: 1px solid #1d385a;
    color: #1d385a;
    background: #fff;
    font-weight: 600;
    border-radius: 8px;
    font-size: .8rem;
}

    .btn-outline-brand:hover {
        background: #1d385a;
        color: #fff;
    }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 12px;
    margin-bottom: 20px;
}

    .filter-bar .form-select,
    .filter-bar .form-control {
        border: 1px solid #d7e0ec;
        border-radius: 8px;
        font-size: .82rem;
        padding: 6px 10px;
        height: 34px;
        width: auto;
        min-width: 130px;
        color: #1d385a;
        background-color: #f9fbfd;
    }

        .filter-bar .form-select:focus,
        .filter-bar .form-control:focus {
            border-color: #1d385a;
            box-shadow: 0 0 0 .15rem rgba(29, 56, 90, .12);
            background-color: #fff;
        }

    .filter-bar input[type="date"] {
        min-width: 150px;
    }

.filter-bar-search {
    min-width: 200px;
    flex: 1 1 200px;
    max-width: 280px;
}

.filter-search-btn {
    border: 1px solid #d7e0ec;
    border-left: none;
    background: #f9fbfd;
    color: #1d385a;
}

    .filter-search-btn:hover {
        background: #1d385a;
        color: #fff;
        border-color: #1d385a;
    }

.filter-bar-label {
    color: #6b7a90;
    font-size: .78rem;
    font-weight: 600;
}

.filter-clear {
    color: #6b7a90;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 10px;
    white-space: nowrap;
}

    .filter-clear:hover {
        color: #1d385a;
        text-decoration: underline;
    }

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.entity-card {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-left: 4px solid var(--entity-accent, #d7e0ec);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow .15s ease, transform .15s ease;
}

    .entity-card:hover {
        box-shadow: 0 6px 20px rgba(20, 40, 70, .08);
        transform: translateY(-1px);
    }

.entity-card-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2px;
}

.entity-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.entity-card-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1d385a;
    margin: 0;
    line-height: 1.3;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    align-self: flex-start;
}

.chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.chip-priority-low {
    color: #2563eb;
    background: #eaf0fe;
}

.chip-priority-medium {
    color: #ca8a04;
    background: #fdf3da;
}

.chip-priority-critical {
    color: #dc2626;
    background: #fde8e8;
}

.chip-status-new {
    color: #1d385a;
    background: #eef2f7;
}

.chip-status-underreview {
    color: #946200;
    background: #fdf3da;
}

.chip-status-assigned {
    color: #0a7a3d;
    background: #e3f6ea;
}

.chip-status-resolved {
    color: #6b7a90;
    background: #eef1f5;
}

.chip-resource-available {
    color: #0a7a3d;
    background: #e3f6ea;
}

.chip-resource-busy {
    color: #64748b;
    background: #eef1f5;
}

.entity-card-meta {
    font-size: .78rem;
    color: #4b5a6e;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

    .entity-card-meta i {
        color: #9aa8bb;
        width: 14px;
    }

    .entity-card-meta strong {
        color: #1d385a;
        font-weight: 600;
    }

.entity-card-desc {
    font-size: .8rem;
    color: #4b5a6e;
    margin: 0;
}

.entity-card-footer {
    margin-top: auto;
    padding-top: 6px;
}

.list-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #1d385a, transparent);
    background-size: 200% 100%;
    animation: list-loading-sweep 1s linear infinite;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

    .list-loading-bar.is-active {
        opacity: 1;
    }

@keyframes list-loading-sweep {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.state-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 48px 20px;
    border-radius: 12px;
    border: 1px dashed #d7e0ec;
    background: #f9fbfd;
    color: #6b7a90;
}

    .state-panel strong {
        color: #1d385a;
        font-size: .95rem;
    }

    .state-panel.state-error {
        border: 1px solid #f3c6c6;
        background: #fdf1f1;
        color: #8a2b2b;
    }

        .state-panel.state-error strong {
            color: #c0392b;
        }

/* ===== Custom navy dropdown (replaces native <select> popup) ===== */

.custom-select {
    position: relative;
    display: inline-block;
}

.custom-select-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #d7e0ec;
    border-radius: 8px;
    background: #f9fbfd;
    color: #1d385a;
    font-size: .82rem;
    padding: 6px 10px;
    height: 34px;
    min-width: 130px;
    cursor: pointer;
}

    .custom-select-trigger:hover,
    .custom-select.is-open .custom-select-trigger {
        border-color: #1d385a;
        background: #fff;
    }

    .custom-select-trigger:focus-visible {
        outline: none;
        box-shadow: 0 0 0 .15rem rgba(29, 56, 90, .2);
    }

.custom-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-chevron {
    color: #6b7a90;
    font-size: .7rem;
    flex-shrink: 0;
    transition: transform .15s ease;
}

.custom-select.is-open .custom-select-chevron {
    transform: rotate(180deg);
}

.custom-select-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1500;
    min-width: 100%;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d7e0ec;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(20, 40, 70, .14);
    padding: 6px;
    margin: 0;
    list-style: none;
    display: none;
}

.custom-select.is-open .custom-select-panel {
    display: block;
}

.custom-select-option {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: .82rem;
    color: #1d385a;
    cursor: pointer;
    white-space: nowrap;
}

    .custom-select-option:hover {
        background: #eef2f7;
    }

    .custom-select-option.is-selected {
        background: #1d385a;
        color: #fff;
        font-weight: 600;
    }

/* ===== Need / Resource detail pages ===== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7a90;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 16px;
}

    .back-link:hover {
        color: #1d385a;
    }

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

.detail-card {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    padding: 24px;
}

.detail-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.detail-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1d385a;
    margin: 4px 0 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
    margin-top: 20px;
}

@media (max-width: 560px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-field {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

    .detail-field i {
        color: #9aa8bb;
        font-size: 1.1rem;
        margin-top: 2px;
    }

.detail-field-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #9aa8bb;
    margin-bottom: 2px;
}

.detail-field-value {
    font-size: .92rem;
    color: #1d385a;
    font-weight: 600;
}

    .detail-field-value.is-muted {
        color: #6b7a90;
        font-weight: 400;
    }

.detail-field-sub {
    font-size: .78rem;
    color: #6b7a90;
}

.detail-divider {
    border: none;
    border-top: 1px solid #e3e9f2;
    margin: 24px 0;
}

.detail-section-title {
    font-size: .85rem;
    font-weight: 700;
    color: #1d385a;
    margin-bottom: 8px;
}

.detail-desc {
    color: #4b5a6e;
    font-size: .88rem;
    white-space: pre-line;
    margin: 0;
}

.side-card {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}

.side-card-title {
    font-size: .85rem;
    font-weight: 700;
    color: #1d385a;
    margin-bottom: 4px;
}

.side-card-subtitle {
    font-size: .78rem;
    color: #6b7a90;
    margin-bottom: 16px;
}

.btn-brand-green {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: .85rem;
}

    .btn-brand-green:hover {
        background: #12833c;
        border-color: #12833c;
        color: #fff;
    }

.btn-danger-soft {
    border: 1px solid #f3c6c6;
    color: #c0392b;
    background: #fff;
    font-weight: 600;
    border-radius: 10px;
    font-size: .85rem;
}

    .btn-danger-soft:hover {
        background: #fdf1f1;
        color: #c0392b;
    }

.map-panel {
    border-radius: 10px;
    overflow: hidden;
}

.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nearby-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e3e9f2;
    border-radius: 10px;
    background: #f9fbfd;
}

.nearby-row-title {
    font-weight: 700;
    color: #1d385a;
    font-size: .88rem;
}

.nearby-row-meta {
    font-size: .76rem;
    color: #6b7a90;
    margin-top: 2px;
}

.nearby-row-right {
    text-align: right;
    flex-shrink: 0;
}

.nearby-row-distance {
    font-size: .78rem;
    font-weight: 700;
    color: #1d385a;
    white-space: nowrap;
    margin-top: 4px;
}

.photo-gallery-main {
    border-radius: 10px;
    overflow: hidden;
    background: #f4f7fb;
    position: relative;
}

    .photo-gallery-main img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.photo-gallery-empty {
    border-radius: 10px;
    background: #f4f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: #9aa8bb;
    flex-direction: column;
    gap: 8px;
}

.photo-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.photo-gallery-thumb {
    border-radius: 8px;
    overflow: hidden;
    background: #f4f7fb;
}

    .photo-gallery-thumb img {
        width: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        display: block;
    }
/* ===== Resource detail page: compact single-screen layout ===== */

.resource-detail-card {
    padding: 20px;
}

.resource-hero {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.resource-hero-media {
    flex: 0 0 280px;
    max-width: 280px;
}

    .resource-hero-media .photo-gallery-main {
        aspect-ratio: 4 / 3;
        max-height: 190px;
    }

    .resource-hero-media .photo-gallery-empty {
        min-height: 190px;
    }

    .resource-hero-media .photo-gallery-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
        gap: 6px;
        margin-top: 6px;
    }

    .resource-hero-media .photo-gallery-thumb img {
        aspect-ratio: 4 / 3;
    }

.resource-hero-info {
    flex: 1 1 auto;
    min-width: 0;
}

    .resource-hero-info .detail-title {
        margin: 4px 0 8px;
    }

.resource-desc-compact {
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-divider-tight {
    margin: 16px 0;
}

.detail-grid-tight {
    gap: 10px 24px;
    margin-top: 10px;
}

@media (max-width: 700px) {
    .resource-hero {
        flex-direction: column;
    }

    .resource-hero-media {
        max-width: 100%;
        flex-basis: auto;
    }
}