﻿@charset "utf-8";

/* =========================================================
   Recent Report List - FrontEnd
   只修外層版面，不干擾 DevExpress ComboBox / Grid 行為
   ========================================================= */

.recent-report-page {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    /* fixed-top navbar 高度約 64px，這裡留 82px 比較安全 */
    padding-top: 82px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: 18px !important;
}

@media (max-width: 991.98px) {
    .recent-report-page {
        padding-top: 72px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* 頁首 */
.recent-report-hero {
    margin-bottom: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(185, 202, 219, .95);
    background: radial-gradient(circle at top right, rgba(245, 200, 91, .18), transparent 34%), linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .13);
}

.recent-report-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0B1D33;
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: .02em;
}

    .recent-report-title i {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        color: #111827;
        background: linear-gradient(135deg, #F5C85B, #D99A2B);
        box-shadow: 0 8px 18px rgba(217, 154, 43, .25);
    }

.recent-report-desc {
    margin-top: 6px;
    color: #64748B;
    font-size: .92rem;
    font-weight: 700;
}

/* 篩選區 */
.recent-filter-card {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(185, 202, 219, .95);
    background: #FFFFFF;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .09);
}

.recent-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #0B1D33;
    font-size: .98rem;
    font-weight: 900;
}

    .recent-filter-title i {
        color: #D99A2B;
    }

/* Grid 外層卡片 */
.recent-grid-card {
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(185, 202, 219, .95);
    background: #FFFFFF;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .13);
    overflow: visible;
}


    /* 只調 Grid 外觀，不碰功能 */
    .recent-grid-card .dxbs-gridview,
    .recent-grid-card .card,
    .recent-grid-card .card-body {
        border-radius: 14px !important;
        overflow: visible !important;
    }

    .recent-grid-card .grid-header-style,
    .recent-grid-card th {
        background: linear-gradient(135deg, #0B1D33, #102A43) !important;
        color: #F8FAFC !important;
        font-weight: 800 !important;
        border-color: rgba(255, 255, 255, .08) !important;
    }

    .recent-grid-card td {
        vertical-align: middle !important;
    }

    .recent-grid-card .grid-lightno {
        color: #92400E !important;
        font-weight: 900 !important;
    }

    /* Pager dropdown 不要被蓋住 */
    .recent-grid-card,
    .recent-grid-card .dxbs-gridview,
    .recent-grid-card .dxbs-pager,
    .recent-grid-card .dropdown,
    .recent-grid-card .dropup {
        overflow: visible !important;
    }

        .recent-grid-card .dropdown-menu,
        .recent-grid-card .dxbs-dropdown-menu {
            z-index: 6000 !important;
        }

/* 手機 */
@media (max-width: 991.98px) {
    .recent-report-page {
        padding-top: 66px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .recent-report-hero {
        padding: 14px;
        border-radius: 16px;
    }

    .recent-report-title {
        font-size: 1.05rem;
    }

    .recent-report-desc {
        font-size: .84rem;
    }

    .recent-grid-card {
        padding: 8px;
        border-radius: 16px;
    }
}


/* =========================================================
   Recent Report Grid
   只修 Grid 顯示，不干擾 DevExpress 功能
   ========================================================= */

.recent-grid-card {
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(185, 202, 219, .95);
    background: #FFFFFF;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .13);
    overflow: visible !important;
}

    /* Grid 外框 */
    .recent-grid-card .dxbs-gridview,
    .recent-grid-card .dxbs-grid {
        border-radius: 14px !important;
        overflow: visible !important;
    }

    /* 表頭 */
    .recent-grid-card .grid-header-style,
    .recent-grid-card .dxbs-grid-header,
    .recent-grid-card th {
        background: linear-gradient(135deg, #0B1D33, #102A43) !important;
        color: #F8FAFC !important;
        font-weight: 800 !important;
        border-color: rgba(255, 255, 255, .08) !important;
        vertical-align: middle !important;
        white-space: nowrap !important;
    }

    /* 一般儲存格 */
    .recent-grid-card td {
        vertical-align: middle !important;
        font-size: .92rem;
        color: #172033;
    }

    /* 斑馬紋不要太重 */
    .recent-grid-card tbody tr:nth-child(even) td {
        background-color: #F8FAFC !important;
    }

    .recent-grid-card tbody tr:nth-child(odd) td {
        background-color: #FFFFFF !important;
    }

    /* hover */
    .recent-grid-card tbody tr:hover td {
        background-color: #FFF7DB !important;
    }

    /* 路燈編號 */
    .recent-lightno-cell,
    .recent-grid-card .grid-lightno {
        color: #92400E !important;
        font-weight: 900 !important;
        letter-spacing: .02em;
        white-space: nowrap !important;
    }

/* 位置與詳述可換行 */
.recent-location-cell,
.recent-desc-cell,
.recent-resolution-cell {
    white-space: normal !important;
    line-height: 1.45;
}

/* 問題詳述與備註不要撐太高 */
.recent-desc-cell,
.recent-resolution-cell {
    max-width: 260px;
}

/* 村里、故障原因 */
.recent-village-cell,
.recent-reason-cell {
    font-weight: 700;
    color: #334155;
}

/* 處理情形做成膠囊感 */
.recent-status-cell {
    font-weight: 900 !important;
    color: #0B1D33 !important;
    white-space: nowrap !important;
}

/* Pager */
.recent-grid-card .dxbs-pager,
.recent-grid-card .dxbs-pager-bottom {
    padding-top: 10px !important;
    padding-bottom: 6px !important;
    background: #FFFFFF !important;
    border-top: 1px solid #E2E8F0 !important;
}

/* Pager dropdown 不要被蓋住 */
.recent-grid-card,
.recent-grid-card .dxbs-gridview,
.recent-grid-card .dxbs-pager,
.recent-grid-card .dropdown,
.recent-grid-card .dropup {
    overflow: visible !important;
}

    .recent-grid-card .dropdown-menu,
    .recent-grid-card .dxbs-dropdown-menu {
        z-index: 6000 !important;
    }

/* 手機：Grid 允許橫向滑動，不要整頁爆版 */
@media (max-width: 991.98px) {
    .recent-grid-card {
        padding: 8px;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

        .recent-grid-card .dxbs-gridview,
        .recent-grid-card table {
            min-width: 980px;
        }

        .recent-grid-card td {
            font-size: .88rem;
        }
}

/* 小手機再壓縮 */
@media (max-width: 575.98px) {
    .recent-grid-card {
        padding: 6px;
        border-radius: 14px;
    }

        .recent-grid-card .dxbs-gridview,
        .recent-grid-card table {
            min-width: 920px;
        }

        .recent-grid-card th,
        .recent-grid-card td {
            padding-left: 7px !important;
            padding-right: 7px !important;
        }
}

/* =========================================================
   RecentReportList 手機版：GridView 改左右捲動
   ========================================================= */
@media (max-width: 768px) {

    .recent-report-page {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .recent-report-hero {
        padding: 12px 14px !important;
        margin-bottom: 10px !important;
    }

    .recent-report-title {
        font-size: 1.05rem !important;
        line-height: 1.25;
    }

    .recent-report-desc {
        font-size: .88rem !important;
        line-height: 1.4;
    }

    .recent-filter-card {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }

    .recent-grid-card {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 8px !important;
        border-radius: 14px !important;
    }

        .recent-grid-card .recent-grid,
        .recent-grid-card table {
            min-width: 1260px;
        }

        .recent-grid-card th,
        .recent-grid-card td {
            white-space: nowrap;
            vertical-align: middle !important;
        }

    .recent-location-cell,
    .recent-desc-cell,
    .recent-resolution-cell {
        white-space: normal !important;
        line-height: 1.4;
    }

    .recent-location-cell {
        min-width: 240px;
    }

    .recent-desc-cell {
        min-width: 220px;
    }

    .recent-resolution-cell {
        min-width: 180px;
    }

    .recent-grid-card::-webkit-scrollbar {
        height: 8px;
    }

    .recent-grid-card::-webkit-scrollbar-thumb {
        background: rgba(100, 116, 139, .45);
        border-radius: 999px;
    }

    .recent-grid-card::-webkit-scrollbar-track {
        background: rgba(226, 232, 240, .9);
        border-radius: 999px;
    }
}

/* =========================================================
       Recent Report Map
       ========================================================= */

.recent-map-wrap {
    position: relative;
    margin-bottom: 14px;
}

.recent-map-frame {
    width: 100%;
    height: 460px;
    min-height: 460px;
    border-radius: 16px;
    overflow: hidden;
    background: #F8FAFC;
    border: 1px solid #B8CADB;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.recent-map-empty {
    width: 100%;
    height: 390px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    background: #F8FAFC;
    border-radius: 16px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .recent-map-frame {
        height: 390px;
        min-height: 390px;
    }
}


/* =========================================================
       Map Legend
       ========================================================= */

.recent-map-legend {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    width: 235px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid #D8E1EA;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
}

.recent-map-legend-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #0B1D33;
}

    .recent-map-legend-title i {
        color: #D99A2B;
    }

.recent-map-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(15, 23, 42, .10);
    font-size: 13px;
    color: #334155;
}

    .recent-map-legend-item:last-child {
        border-bottom: none;
    }

.legend-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-count {
    font-weight: 800;
    color: #0F172A;
}

.legend-marker {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-block;
    position: relative;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.legend-marker-inner {
    width: 5px;
    height: 5px;
    position: absolute;
    top: 3px;
    left: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
}

@media (max-width: 768px) {
    .recent-map-legend {
        position: static;
        width: 100%;
        margin-top: 10px;
        box-shadow: none;
    }
}


/* =========================================================
       Marker Colors
       ========================================================= */

.marker-confirming {
    background: #64748B;
}

.marker-dispatched {
    background: #0EA5E9;
}

.marker-done {
    background: #22C55E;
}

.marker-other {
    background: #8B5CF6;
}

.status-marker {
    width: 32px;
    height: 32px;
    position: relative;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .status-marker:hover {
        transform: rotate(-45deg) scale(1.15);
        box-shadow: 0 4px 14px rgba(0, 0, 0, .40);
    }

.status-marker-inner {
    width: 10px;
    height: 10px;
    position: absolute;
    top: 9px;
    left: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
}

.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

#recentReportMap .leaflet-control-fullscreen {
    margin-top: 10px !important;
    margin-right: 10px !important;
}


/* =========================================================
       Recent Report Header + Inline Filter
       ========================================================= */

.recent-report-hero-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px !important;
    margin-bottom: 12px !important;
}

.recent-report-main {
    min-width: 0;
    flex: 1 1 auto;
}

.recent-report-hero-compact .recent-report-title {
    margin-bottom: 4px;
}

.recent-report-hero-compact .recent-report-desc {
    margin: 0;
}

.recent-report-filter-inline {
    flex: 0 0 420px;
    width: 420px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(184, 202, 219, .90);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}

.recent-filter-inline-title {
    flex: 0 0 92px;
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    color: #0B1D33;
    font-size: .92rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: visible;
}

    .recent-filter-inline-title i {
        flex: 0 0 auto;
        color: #D99A2B;
    }

    .recent-filter-inline-title span {
        display: inline-block;
        white-space: nowrap;
    }

.recent-filter-combo {
    flex: 1 1 auto;
    min-width: 0;
}

    .recent-filter-combo .dxbs-fl,
    .recent-filter-combo .dxbs-fl-ctrl,
    .recent-filter-combo .dxbs-fl-item,
    .recent-filter-combo .dxbs-combobox,
    .recent-filter-combo table {
        width: 100% !important;
    }

    .recent-filter-combo .dxbs-fl-cpt,
    .recent-filter-combo label {
        display: none !important;
    }

@media (max-width: 768px) {
    .recent-report-hero-compact {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px !important;
    }

    .recent-report-filter-inline {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .recent-filter-inline-title {
        flex: 0 0 92px;
        width: 92px;
        min-width: 92px;
    }
}


/* =========================================================
       Popup
       ========================================================= */

.recent-popup {
    min-width: 260px;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

.recent-popup-card {
    overflow: hidden;
    border-radius: 10px;
    background: #FFFFFF;
}

/* =========================================================
   Popup Header - 深灰石墨漸層版
   ========================================================= */

.recent-popup-head {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px !important;
    color: #FFFFFF;
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.recent-popup-title {
    grid-column: 1;
    justify-self: start;
    text-align: left;
    color: #FFFFFF !important;
    font-size: 1.08rem !important;
    font-weight: 900 !important;
    letter-spacing: .3px;
    line-height: 1.2;
}

.recent-popup-status {
    grid-column: 2;
    justify-self: end;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, .42);
}

/* 確認中 */
.status-confirming {
    background: rgba(255, 255, 255, .16);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, .38);
}

/* 已派工報修 */
.status-dispatched {
    background: #DBEAFE;
    color: #1D4ED8;
    border-color: #BFDBFE;
}

/* 已修護完成 */
.status-done {
    background: #DCFCE7;
    color: #166534;
    border-color: #BBF7D0;
}

/* 其他狀態 */
.status-other {
    background: #EDE9FE;
    color: #5B21B6;
    border-color: #DDD6FE;
}

.recent-popup-body {
    padding: 10px 12px 8px;
    background: #FFFFFF;
}

.recent-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, .06);
}

    .recent-popup-row:last-child {
        border-bottom: none;
    }

.recent-popup-label {
    width: 64px;
    min-width: 64px;
    color: #64748B;
    font-weight: 700;
}

.recent-popup-value {
    flex: 1;
    color: #0F172A;
    word-break: break-word;
}

.recent-popup-actions {
    padding: 10px 12px 12px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
}

.recent-popup .btn-row {
    display: flex;
    gap: 8px;
}

    .recent-popup .btn-row button {
        flex: 1 1 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 9px 0;
        border: none;
        border-radius: 8px;
        color: #FFFFFF;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    }

.recent-popup .btn-street {
    background-color: #2563EB;
}

.recent-popup .btn-nav {
    background-color: #16A34A;
}


/* =========================================================
       Grid Helper
       ========================================================= */

.grid-row-linkable {
    cursor: pointer;
}

/* Grid 處理情形 Badge */
.notice-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* N1 確認中 */
.notice-status-N1 {
    background: #E2E8F0;
    color: #334155;
    border-color: #CBD5E1;
}

/* N2 已派工報修 */
.notice-status-N2 {
    background: #DBEAFE;
    color: #1D4ED8;
    border-color: #BFDBFE;
}

/* N3 已修護完成 */
.notice-status-N3 {
    background: #DCFCE7;
    color: #166534;
    border-color: #BBF7D0;
}

/* N4 已註銷 */
.notice-status-N4 {
    background: #F1F5F9;
    color: #64748B;
    border-color: #CBD5E1;
}

/* N5 已派工報修(轉其他單位) */
.notice-status-N5 {
    background: #EDE9FE;
    color: #5B21B6;
    border-color: #DDD6FE;
}

/* N6 已派工報修(內部) */
.notice-status-N6 {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

@media (max-width: 768px) {
    .notice-status-badge {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        padding: 5px 9px;
    }
}

/* =========================================================
   Recent Grid HotTrack / Focused Row
   HotTrack 跟 IRRS 一樣，Focused Row 改淡一點
   必須放在 recent-grid-card odd/even/hover 後面
   ========================================================= */

/* HotTrack：淡藍灰，跟 IRRS 共用 Grid 接近 */
.recent-grid-card .dxbs-gridview tbody tr:hover > td,
.recent-grid-card .dxbs-gridview .dxgvDataRow:hover > td,
.recent-grid-card .dxbs-gridview .dxbs-data-row:hover > td,
.recent-grid-card .dxbs-gridview .dxgvHotTrackedRow > td,
.recent-grid-card .dxbs-gridview .dxgvHoveredRow > td {
    background-color: #EAF2F8 !important;
}

/* Focused Row：淡米金，不要太黃 */
.recent-grid-card .dxbs-gridview tr.grid-focused-row > td,
.recent-grid-card .dxbs-gridview tr.dxbs-focused-row > td,
.recent-grid-card .dxbs-gridview tr.dxgvFocusedRow > td,
.recent-grid-card .dxbs-gridview tr.dxgvSelectedRow > td,
.recent-grid-card .irrs-grid tr.grid-focused-row > td {
    background-color: #FFF4D6 !important;
    color: #1f2937 !important;
}

/* Focused Row 滑鼠移上去時，仍維持 Focused 色，不被 HotTrack 蓋掉 */
.recent-grid-card .dxbs-gridview tr.grid-focused-row:hover > td,
.recent-grid-card .dxbs-gridview tr.dxbs-focused-row:hover > td,
.recent-grid-card .dxbs-gridview tr.dxgvFocusedRow:hover > td,
.recent-grid-card .dxbs-gridview tr.dxgvSelectedRow:hover > td,
.recent-grid-card .irrs-grid tr.grid-focused-row:hover > td {
    background-color: #FFF4D6 !important;
    color: #1f2937 !important;
}