:root{font-family:"Microsoft JhengHei","PingFang TC",sans-serif;color:#20372f;background:#f3f6f2;font-size:15px;--teal:#145d4e;--muted:#74857d;--line:#e1e8e1;--red:#b9443c}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a{touch-action:manipulation}button{border:0;border-radius:8px;padding:10px 16px;background:var(--teal);color:white;cursor:pointer}button:hover{filter:brightness(1.08)}button:disabled{opacity:.45;cursor:wait}.secondary{background:#e8efe8;color:var(--teal)}.danger{background:#f7e6e3;color:var(--red)}.link{background:transparent;color:var(--teal);padding:5px 8px}.small{padding:6px 10px;font-size:13px}.shell{display:grid;grid-template-columns:235px 1fr;min-height:100vh}aside{background:#153e34;color:#e0ece2;padding:30px 18px;position:sticky;top:0;height:100vh;overflow:auto}.brand{font-size:20px;letter-spacing:1px;line-height:1.7;padding:0 14px 28px}.brand small{display:block;font-size:11px;letter-spacing:2px;color:#a3c0ab}nav{display:grid;gap:6px}nav :is(button,a[data-route]){text-align:left;background:transparent;color:#bed1c4;border-radius:8px;padding:13px 16px}nav :is(button,a[data-route]).active{background:#2c5d4c;color:#fff}.nav-index{display:inline-block;width:27px;font-size:12px;opacity:.65}main{min-width:0;padding:0 36px 40px}.topbar{height:82px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}.topbar small{color:var(--muted)}.userbar{display:flex;align-items:center;gap:12px}h1{font-size:29px;font-weight:600;letter-spacing:1px;margin:0 0 7px}h2{font-size:18px;font-weight:600;margin:0 0 18px}h3{font-size:15px}.subtitle{color:var(--muted);margin:0 0 26px;line-height:1.7}.headrow,.toolbar,.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.headrow{justify-content:space-between;margin-bottom:22px}.headrow h1{margin:0}.panel{background:#fff;border:1px solid var(--line);border-radius:12px;padding:22px;margin-bottom:20px}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}.kpi{background:white;border:1px solid var(--line);border-radius:12px;padding:20px}.kpi label{color:var(--muted);font-size:13px}.kpi strong{display:block;font-size:32px;margin:12px 0 3px;font-weight:600}.kpi small{font-size:12px;color:var(--muted)}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:20px}.toolbar{margin-bottom:18px}.toolbar input,.toolbar select{max-width:190px}.toolbar label{font-size:13px;color:var(--muted)}input,select,textarea{border:1px solid #d6e0d6;border-radius:7px;padding:10px;background:#fff;color:#263e32;max-width:100%}input:focus,textarea:focus,select:focus{outline:2px solid #c1d8c5}input[type=checkbox]{accent-color:var(--teal)}textarea{min-height:100px;resize:vertical}table{width:100%;border-collapse:collapse;text-align:left;font-size:13px}th{background:#f6f8f4;color:#748178;font-weight:500;white-space:nowrap}th,td{padding:13px 12px;border-bottom:1px solid #edf1eb;vertical-align:top}td{line-height:1.6;max-width:360px;overflow-wrap:anywhere}.tablewrap{overflow:auto}tr:hover td{background:#fbfcf9}.badge{display:inline-block;background:#ebf3e9;color:#436d49;padding:3px 9px;border-radius:6px;font-size:12px;white-space:nowrap}.badge.Reported{background:#fff2d6;color:#93742d}.badge.Assigned{background:#e6f0fa;color:#426e99}.badge.AwaitingAcceptance{background:#eee8f7;color:#7e6398}.badge.Cancelled,.badge.Rejected{background:#f4e7e4;color:#a05b4d}.muted{color:var(--muted)}.warning{background:#fff5df;color:#886820;border:1px solid #f3e4bd;padding:14px;border-radius:8px;margin-bottom:18px}.error{background:#fbe9e5;color:#a64336;padding:14px;border-radius:8px;margin:14px 0}.empty{padding:50px;text-align:center;color:var(--muted)}.pager{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:18px;font-size:13px}dialog{width:min(850px,95vw);max-height:90vh;border:1px solid var(--line);border-radius:14px;padding:28px;color:#20372f;box-shadow:0 20px 90px #123b3433}dialog::backdrop{background:#112a2255}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:17px}.field{display:flex;flex-direction:column;gap:8px;font-size:13px}.field.wide{grid-column:1/-1}.field small{color:var(--muted);line-height:1.6}.checks{display:flex;flex-wrap:wrap;gap:12px;padding:7px 0}.checks label{display:flex;align-items:center;gap:5px;font-size:13px}.dialoghead{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.dialoghead h2{margin:0}.formactions{display:flex;gap:10px;justify-content:flex-end;margin-top:24px}.detailgrid{display:grid;grid-template-columns:120px 1fr;gap:12px;font-size:14px;line-height:1.6}.detailgrid dt{color:var(--muted)}.detailgrid dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.event{border-left:2px solid #d3e4d5;padding:0 0 20px 17px;margin-left:5px}.event p{margin:6px 0;font-size:14px;white-space:pre-wrap}.photos{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.photos img{width:110px;height:90px;object-fit:cover;border-radius:8px;cursor:zoom-in}.chart{width:100%;height:260px}.charttable{font-size:12px;max-height:190px;overflow:auto}.login{max-width:420px;margin:10vh auto;background:#fff;border:1px solid var(--line);border-radius:16px;padding:38px}.login .brand{color:var(--teal);padding:0 0 25px}.login label{display:grid;gap:8px;margin:18px 0}.login button{width:100%;margin-top:15px}.login small{color:var(--muted);line-height:1.8}.login footer{font-size:12px;color:var(--muted);margin-top:28px}#toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);padding:13px 24px;border-radius:10px;background:#173f35;color:white;z-index:20;display:none;box-shadow:0 5px 25px #1234}.fileinput{display:block;max-width:100%;margin:14px 0}pre{overflow:auto;white-space:pre-wrap;max-height:400px;font-size:12px}.hint{font-size:12px;line-height:1.8;color:var(--muted)}a{color:var(--teal)}.scrollbox{max-height:260px;overflow:auto}.progressline{height:5px;background:#dcebdd;border-radius:3px}.cardline{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.checkboxfield{display:flex;align-items:center;gap:8px}.checkboxfield input{width:16px;height:16px}.pill{background:#dfebdd;color:#406941;border-radius:50%;width:32px;height:32px;display:grid;place-items:center}.close{background:transparent;color:#64786c;padding:4px 9px;font-size:24px}@media(max-width:1050px){.shell{grid-template-columns:190px 1fr}main{padding:0 20px 30px}.kpis{grid-template-columns:repeat(2,1fr)}.grid2{grid-template-columns:1fr}}@media(max-width:650px){.shell{display:block}aside{height:auto;position:static;padding:14px}.brand{font-size:16px;padding:0 8px 12px}.brand small{display:none}nav{display:flex;overflow:auto}nav :is(button,a[data-route]){white-space:nowrap;padding:9px}.nav-index{display:none}main{padding:0 14px 20px}.topbar{height:65px;margin-bottom:20px}h1{font-size:23px}.panel{padding:15px}.formgrid{grid-template-columns:1fr}.field.wide{grid-column:auto}.login{margin:6vh 16px}.kpis{gap:9px}.kpi{padding:15px}.toolbar input,.toolbar select{max-width:100%}}

.workflow{display:flex;gap:8px;flex-wrap:wrap;padding:18px 0;color:#839187}.flow-step.done{color:#285d41;font-weight:600}.flow-step b{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#e7ede3}.flow-step.done b{background:#2d745b;color:#fff}

/* 登入圖形驗證碼：按圖或文字均可換圖，窄螢幕保留完整圖片。 */
.login .login-captcha{display:grid;grid-template-columns:minmax(80px,1fr) 156px;gap:10px;align-items:center;margin:8px 0}.login-captcha input{width:100%;min-width:0}.login .captcha-image{padding:0;width:156px;height:52px;overflow:hidden;border:1px solid var(--line)}.captcha-image img{display:block;width:156px;height:51px}.captcha-image img[hidden],.captcha-image span[hidden]{display:none}.captcha-help{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:12px;color:var(--muted);margin-bottom:12px}.login .captcha-help button{width:auto;padding:6px 0;font-size:12px}.login #login-submit{width:100%}

/* 人員授權用語意化框線分組，避免將維修端調度資格與後台功能混淆。 */
.user-access-group{grid-column:1/-1;min-width:0;margin:0;padding:18px 20px 16px;border:1px solid #d5e0d8;border-radius:12px;background:#fff}
.user-access-group legend{max-width:100%;padding:0 8px;font-size:15px;font-weight:700;line-height:1.8;overflow-wrap:anywhere}
.user-access-role{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:5px;background:#edf2ee;color:#536b5e;font-size:12px;font-weight:500;vertical-align:middle}
.user-access-technician{border-color:#b9d7ca;background:#f8fcf9}
.user-access-technician legend{color:#1b6049}
.user-access-admin{border-color:#c5d4e9;background:#f8faff}
.user-access-admin legend{color:#315887}
.user-access-admin .user-access-role{background:#e8effa;color:#315887}
.user-access-help{margin:0 0 14px;color:#53695e;font-size:13px;line-height:1.8}
.user-access-fields{display:grid;min-width:0;gap:14px}
.user-access-fields .checks{gap:12px 18px}
.user-access-fields .checks label,.user-access-fields .checkboxfield{align-items:flex-start;line-height:1.7}
.user-access-fields input[type=checkbox]{flex-shrink:0;margin-top:4px}
.user-access-fields .hint{margin:0}
.user-access-note{margin:12px 0 0;padding-top:10px;border-top:1px solid #dfe8e1;color:#61766a;font-size:12px;line-height:1.8}
@media(max-width:650px){.user-access-group{padding:14px 12px}.user-access-role{margin-left:0;margin-right:6px}.user-access-fields .checks{gap:12px}.user-access-fields .checks label{max-width:100%;overflow-wrap:anywhere}}

/* 隱藏角色欄位優先於表單 grid 顯示。 */
.user-role-fields[hidden],#user-binding-section[hidden]{display:none!important}

/* 報修在上、維修後在下；各用途共用固定縮圖尺寸，原圖可點擊放大查看。 */
.ticket-photo-section{margin:26px 0 18px}
.ticket-photo-section>h3{font-size:17px;margin-bottom:8px}
.ticket-photo-comparison,.ticket-photo-evidence{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
.ticket-photo-evidence{margin-bottom:24px}
.ticket-photo-card{min-width:0;padding:16px;border:1px solid var(--line);border-radius:10px;background:#fafbf9}
.ticket-photo-card>h3{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 14px;font-size:16px}
.ticket-photo-before{background:#f0f5fc;border-color:#cbdaf0}
.ticket-photo-before>h3{color:#284e80}
.ticket-photo-after{background:#eff8f2;border-color:#c5dfcd}
.ticket-photo-after>h3{color:#245d42}
.ticket-photo-count{flex-shrink:0;font-size:12px;font-weight:400;color:#61736c}
.ticket-photo-round+.ticket-photo-round{border-top:1px solid var(--line);margin-top:15px;padding-top:15px}
.ticket-photo-round h4{display:flex;justify-content:space-between;gap:10px;margin:0 0 10px;font-size:14px}
.ticket-photos{--photo-width:160px;--photo-height:120px;display:grid;grid-template-columns:repeat(auto-fill,var(--photo-width));gap:12px;margin:0}
.ticket-photo{margin:0;min-width:0}
.ticket-photo-open{display:block;box-sizing:border-box;width:var(--photo-width);height:var(--photo-height);padding:0;background:#fff;border:1px solid #d8e1db;border-radius:8px;overflow:hidden;cursor:zoom-in}
.ticket-photo-open:focus-visible{outline:3px solid #376ea3;outline-offset:3px}
.ticket-photos img{display:block;width:100%;height:100%;object-fit:cover;border-radius:0;background:#fff}
.ticket-photo figcaption{font-size:12px;line-height:1.6;margin-top:6px;color:#52665d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ticket-photo-empty{margin:8px 0;color:#61736c;font-size:13px;line-height:1.8;overflow-wrap:anywhere}
.ticket-photo-loading,.ticket-photo-error{grid-column:1/-1}
@media(max-width:650px){.ticket-photo-comparison,.ticket-photo-evidence{gap:12px}.ticket-photo-card{padding:13px}.ticket-photos{--photo-width:128px;--photo-height:96px;gap:10px}}

/* MVC page navigation uses real links and retains the existing sidebar presentation. */
nav a[data-route]{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:8px;text-decoration:none;color:inherit;font:inherit;box-sizing:border-box}
nav a[data-route]:hover,nav a[data-route].active{background:rgba(255,255,255,.12);color:#fff}
[hidden]{display:none!important}
#logout-form{margin:0}


@media(max-width:700px){nav a[data-route]{flex:0 0 auto;width:auto;white-space:nowrap;padding:9px}}
