@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;900&family=Inter:wght@500;600;700;800&display=swap');

:root {
  --brand-blue: #0095D9;
  --brand-green: #90C424;
  --brand-navy: #014A73;
  --ink: #16232E;
  --muted: #5C6B78;
  --bg: #F2F5F7;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans TC', 'Inter', sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--ink);
}
.page { max-width: 1440px; margin: 0 auto; padding: 0 32px 48px; }

.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--brand-navy); color: #fff;
  padding: 16px 32px; margin: 0 0 24px;
}
.topbar-logo { height: 34px; display: block; }
.topbar-text { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.topbar-title { font-weight: 700; font-size: 22px; letter-spacing: 0.01em; }
.topbar-sep { opacity: 0.5; font-weight: 400; }
.topbar-sub { font-weight: 500; font-size: 16px; opacity: 0.92; }

.iconbtn {
  background: rgba(255,255,255,0.14); border: none; color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; font-size: 18px;
}
.iconbtn:hover { background: rgba(255,255,255,0.26); }
.iconbtn.dark { color: var(--brand-navy); background: #fff; border: 1px solid #D5DEE4; }
.iconbtn.dark:hover { background: #EAF2F6; }

.subtext { color: var(--muted); font-size: 14px; line-height: 1.5; }
.metrotoolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.metrotoolbar .subtext { font-size: 15px; }

.linerow { margin-bottom: 22px; }
.linerow-label {
  display: inline-flex; align-items: center; color: #fff; font-size: 16px; font-weight: 700;
  padding: 8px 18px; border-radius: 8px 8px 0 0; letter-spacing: 0.02em;
}
.linerow-track {
  border: 2px solid; border-radius: 0 12px 12px 12px; background: #fff;
  padding: 30px 20px 18px; overflow-x: auto;
  display: grid; grid-template-columns: repeat(6, minmax(96px, 1fr));
  column-gap: 6px; row-gap: 40px;
}
.stationchip { text-align: center; position: relative; padding-top: 16px; }
.stationchip-dot { width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 10px; }
.stationchip-name { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; min-height: 42px; display: flex; align-items: flex-start; justify-content: center; }
.stationchip-people { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 2; }

.dutypin {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-green); color: #fff; font-size: 15px; font-weight: 800;
  border: 3px solid #fff; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.28);
  display: flex; align-items: center; justify-content: center;
}
.dutypin::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--brand-green); animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}
.dutypin.role-supervisor { background: var(--brand-blue); }
.dutypin.role-supervisor::before { border-color: var(--brand-blue); }

.legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand-green); display: inline-block; }

.modalbackdrop { position: fixed; inset: 0; background: rgba(11,31,51,0.5); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.modalcard { background: #fff; border-radius: 16px; padding: 26px; max-width: 460px; width: 100%; position: relative; max-height: 82vh; overflow-y: auto; }
.modaltitle { font-weight: 700; font-size: 19px; margin-bottom: 4px; }
.modalmeta { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.modalrow { font-size: 14px; margin-bottom: 6px; color: #26343F; }
.modaldivider { height: 1px; background: #E2E6EA; margin: 14px 0; }
.modalsubtitle { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; color: var(--ink); }

.scheduletable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.scheduletable th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid #E2E6EA; }
.scheduletable td { padding: 8px; border-bottom: 1px solid #F0F2F4; }
.statuspill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.statuspill-done { background: #E6F4EA; color: #1E7B34; }
.statuspill-current { background: #E4F2F7; color: var(--brand-blue); }
.statuspill-upcoming { background: #EEF0F2; color: var(--muted); }

.disclaimer { color: #8B98A3; font-size: 12px; margin-top: 14px; line-height: 1.6; }
.errorbanner { background: #FBEAE8; color: #A6362F; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px; }

.pagefooter {
  border-top: 1px solid #DCE3E8; margin-top: 32px; padding-top: 16px;
  font-size: 12.5px; color: #8B98A3; text-align: center;
}

@media (max-width: 900px) {
  .page { padding: 0 16px 32px; }
  .topbar { padding: 14px 18px; }
  .topbar-logo { height: 26px; }
  .topbar-title { font-size: 17px; }
  .topbar-sub { font-size: 13px; }
  .linerow-track { grid-template-columns: repeat(3, minmax(72px, 1fr)); row-gap: 32px; }
  .stationchip-name { font-size: 12.5px; }
}
