﻿/* =========================================================
   📑 admin.css — 管理頁共用「搜尋 + 表格」外觀架構 (cf-admin-*)
   適用：使用者管理 / 係數審核中心 / 我的遊程管理 / 碳排係數設定
   並包含各管理頁的頁面專屬覆寫（以容器 id 限定範圍）。
   ========================================================= */

/* ─────────────────────────────────────────────────────────
   1. 搜尋／篩選工具列
   ───────────────────────────────────────────────────────── */
.cf-admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
}

.cf-admin-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.cf-admin-toolbar__filters .form-select {
    min-width: 150px;
}

/* 關鍵字搜尋輸入框（含放大鏡 icon） */
.cf-admin-toolbar__search {
    position: relative;
    flex: 1 1 220px;
    min-width: 200px;
}

.cf-admin-toolbar__search i.bi-search {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
}

.cf-admin-toolbar__search input {
    padding-left: 2.25rem;
}

.cf-admin-toolbar__search input:focus {
    border-color: #f15a22;
    box-shadow: 0 0 0 0.2rem rgba(241, 90, 34, 0.15);
}

.cf-admin-toolbar__actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

@media (max-width: 576px) {
    .cf-admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cf-admin-toolbar__actions {
        margin-left: 0;
        justify-content: flex-end;
    }
}

/* ─────────────────────────────────────────────────────────
   2. 表格卡片容器與表格本體
   ───────────────────────────────────────────────────────── */
.cf-admin-table-card {
    background-color: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 表格本體（疊加在 Bootstrap .table 之上） */
table.cf-admin-table {
    margin-bottom: 0;
}

table.cf-admin-table thead.table-light th {
    font-weight: 600;
    color: #495057;
    border-bottom-width: 1px;
    white-space: nowrap;
}

table.cf-admin-table tbody tr.cf-admin-row--hidden {
    display: none;
}

/* 搜尋無結果提示列 */
.cf-admin-table-empty {
    text-align: center;
    color: #6c757d;
    padding: 2.5rem 1rem;
}

/* 表格欄位固定寬度（取代各頁面 <th style="width:..."> 內嵌樣式） */
table.cf-admin-table th.cf-col-w-80  { width: 80px; }
table.cf-admin-table th.cf-col-w-90  { width: 90px; }
table.cf-admin-table th.cf-col-w-100 { width: 100px; }
table.cf-admin-table th.cf-col-w-130 { width: 130px; }
table.cf-admin-table th.cf-col-w-140 { width: 140px; }
table.cf-admin-table th.cf-col-w-160 { width: 160px; }
table.cf-admin-table th.cf-col-w-180 { width: 180px; }

/* ─────────────────────────────────────────────────────────
   3. 頁面專屬樣式（原寫在各 .cshtml 的 @section Styles <style> 內）
   以容器 id 限定範圍，避免影響其他頁面（特別是 body 字型，
   因 custom.css 後載入會覆蓋全站 body 字型，改用 id 提高優先權）
   ───────────────────────────────────────────────────────── */

/* Coefficient/Index.cshtml — 碳排係數設定 */
#coefficientPage {
    font-family: "Microsoft JhengHei", sans-serif;
}

#coefficientPage .accordion-button:not(.collapsed) {
    background-color: #d1e7dd; /* 淺綠色背景 (Bootstrap success-light) */
    color: #0f5132; /* 深綠色文字 (Bootstrap success-dark) */
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .125); /* 底部陰影線條 */
}

#coefficientPage .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25); /* 綠色光暈 */
    border-color: #a3cfbb;
}

#coefficientPage .badge-region {
    min-width: 60px;
}

/* Coefficient/Index.cshtml：係數類型詳細欄位區塊，預設隱藏，由 JS 切換顯示 */
.extended-fields {
    display: none;
}

/* Review/Index.cshtml — 係數審核中心 */
#reviewPage {
    font-family: "Microsoft JhengHei", sans-serif;
}
