/* 道路巡查與養護管理平台・申報版｜版型照闆娘概念圖：公家藍、KPI 五卡、地圖大格、左側模組列 */
:root {
  --navy: #0d2b4e;
  --navy2: #143a66;
  --navy3: #1d4e87;
  --blue: #1a73c8;
  --bg: #eef2f7;
  --panel: #fff;
  --line: #dde4ec;
  --text: #1f2937;
  --muted: #64748b;
  --ok: #10893e;
  --warn: #d98324;
  --danger: #c0392b;
  --shadow: 0 6px 22px rgba(15, 35, 70, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft JhengHei", "Noto Sans TC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
a { color: var(--blue); }

.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--navy);
  color: #fff; padding: 0 0 24px; position: sticky; top: 0; height: 100vh; overflow: auto;
}
.sidebar .logo { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .logo b { display: block; font-size: 16px; line-height: 1.5; }
.sidebar .logo small { display: block; color: #9dbbdb; font-size: 11px; margin-top: 4px; letter-spacing: .04em; }
.nav { padding: 10px 10px 0; display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav span {
  display: block; padding: 10px 12px; border-radius: 8px; color: #d8e6f5;
  text-decoration: none; font-size: 14px;
}
.nav a:hover { background: var(--navy3); color: #fff; }
.nav a.active { background: var(--blue); color: #fff; font-weight: 700; }
.nav span.planned { color: #7f97b3; cursor: not-allowed; }
.nav span.planned::after {
  content: "規劃中"; float: right; font-size: 10px; background: #33506f; color: #b6c9dd;
  border-radius: 99px; padding: 2px 7px; margin-top: 1px;
}
.nav .group { color: #7f97b3; font-size: 11px; padding: 14px 12px 4px; letter-spacing: .1em; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: linear-gradient(90deg, var(--navy2), var(--navy3));
  color: #fff; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: .02em; }
.topbar p { margin: 3px 0 0; font-size: 12px; color: #bcd4ec; }
.who { font-size: 13px; text-align: right; }
.who b { display: block; }
.who .role { color: #bcd4ec; font-size: 11px; }
.content { padding: 18px 22px 36px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 27px; font-weight: 800; margin-top: 6px; color: var(--navy); }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi .sub { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.kpi.planned { background: #f3f5f8; }
.kpi.planned .value { color: #9aa7b6; }

.cols { display: grid; grid-template-columns: 1fr 350px; gap: 14px; margin-top: 14px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel > h2 {
  margin: 0; font-size: 15px; padding: 12px 15px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.panel .body { padding: 13px 15px; }
#map { height: 620px; border-radius: 0 0 12px 12px; }
.maptools { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px 15px; border-bottom: 1px solid var(--line); align-items: center; }
.maptools label { font-size: 12px; color: var(--muted); }
select, input[type="text"], input[type="date"], input[type="password"], input[type="tel"], textarea {
  font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
textarea { width: 100%; min-height: 92px; resize: vertical; }
.layers { display: grid; gap: 6px; }
.layers label { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text); cursor: pointer; }
.layers .swatch { width: 13px; height: 13px; border-radius: 3px; flex: none; border: 1px solid rgba(0,0,0,.2); }
.layers .count { margin-left: auto; font-size: 11px; color: var(--muted); }

.btn { font: inherit; border: 1px solid var(--line); background: #fff; padding: 8px 13px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1560aa; color: #fff; }
.btn.small { padding: 5px 9px; font-size: 12px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.caselist { max-height: 560px; overflow: auto; }
.caseitem { padding: 11px 15px; border-bottom: 1px solid #eef1f5; cursor: pointer; }
.caseitem:hover { background: #f7fafd; }
.caseitem .top { display: flex; gap: 8px; align-items: center; }
.caseitem .no { font-size: 11px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.caseitem .road { font-weight: 700; font-size: 14px; }
.caseitem .desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.s待處理 { background: #fdecea; color: #c0392b; }
.s已受理 { background: #eaf2fd; color: #1a73c8; }
.s已派工 { background: #fff4e0; color: #b3671a; }
.s施工中 { background: #fff8d6; color: #8a6d00; }
.s已改善 { background: #e6f6ec; color: #10893e; }
.s結案 { background: #eef1f5; color: #52606d; }
.s不受理 { background: #f2f2f2; color: #8a8a8a; }
.cat { background: #eef4fa; color: #33587e; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 11px; border-bottom: 1px solid #eef1f5; text-align: left; font-size: 13px; vertical-align: top; }
th { background: #f6f9fc; color: #48586b; font-size: 12px; position: sticky; top: 0; }

.notice { background: #fff8e6; border: 1px solid #f5dfa0; color: #7a5b06; padding: 10px 13px; border-radius: 9px; font-size: 12px; line-height: 1.7; }
.notice.err { background: #fdecea; border-color: #f2b9b2; color: #922b21; }
.notice.ok { background: #e9f7ef; border-color: #a9dfbf; color: #196f3d; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.footer { color: #8b97a6; font-size: 11px; text-align: center; padding: 18px 0 8px; line-height: 1.8; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field > label { font-size: 13px; font-weight: 700; color: #3c4a5c; }
.field .hint { font-size: 11px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #3c4a5c; line-height: 1.7; }
.check input { margin-top: 3px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 9px; }
.thumbs a { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumbs img { display: block; width: 132px; height: 99px; object-fit: cover; }
.thumbs .pdf { display: flex; align-items: center; gap: 7px; padding: 10px 13px; font-size: 13px; font-weight: 700; color: var(--danger); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 9px 0 9px 17px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px;
  border-radius: 99px; background: var(--blue); border: 2px solid #fff;
}
.timeline .when { font-size: 11px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.timeline .what { font-size: 13px; margin-top: 2px; }
.timeline .note { font-size: 12px; color: var(--muted); margin-top: 2px; }

.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 30px; gap: 8px; align-items: center; font-size: 12px; }
.bar { height: 9px; background: #e8edf3; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #4aa3e8); }

/* 登入頁與手機申報頁：單欄置中 */
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px; background: var(--navy); }
.card-form { width: min(420px, 100%); background: #fff; border-radius: 15px; padding: 26px; box-shadow: 0 18px 60px rgba(0,0,0,.28); }
.card-form h1 { margin: 0 0 4px; font-size: 20px; color: var(--navy); }
.card-form p.sub { margin: 0 0 18px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.card-form input { width: 100%; }
.mobile { max-width: 640px; margin: 0 auto; padding: 0 0 40px; background: #fff; min-height: 100vh; }
.mobile .hd { background: var(--navy); color: #fff; padding: 14px 18px; }
.mobile .hd h1 { margin: 0; font-size: 17px; }
.mobile .hd p { margin: 3px 0 0; font-size: 11px; color: #bcd4ec; }
.mobile .bd { padding: 16px 18px; }
#pickmap { height: 280px; border-radius: 10px; border: 1px solid var(--line); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar .nav { flex-direction: row; flex-wrap: wrap; }
  #map { height: 420px; }
}
