/* ===== 喵爸團隊房仲控臺 — 直接沿用喵爸 console 的設計系統(視覺一模一樣) ===== */
:root{--navy:#0f2540;--blue:#2f6fed;--ink:#1c2530;--soft:#5b6b7d;--line:#e6ebf2;--bg:#eef2f7;--card:#fff;--ok:#1f9d57;--okbg:#e8f7ee;--warn:#c9772a;--warnbg:#fdf3e6;--info:#eaf1fd;--red:#d94f4f;--redbg:#fdeaea}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
body{font-family:"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;background:var(--bg);color:var(--ink);line-height:1.6}
.wrap{max-width:480px;margin:0 auto;min-height:100vh}
.top{background:linear-gradient(160deg,var(--navy),#1b3a64);color:#fff;padding:16px 18px 14px;position:sticky;top:0;z-index:5}
.brand{display:flex;align-items:center;gap:8px;font-weight:800;font-size:17px}
.brand .dot{width:9px;height:9px;border-radius:50%;background:#e8a13a}
.brand .who{margin-left:auto;display:flex;align-items:center;gap:8px}
.brand .role{font-size:11px;font-weight:800;padding:3px 9px;border-radius:999px;background:rgba(255,255,255,.16);color:#fff}
.brand .role.admin{background:#e8a13a;color:#3a2606}
.brand .lo{background:rgba(255,255,255,.15);color:rgba(255,255,255,.8);border:none;font-size:12px;padding:5px 11px;border-radius:8px;cursor:pointer;font-family:inherit;font-weight:700}
.tabs{display:flex;gap:5px;margin-top:12px}
.tab{flex:1;text-align:center;font-size:13px;font-weight:700;padding:8px 4px;border-radius:9px;border:none;background:rgba(255,255,255,.12);color:rgba(255,255,255,.6);cursor:pointer;font-family:inherit;transition:all .15s}
.tab.on{background:#fff;color:var(--navy)}
.tab .cnt{font-size:11px;opacity:.75}

.sect{padding:15px 16px 0}
.sect-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.sect-h .t{font-size:14px;color:var(--ink);font-weight:800}
.addbtn{font-size:13px;font-weight:700;color:#fff;background:var(--blue);border:none;padding:8px 13px;border-radius:10px;cursor:pointer;font-family:inherit}
.grp{margin-bottom:13px}
.grp-h{font-size:11.5px;color:var(--soft);font-weight:700;margin:0 0 7px 2px}
.grp-h .cnt{background:var(--line);color:var(--soft);border-radius:999px;padding:1px 7px;margin-left:4px;font-size:11px}

.searchrow{padding:12px 16px 0}
.searchrow input{width:100%;padding:11px 13px;border-radius:11px;border:1.5px solid var(--line);font-size:14px;font-family:inherit;background:#fff}

.list{padding:8px 16px 24px}
.pcard{background:var(--card);border:1px solid var(--line);border-radius:15px;padding:15px;margin-bottom:13px;box-shadow:0 3px 12px rgba(20,40,70,.05)}
.ptop{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:5px}
.badge{font-size:11.5px;font-weight:800;padding:3px 9px;border-radius:999px}
.badge.ok{color:var(--ok);background:var(--okbg)}.badge.bk{color:var(--warn);background:var(--warnbg)}
.badge.mine{color:var(--blue);background:var(--info)}
.badge.who{color:var(--soft);background:#f0f3f8}
.pn{font-weight:800;font-size:16.5px}.pp{font-weight:800;color:var(--blue)}
.pa{font-size:12.5px;color:var(--soft);margin:2px 0 10px}

/* 買方大卡片 */
.bcard{margin-bottom:10px;cursor:pointer;transition:box-shadow .15s}
.bcard.on{border-color:var(--navy);box-shadow:0 0 0 2px rgba(15,37,64,.12)}
.bcard.resp{border-color:#e8a13a;background:#fff7e6}
.bsum{font-size:13.5px;color:var(--ink);font-weight:700;margin-top:4px;line-height:1.5}
.bspec{font-size:12px;color:var(--warn);margin-top:4px}
.btime{font-size:11.5px;color:var(--soft);margin-top:7px}
.bdg-urg{font-size:11px;font-weight:800;color:var(--red);background:#fdeaea;padding:2px 7px;border-radius:999px;margin-left:5px;white-space:nowrap}

/* 賣方精簡卡片 */
.scard{margin-bottom:9px;padding:12px 13px;cursor:pointer}
.scard .slink{text-decoration:none;font-size:16px;margin-left:auto;flex:none}
.sprice{font-size:13px;color:var(--blue);font-weight:700;margin-top:3px}
.sfoot{display:flex;justify-content:space-between;align-items:center;margin-top:7px;font-size:12px;gap:8px}
.stime{color:var(--soft);font-size:11px;white-space:nowrap}

/* 詳情面板 */
.detail{margin:14px 16px 0;background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 15px}
.dhead{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:4px}
.dname{font-weight:800;font-size:17px}
.dtime{font-size:11px;color:#9aa7b5;margin-bottom:10px}
.dstate{display:flex;align-items:center;gap:7px;margin-bottom:11px}
.dstate label{font-size:12px;color:var(--soft)}
.dstate select{flex:1;padding:8px;border-radius:9px;border:1.5px solid var(--line);font-size:13px;background:#fff;font-family:inherit}
.crow{display:flex;gap:10px;padding:4px 0;font-size:14px;border-top:1px solid #f3f5f9}
.crow:first-of-type{border-top:none}
.crow .ck{color:var(--soft);width:72px;flex:none;font-size:12.5px;padding-top:1px}
.crow .cv{font-weight:600}
.dacts{display:flex;gap:8px;margin-top:12px}
.dacts button{flex:1;padding:10px;border-radius:10px;font-size:13.5px;font-weight:700;cursor:pointer;border:1.5px solid var(--line);background:#fff;color:var(--navy);font-family:inherit}
.dacts .del{color:var(--red);border-color:var(--redbg);background:var(--redbg)}

/* 代書/流程步驟條(部門成交用) */
.steps{display:flex;align-items:flex-start;margin:10px 0 6px}
.step{flex:1;display:flex;flex-direction:column;align-items:center;position:relative;font-size:11px;color:#9aa7b5;font-weight:600}
.step .dot{width:24px;height:24px;border-radius:50%;background:#eef2f7;color:#9aa7b5;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;border:2px solid #eef2f7;position:relative;z-index:1}
.step::before{content:"";position:absolute;top:11px;right:50%;width:100%;height:3px;background:#e6ebf2;z-index:0}
.step:first-child::before{display:none}
.step.done{color:var(--ink)}
.step.done .dot{background:var(--ok);border-color:var(--ok);color:#fff}
.step.done::before{background:var(--ok)}
.steps.tap .step{cursor:pointer}
.payrow{display:flex;align-items:flex-start;gap:9px;padding:9px 0;border-top:1px solid #f0f3f8}
.payrow:first-child{border-top:none}
.payck{width:22px;height:22px;flex:none;border-radius:7px;border:2px solid var(--line);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px;margin-top:1px}
.payck.on{background:var(--ok);border-color:var(--ok);color:#fff}
.pay-l{font-size:13px;font-weight:700;color:var(--ink)}
.pay-v{font-size:12.5px;color:var(--soft);margin-top:1px}

/* modal(沿用他的 .ovl/.modal/.fld) */
.ovl{position:fixed;inset:0;background:rgba(15,37,64,.5);display:none;align-items:flex-end;z-index:50}
.ovl.on{display:flex}
.modal{background:#fff;width:100%;max-width:480px;margin:0 auto;border-radius:20px 20px 0 0;padding:20px 18px 26px;max-height:90vh;overflow:auto}
.modal h3{font-size:18px;margin-bottom:14px;display:flex;justify-content:space-between;align-items:center}
.modal h3 .x{cursor:pointer;color:var(--soft);font-weight:400}
.fld{margin-bottom:14px}
.fld>label{display:block;font-size:13px;color:var(--soft);margin-bottom:6px;font-weight:600}
.fld input[type=text],.fld input[type=number],.fld input[type=tel],.fld input[type=date],.fld input[type=password],.fld input[type=email],.fld textarea,.fld select{width:100%;padding:11px;border-radius:10px;border:1.5px solid var(--line);font-size:15px;font-family:inherit}
.fld textarea{min-height:70px;resize:vertical}
.grid2{display:flex;gap:10px}.grid2>*{flex:1}
.opts{display:flex;gap:7px;flex-wrap:wrap}
.opt{font-size:13px;padding:7px 12px;border-radius:9px;border:1.5px solid var(--line);background:#fff;color:var(--soft);cursor:pointer;user-select:none}
.opt.on{background:var(--info);border-color:var(--blue);color:var(--blue);font-weight:700}
.save{width:100%;background:var(--navy);color:#fff;border:none;padding:14px;border-radius:12px;font-size:16px;font-weight:800;cursor:pointer;margin-top:6px;font-family:inherit}
.save.del{background:var(--redbg);color:var(--red)}

.empty,.load{padding:40px 24px;text-align:center;color:var(--soft);font-size:14px}
.empty .big{font-size:40px;margin-bottom:8px}
.err{margin:12px 16px;padding:12px;background:var(--warnbg);color:#9a3b12;border-radius:10px;font-size:13px}
.foot{padding:6px 18px 30px;text-align:center;color:#9aa7b5;font-size:11.5px;line-height:1.8}

/* spinner + toast(他的 console 沒有,補上、用他的色) */
.spin{width:26px;height:26px;border:3px solid var(--line);border-top-color:var(--blue);border-radius:50%;animation:sp .7s linear infinite;margin:40px auto}
@keyframes sp{to{transform:rotate(360deg)}}
.toast-wrap{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);z-index:80;display:flex;flex-direction:column;gap:8px;align-items:center}
.toast{background:var(--navy);color:#fff;padding:11px 18px;border-radius:999px;font-weight:700;font-size:14px;box-shadow:0 6px 20px rgba(15,37,64,.3);animation:pop .2s}
.toast.err{background:var(--red)}.toast.ok{background:var(--ok)}
@keyframes pop{from{opacity:0;transform:translateY(8px)}}

/* 登入頁(登入頁可以不一樣) */
.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.login .box{width:100%;max-width:360px;background:#fff;border-radius:20px;padding:30px 26px;box-shadow:0 12px 40px rgba(15,37,64,.14);text-align:center}
.login .mark{width:60px;height:60px;margin:0 auto 14px;border-radius:17px;background:linear-gradient(160deg,var(--navy),#1b3a64);color:#fff;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:800}
.login h1{font-size:19px;color:var(--navy);margin-bottom:5px}
.login .tag{font-size:13px;color:var(--soft);margin-bottom:22px}
.login .fld{text-align:left}
.gbtn{width:100%;height:46px;border:1.5px solid var(--line);border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;gap:10px;font-size:15px;color:#3c4149;font-weight:700;cursor:pointer}
.divider{display:flex;align-items:center;gap:10px;color:#a2a8b3;font-size:12px;margin:18px 0}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line)}
