/* ============================================================
   Take One Place — 系統管理後台
   跟返客人前台個 brand 色系 (#4a4993)，但走簡潔 dashboard 風格
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Raleway', 'STHeiti', 'PingFang HK', sans-serif;
    background: #f4f4f8;
    color: #2b2b55;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 登入頁 ---------- */

body.loginPage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4a4993 0%, #6e6ec6 100%);
}

.loginBox {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.loginBrand {
    font-size: 22px;
    font-weight: 700;
    color: #4a4993;
    text-align: center;
}

.loginSubtitle {
    font-size: 14px;
    color: #8a8a99;
    text-align: center;
    margin: 4px 0 28px;
}

.loginError {
    margin-top: 16px;
    padding: 10px 14px;
    background: #fdecec;
    color: #c0392b;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* ---------- 後台版面 ---------- */

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

.sideNav {
    width: 240px;
    flex-shrink: 0;
    background: #3c3b7a;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.sideBrand {
    padding: 24px 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sideBrandName {
    font-size: 17px;
    font-weight: 700;
}

.sideBrandSub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 3px;
}

.navList {
    flex: 1;
    padding: 14px 0;
}

.navItem {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.82);
    font-family: inherit;
    font-size: 15px;
    padding: 13px 22px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.navItem:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.navItem.active {
    background: rgba(255, 255, 255, 0.12);
    border-left-color: #ffd166;
    color: #fff;
    font-weight: 600;
}

.sideFooter {
    padding: 18px 22px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 13px;
}

.sideUser {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    word-break: break-all;
}

.sideChangePw {
    display: inline-block;
    width: auto;
    padding: 0;
    margin-bottom: 8px;
    border-left: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    text-decoration: none;
}

.sideChangePw:hover,
.sideChangePw.active {
    background: none;
    border-left: none;
    color: #fff;
    text-decoration: underline;
}

.sideLogout {
    display: block;
    color: #ffd166;
    text-decoration: none;
}

.sideLogout:hover { text-decoration: underline; }

/* ---------- 右邊內容 ---------- */

.contentArea {
    flex: 1;
    padding: 34px 40px;
    min-width: 0;
}

.panel { display: none; }
.panel.active { display: block; }

.panelTitle {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    color: #2b2b55;
}

.panelHint {
    margin: 8px 0 26px;
    color: #6b6b80;
    font-size: 14px;
}

.formCard {
    background: #fff;
    border-radius: 12px;
    padding: 30px 32px;
    max-width: 520px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.cardHint {
    margin: 0 0 24px;
    font-size: 13.5px;
    color: #6b6b80;
    line-height: 1.6;
}

/* ---------- 步驟指示 ---------- */

.stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 20px 0 26px;
    padding: 0;
    max-width: 520px;
}

.stepItem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px 8px 9px;
    background: #fff;
    border: 1.5px solid #e2e2ee;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.stepItem:hover { border-color: #b9b9d6; }

.stepNum {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e2ee;
    color: #6b6b80;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.stepLabel {
    font-size: 13.5px;
    font-weight: 600;
    color: #6b6b80;
    white-space: nowrap;
}

.stepItem.active {
    background: #4a4993;
    border-color: #4a4993;
}

.stepItem.active .stepNum {
    background: #fff;
    color: #4a4993;
}

.stepItem.active .stepLabel { color: #fff; }

.stepPanel { display: none; }
.stepPanel.active { display: block; }

.stepSkip {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eeeef4;
    font-size: 13px;
    color: #8a8a99;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.stepSkip a {
    color: #4a4993;
    text-decoration: none;
    font-weight: 600;
}

.stepSkip a:hover { text-decoration: underline; }

/* ---------- 更新首頁排名 ---------- */

.rankWrap { max-width: 640px; }

.rankGroup {
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.rankGroupHead {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.rankCate {
    font-size: 16px;
    font-weight: 700;
    color: #3c3b6b;
}

.rankSub {
    font-size: 12px;
    color: #8a8a99;
}

.rankEmpty {
    font-size: 13px;
    color: #b0b0c0;
    font-style: italic;
}

.rankList {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.rankItem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1.5px solid #eeeef4;
    border-radius: 9px;
    margin-bottom: 7px;
    background: #fafafd;
}

.rankItem.onHome {
    background: #fff;
    border-color: #c9c9e4;
}

.rankPos {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e2ee;
    color: #8a8a99;
    font-size: 13px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}

.rankItem.onHome .rankPos {
    background: #4a4993;
    color: #fff;
}

.rankName {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2b2b55;
}

.rankMeta {
    display: block;
    font-size: 11.5px;
    font-weight: 400;
    color: #8a8a99;
    margin-top: 2px;
}

.rankOff, .rankOut {
    font-style: normal;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10.5px;
}

.rankOff { background: #fdecec; color: #c0392b; }
.rankOut { background: #f4f4f8; color: #8a8a99; }

.rankOps {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.rankBtn {
    width: 30px;
    height: 30px;
    border: 1.5px solid #d8d8ea;
    border-radius: 7px;
    background: #fff;
    color: #4a4993;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.rankBtn:hover { background: #f2f2f8; border-color: #4a4993; }

.rankSave {
    width: auto !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
}

/* ---------- 公司對數 ---------- */

.panelHead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.dispWrap { max-width: 1000px; }

.dispEmpty {
    padding: 34px;
    background: #fff;
    border-radius: 12px;
    color: #6b6b80;
    font-size: 14.5px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.dispTable {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    border-collapse: collapse;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.dispTable th {
    background: #f2f2f8;
    color: #3c3b6b;
    font-size: 12.5px;
    font-weight: 700;
    text-align: left;
    padding: 11px 14px;
    white-space: nowrap;
}

.dispTable td {
    padding: 13px 14px;
    font-size: 13.5px;
    color: #2b2b55;
    border-top: 1px solid #eeeef4;
    vertical-align: top;
}

.dispSub {
    font-size: 11.5px;
    color: #8a8a99;
}

.dispWarn {
    font-size: 11.5px;
    color: #c0392b;
}

.dispAmt { text-align: center; }

.dispPick {
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #4a4993;
    background: #f2f2f8;
    border: 1.5px solid #d8d8ea;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.dispPick:hover {
    background: #4a4993;
    border-color: #4a4993;
    color: #fff;
}

.dispAction {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.dispInput {
    width: 108px;
    font-family: inherit;
    font-size: 14px;
    padding: 8px 11px;
    border: 1.5px solid #d8d8ea;
    border-radius: 8px;
    color: #2b2b55;
}

.dispInput:focus { outline: none; border-color: #4a4993; }

.dispConfirm {
    width: auto !important;
    padding: 9px 18px !important;
    font-size: 14px !important;
}

.dispNote {
    margin-top: 14px;
    font-size: 12.5px;
    color: #8a8a99;
    line-height: 1.7;
}

/* ---------- 圖片上載 ---------- */

.formCardWide { max-width: 760px; }

.imgWorkspace {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #eeeef4;
}

.imgPickRow {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.btnSecondary {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #4a4993;
    background: #fff;
    border: 1.5px solid #4a4993;
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
}

.btnSecondary:hover { background: #f2f2f8; }

.imgCount {
    font-size: 12.5px;
    color: #8a8a99;
}

.imgList {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.imgEmpty {
    width: 100%;
    padding: 30px;
    background: #f7f7fb;
    border: 1.5px dashed #d8d8ea;
    border-radius: 10px;
    color: #a0a0b0;
    font-size: 13.5px;
    text-align: center;
}

.imgCard {
    position: relative;
    width: 128px;
    background: #fff;
    border: 1.5px solid #e2e2ee;
    border-radius: 10px;
    overflow: hidden;
}

.imgCard img {
    display: block;
    width: 100%;
    height: 92px;
    object-fit: cover;
    background: #f2f2f8;
}

.imgPos {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(60, 59, 122, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 21px;
    text-align: center;
}

.imgTag {
    display: block;
    padding: 5px 8px 3px;
    font-size: 11px;
    color: #8a8a99;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Banner 係橫幅，卡片闊啲先睇得出張圖係咩 */
.bannerList .imgCard { width: 232px; }
.bannerList .imgCard img { height: 86px; }

.imgOps {
    display: flex;
    border-top: 1px solid #eeeef4;
}

.imgBtn {
    flex: 1;
    border: none;
    background: #fff;
    color: #4a4993;
    font-family: inherit;
    font-size: 13px;
    padding: 6px 0;
    cursor: pointer;
}

.imgBtn:hover:not(:disabled) { background: #f2f2f8; }
.imgBtn:disabled { color: #d0d0dd; cursor: default; }
.imgBtnDel { color: #c0392b; }
.imgBtn + .imgBtn { border-left: 1px solid #eeeef4; }

/* ---------- Review 完先上架 ---------- */

.publishBox {
    display: none;
    margin-top: 26px;
    padding: 20px 22px;
    background: #f7f7fb;
    border: 1.5px solid #e2e2ee;
    border-radius: 10px;
}

.publishTitle {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #3c3b6b;
}

.publishHint {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b6b80;
    line-height: 1.6;
}

.publishRow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.publishRow:last-of-type { margin-bottom: 0; }

.publishRow .btnPrimary,
.publishRow .btnSecondary {
    width: auto;
    padding: 9px 20px;
    font-size: 14px;
    text-decoration: none;
}

.publishStatus {
    font-size: 13px;
    color: #6b6b80;
}

.isLive  { color: #1e7a48; }
.notLive { color: #c0392b; }

.btnDanger {
    color: #c0392b;
    border-color: #e3b4ae;
}

.btnDanger:hover { background: #fdecec; }

/* ---------- 分類地區設定 ---------- */

.subTitle {
    margin: 34px 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #2b2b55;
}

.mapList { max-width: 720px; }

.mapGroup {
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.mapGroupHead {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.mapType {
    font-size: 15px;
    font-weight: 700;
    color: #3c3b6b;
}

.mapCate {
    font-size: 12px;
    color: #8a8a99;
}

.mapChips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mapChip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: #4a4993;
    background: #f2f2f8;
    border-radius: 999px;
    padding: 5px 13px;
}

.mapChipUse {
    font-style: normal;
    font-size: 11.5px;
    color: #8a8a99;
}

.mapEmpty {
    font-size: 13px;
    color: #b0b0c0;
    font-style: italic;
}

.todoBox {
    padding: 26px;
    background: #f7f7fb;
    border: 1.5px dashed #d8d8ea;
    border-radius: 10px;
    color: #8a8a99;
    font-size: 14px;
    text-align: center;
}

/* ---------- 表單 ---------- */

.form-group { margin-bottom: 20px; }

/* 多用途場地專用欄位，預設收埋，揀咗 FUNC_RM 先由 JS 顯示 */
.form-group.funcOnly { display: none; }

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #3c3b6b;
}

.req { color: #d64545; }

.form-group input,
.form-group select {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    padding: 10px 13px;
    border: 1.5px solid #d8d8ea;
    border-radius: 8px;
    background: #fff;
    color: #2b2b55;
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%234a4993' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 34px;
    cursor: pointer;
}

.form-group select:disabled {
    background-color: #f4f4f8;
    color: #a0a0b0;
    cursor: default;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a4993;
}

.fieldHint {
    font-size: 12px;
    color: #8a8a99;
    margin-top: 5px;
}

.btnPrimary {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #4a4993;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btnPrimary:hover:not(:disabled) { background: #3c3b7a; }
.btnPrimary:disabled { opacity: 0.6; cursor: default; }

.resultMsg {
    margin-top: 16px;
    font-size: 14px;
    padding: 0;
}

.resultMsg.ok {
    padding: 11px 14px;
    background: #e8f6ee;
    color: #1e7a48;
    border-radius: 8px;
}

.resultMsg.fail {
    padding: 11px 14px;
    background: #fdecec;
    color: #c0392b;
    border-radius: 8px;
}

/* ---------- 彈窗 ---------- */

.modalOverlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    padding: 20px;
    background: rgba(30, 29, 66, 0.45);
    align-items: center;
    justify-content: center;
}

.modalOverlay.show { display: flex; }

.modalCard {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 14px;
    padding: 28px 30px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

.modalTitle {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #2b2b55;
}

.modalText {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6b6b80;
    line-height: 1.75;
    white-space: pre-line;
}

.modalOps {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.modalOps .btnPrimary,
.modalOps .btnSecondary {
    width: auto;
    padding: 10px 22px;
    font-size: 14px;
}

/* ---------- 手機 ---------- */

@media screen and (max-width: 820px) {
    .adminLayout { flex-direction: column; }

    .sideNav { width: 100%; }

    .navList {
        display: flex;
        flex-wrap: wrap;
        padding: 8px 0;
    }

    .navItem {
        width: auto;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .navItem.active {
        border-left: none;
        border-bottom-color: #ffd166;
    }

    .contentArea { padding: 24px 20px; }
    .formCard { padding: 24px 20px; }
}
