:root {
  --paper: #e9ecf1;
  --card: #ffffff;
  --ink: #121826;
  --ink-soft: #2a3245;
  --slate: #69738a;
  --line: #d5dae3;
  --cobalt: #2b4be0;
  --cobalt-soft: #e5e9fd;
  --jade: #0b7a5d;
  --jade-soft: #dff1ea;
  --amber: #b87a0b;
  --amber-soft: #fbf0da;
  --rust: #b93b22;
  --rust-soft: #fae6e1;
  --gold: #b8860b;
  --gold-soft: #fbf3dc;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --r: 4px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

/* ---- 燈號 ---- */
.light {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}
.bulb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.bulb.red {
  background: var(--rust);
}
.bulb.yellow {
  background: var(--amber);
}
.bulb.green {
  background: var(--jade);
}
.light.red {
  color: var(--rust);
}
.light.yellow {
  color: var(--amber);
}
.light.green {
  color: var(--jade);
}
.lead .hdrow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.lead .hdrow .co {
  flex: 1;
  min-width: 0;
}
.lead.lt-red {
  border-left: 3px solid var(--rust);
}
.lead.lt-yellow {
  border-left: 3px solid var(--amber);
}
.lead.lt-green {
  border-left: 3px solid var(--jade);
}

/* ---- 超級篩選器 ---- */
.superbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 13px;
  margin-bottom: 14px;
  background: var(--ink);
  border-radius: var(--r);
  color: #fff;
}
.superbar .lbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aa4bc;
}
.superbar select,
.superbar input {
  border: 1px solid #2c3549;
  background: #1b2233;
  color: #fff;
  border-radius: var(--r);
  padding: 7px 10px;
  font-size: 13px;
}
.superbar input[type="date"] {
  color-scheme: dark;
}
.superbar input[type="search"] {
  min-width: 150px;
}
.superbar .quick {
  display: flex;
  gap: 4px;
}
.superbar .quick button {
  border: 1px solid #2c3549;
  background: #1b2233;
  color: #9aa4bc;
  border-radius: 99px;
  padding: 5px 11px;
  font-family: var(--mono);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.superbar .quick button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.superbar .sep {
  width: 1px;
  height: 26px;
  background: #2c3549;
}
.superbar .reset {
  margin-left: auto;
  background: none;
  border: 1px solid #2c3549;
  color: #9aa4bc;
  border-radius: var(--r);
  padding: 6px 12px;
  font-size: 12px;
}

/* ---- 戰情統計 ---- */
.warstat {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.warstat .box {
  flex: 1;
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 12px 14px;
}
.warstat .box .k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--slate);
  text-transform: uppercase;
}
.warstat .box .v {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  margin-top: 3px;
}
.warstat .box.red .v {
  color: var(--rust);
}
.warstat .box.amber .v {
  color: var(--amber);
}
.warstat .box.jade .v {
  color: var(--jade);
}
.warstat .box.cob .v {
  color: var(--cobalt);
}
.repbar {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.repbar:last-child {
  border-bottom: 0;
}
.repbar .nm {
  font-size: 13px;
  font-weight: 500;
}
.repbar .stack {
  display: flex;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  background: #edf0f5;
}
.repbar .stack i {
  display: block;
}
.repbar .stack .r {
  background: var(--rust);
}
.repbar .stack .y {
  background: var(--amber);
}
.repbar .stack .g {
  background: var(--jade);
}
.repbar .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
}

/* ---- 三欄 ---- */
.warcols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) {
  .warcols {
    grid-template-columns: 1fr;
  }
}
.warcol {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #f2f4f8;
  padding: 12px;
  min-height: 200px;
}
.warcol.red {
  border-top: 3px solid var(--rust);
}
.warcol.yellow {
  border-top: 3px solid var(--amber);
}
.warcol.green {
  border-top: 3px solid var(--jade);
}
.warcol .ch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid #dde2eb;
}
.warcol .ch b {
  font-size: 14px;
}
.warcol .ch .desc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
}
.warcol .ch .n {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}
.opp {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}
.opp:hover {
  border-color: var(--ink);
}
.opp.help {
  border-color: var(--rust);
  box-shadow: inset 3px 0 0 var(--rust);
}
.opp .top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.opp .co {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}
.opp .meta {
  font-size: 12px;
  color: var(--slate);
  margin-top: 2px;
}
.opp .last {
  font-size: 12px;
  margin-top: 8px;
  padding-left: 9px;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.opp .nx {
  font-size: 12px;
  color: var(--cobalt);
  background: var(--cobalt-soft);
  border-radius: 3px;
  padding: 4px 8px;
  margin-top: 8px;
  display: inline-block;
}
.opp .tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 9px;
  align-items: center;
}
.emptycol {
  padding: 26px 8px;
  text-align: center;
  color: var(--slate);
  font-size: 13px;
}

/* ---- Modal 分頁 ---- */
.mtabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 14px -22px 16px;
  padding: 0 22px;
}
.mtab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  color: var(--slate);
  font-weight: 500;
  font-size: 14px;
}
.mtab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--cobalt);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.modal-head .chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ---- SOP ---- */
.sop {
  background: var(--cobalt-soft);
  border: 1px solid #b7c2f6;
  border-radius: var(--r);
  padding: 13px 15px;
  margin-bottom: 16px;
}
.sop .t {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cobalt);
  font-weight: 700;
  margin-bottom: 8px;
}
.sop ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.85;
}
.steps {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.stepdot {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid #b7c2f6;
  background: #fff;
  color: var(--slate);
}
.stepdot.done {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt);
}
.stepdot.now {
  background: #fff;
  color: var(--cobalt);
  border-color: var(--cobalt);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(43, 75, 224, 0.14);
}

/* ---- 日誌表單與時間軸 ---- */
.noteform {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px;
  background: #f7f8fb;
}
.customrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 32px;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.customrow input {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  width: 100%;
}
.customrow button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  border-radius: 3px;
  height: 36px;
}
.addfield {
  background: none;
  border: 1px dashed var(--line);
  color: var(--slate);
  border-radius: var(--r);
  padding: 7px 12px;
  font-size: 12px;
  font-family: var(--mono);
  margin-top: 9px;
}
.addfield:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}
.checkrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
}
.checkrow input {
  width: 16px;
  height: 16px;
  accent-color: var(--rust);
}
.tl {
  position: relative;
  padding-left: 20px;
  margin-top: 14px;
}
.tl::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.tlitem {
  position: relative;
  padding: 0 0 16px;
}
.tlitem::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cobalt);
}
.tlitem.help::before {
  border-color: var(--rust);
}
.tlitem.boss::before {
  border-color: var(--ink);
  background: var(--ink);
}
.tlitem:last-child {
  padding-bottom: 0;
}
.tlitem .when {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tlitem .body {
  font-size: 14px;
  margin: 5px 0 0;
  white-space: pre-wrap;
}
.tlitem .nx {
  font-size: 12px;
  color: var(--cobalt);
  background: var(--cobalt-soft);
  border-radius: 3px;
  padding: 5px 9px;
  margin-top: 6px;
  display: inline-block;
}
.tlitem .bk {
  font-size: 12px;
  color: var(--rust);
  background: var(--rust-soft);
  border-radius: 3px;
  padding: 5px 9px;
  margin-top: 6px;
  display: inline-block;
}
.tlitem .cf {
  font-size: 12px;
  color: var(--slate);
  margin-top: 6px;
}
.tlitem .cf b {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}
[hidden] {
  display: none !important;
}

/* topbar */
.topbar {
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.wordmark b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.wordmark span {
  font-size: 12px;
  color: #9aa4bc;
}
.line-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #9aa4bc;
  text-transform: uppercase;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37d39b;
  box-shadow: 0 0 0 3px rgba(55, 211, 155, 0.18);
}
.topbtn {
  background: #20293c;
  border: 0;
  color: #c9d2e4;
  border-radius: var(--r);
  padding: 7px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.topbtn:hover {
  background: #2c3549;
  color: #fff;
}
.roles {
  margin-left: auto;
  display: flex;
  background: #20293c;
  border-radius: 99px;
  padding: 3px;
}
.roles button {
  background: none;
  border: 0;
  color: #9aa4bc;
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 13px;
}
.roles button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
}
.who {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid #2c3549;
}
.who .av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cobalt);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.who small {
  display: block;
  color: #9aa4bc;
  font-size: 11px;
  font-family: var(--mono);
}
.who select {
  background: none;
  border: 0;
  color: #fff;
  font-size: 13px;
  padding: 0;
}
.who select option {
  color: #000;
}
.drivemenu {
  position: absolute;
  right: 20px;
  top: 56px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px;
  z-index: 50;
  min-width: 230px;
  box-shadow: 0 12px 28px rgba(18, 24, 38, 0.16);
}
.drivemenu a {
  display: block;
  padding: 9px 11px;
  border-radius: 3px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.drivemenu a:hover {
  background: #f2f4f8;
}
.drivemenu a small {
  display: block;
  color: var(--slate);
  font-size: 11px;
  font-family: var(--mono);
}

/* tabs */
.tabs {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 20;
}
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 15px;
  color: var(--slate);
  font-weight: 500;
  white-space: nowrap;
}
.tab .n {
  font-family: var(--mono);
  font-size: 11px;
  margin-right: 7px;
  opacity: 0.7;
}
.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--cobalt);
}
.tab:hover {
  color: var(--ink);
}
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 72px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 940px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.card + .card {
  margin-top: 18px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}
h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.sub {
  color: var(--slate);
  font-size: 13px;
  margin: 0;
}

/* tally */
.quota {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.block {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.block-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.count {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.count .of {
  color: var(--slate);
  font-size: 17px;
  font-weight: 500;
}
.block-label {
  font-size: 13px;
  font-weight: 700;
}
.block-note {
  font-size: 12px;
  color: var(--slate);
  margin-left: auto;
  font-family: var(--mono);
}
.tally {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 5px;
}
@media (max-width: 620px) {
  .tally {
    grid-template-columns: repeat(10, 1fr);
  }
}
.tick {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f5f7fa;
}
.tick.on {
  background: var(--ink);
  border-color: var(--ink);
}
.tick.extra.on {
  background: var(--cobalt);
  border-color: var(--cobalt);
}
.tick.next {
  box-shadow: inset 0 0 0 1px var(--cobalt);
  border-color: var(--cobalt);
}
.block.waived .tally {
  opacity: 0.26;
}
.block.waived::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 1px;
  background: var(--rust);
  opacity: 0.5;
}
.stamp {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) rotate(-7deg);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--rust);
  border: 2px solid var(--rust);
  border-radius: 3px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.93);
  text-align: center;
}
.meter {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.meter .bar {
  flex: 1;
  height: 8px;
  background: #edf0f5;
  border-radius: 99px;
  overflow: hidden;
}
.meter .fill {
  height: 100%;
  background: var(--cobalt);
}
.meter .val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  white-space: nowrap;
}
.or {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--slate);
  margin: 10px 0 -2px;
}
.slots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}
.slot {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 5px 13px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
}
.slot[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* bonus */
.bonus {
  background: linear-gradient(180deg, #fdf9ee, #fff);
  border-color: #e8d9ae;
}
.bignum {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--gold);
}
.tiers {
  position: relative;
  height: 12px;
  background: #edf0f5;
  border-radius: 99px;
  overflow: hidden;
  margin: 14px 0 6px;
}
.tiers .fill {
  height: 100%;
  background: linear-gradient(90deg, #d9ae3a, #b8860b);
}
.tiermarks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
}
.togo {
  font-size: 14px;
  margin-top: 10px;
}
.togo b {
  font-family: var(--mono);
  color: var(--gold);
}

/* funnel */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.step {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.step .name {
  font-size: 13px;
  font-weight: 500;
}
.step .track {
  position: relative;
  height: 22px;
  background: #f2f4f8;
  border-radius: 2px;
  overflow: hidden;
}
.step .goal {
  position: absolute;
  inset: 0;
  width: var(--goal);
  background: repeating-linear-gradient(135deg, #dde2eb 0 5px, #f2f4f8 5px 10px);
}
.step .actual {
  position: absolute;
  inset: 0;
  width: var(--actual);
  background: var(--ink);
}
.step.hot .actual {
  background: var(--jade);
}
.step .nums {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  color: var(--slate);
}
.step .nums b {
  color: var(--ink);
  font-weight: 600;
}
.rate {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
}
.rate.good {
  color: var(--jade);
}
.rate.bad {
  color: var(--rust);
}
.legend {
  display: flex;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  margin-top: 12px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
}
.legend .a {
  background: var(--ink);
}
.legend .g {
  background: repeating-linear-gradient(135deg, #dde2eb 0 4px, #f2f4f8 4px 8px);
}

/* rows + chips */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.stat-row:last-child {
  border-bottom: 0;
}
.stat-row .k {
  font-size: 13px;
  color: var(--slate);
}
.stat-row .v {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid;
  white-space: nowrap;
}
.chip.jade {
  color: var(--jade);
  border-color: #a9d9c9;
  background: var(--jade-soft);
}
.chip.rust {
  color: var(--rust);
  border-color: #ebb6a8;
  background: var(--rust-soft);
}
.chip.amber {
  color: var(--amber);
  border-color: #e7ce97;
  background: var(--amber-soft);
}
.chip.cobalt {
  color: var(--cobalt);
  border-color: #b7c2f6;
  background: var(--cobalt-soft);
}
.chip.gold {
  color: var(--gold);
  border-color: #e3ce95;
  background: var(--gold-soft);
}
.chip.slate {
  color: var(--slate);
  border-color: var(--line);
  background: #f5f7fa;
}
.mtg,
.sla-item {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.mtg:last-child,
.sla-item:last-child {
  border-bottom: 0;
}
.mtg .top,
.sla-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.mtg .co,
.sla-item .co {
  font-weight: 500;
  font-size: 14px;
}
.mtg .why,
.sla-item .meta {
  font-size: 12px;
  color: var(--slate);
  margin-top: 3px;
  font-family: var(--mono);
}

/* tables */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search,
select.f {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
}
.search {
  flex: 1;
  min-width: 170px;
}
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 820px;
}
th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: left;
  font-weight: 500;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fb;
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f5;
  font-size: 14px;
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
.clickable {
  cursor: pointer;
}
tbody tr.clickable:hover {
  background: #f7f8fb;
}
.tel {
  font-family: var(--mono);
  font-size: 13px;
}
.co-name {
  font-weight: 500;
}
.co-sub {
  font-size: 12px;
  color: var(--slate);
  margin-top: 2px;
  max-width: 300px;
}
.btn {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  padding: 8px 14px;
  font-weight: 500;
  font-size: 13px;
}
.btn:hover {
  background: var(--ink-soft);
}
.btn.ghost {
  background: #fff;
  color: var(--ink);
}
.btn.ghost:hover {
  background: #f2f4f8;
}
.btn.small {
  padding: 5px 10px;
  font-size: 12px;
}
.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
}
.btn.danger {
  background: var(--rust);
  border-color: var(--rust);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--slate);
  font-size: 14px;
}
.empty b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 6px;
}

/* kanban */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(206px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
@media (max-width: 900px) {
  .board {
    grid-template-columns: repeat(5, 78vw);
  }
}
.col {
  background: #e1e5ec;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  min-height: 330px;
}
.col.over {
  background: var(--cobalt-soft);
  border-color: var(--cobalt);
}
.col.win.over {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid #cfd5df;
}
.col-head .t {
  font-size: 13px;
  font-weight: 700;
}
.col-head .c {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
}
.lead {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px;
  margin-bottom: 9px;
  cursor: grab;
}
.lead.dragging {
  opacity: 0.4;
}
.lead .co {
  font-weight: 500;
  font-size: 14px;
}
.lead .ct {
  font-size: 12px;
  color: var(--slate);
  margin-top: 2px;
}
.lead .tel {
  margin-top: 6px;
}
.lead .note {
  font-size: 12px;
  color: var(--slate);
  margin-top: 7px;
  border-left: 2px solid var(--line);
  padding-left: 8px;
}
.lead .foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.move {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.move button,
.icon {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  border-radius: 3px;
  width: 24px;
  height: 24px;
  line-height: 1;
  font-family: var(--mono);
  padding: 0;
}
.move button:hover:not(:disabled),
.icon:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.hint {
  font-size: 12px;
  color: var(--slate);
  margin: 0;
  font-family: var(--mono);
}

/* team */
.team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}
.rep {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px;
  background: #fff;
}
.rep .hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.rep .av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #edf0f5;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.rep .nm {
  font-weight: 700;
  font-size: 14px;
}
.rep .tm {
  font-size: 11px;
  color: var(--slate);
  font-family: var(--mono);
}
.mini {
  margin-top: 9px;
}
.mini .lb {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 4px;
}
.mini .lb b {
  font-family: var(--mono);
  color: var(--ink);
}
.mini .bar {
  height: 6px;
  background: #edf0f5;
  border-radius: 99px;
  overflow: hidden;
}
.mini .fill {
  height: 100%;
  background: var(--ink);
}
.mini.x .fill {
  background: var(--cobalt);
}
.mini.done .fill {
  background: var(--jade);
}

/* forms */
.form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
@media (max-width: 700px) {
  .form {
    grid-template-columns: 1fr 1fr;
  }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field.wide {
  grid-column: 1/-1;
}
.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
}
.field label b {
  color: var(--rust);
  font-weight: 400;
}
.field input,
.field select {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 11px;
  font-size: 14px;
  background: #fff;
  width: 100%;
}
.field input:focus,
.field select:focus,
.search:focus,
textarea:focus {
  border-color: var(--cobalt);
  outline: none;
  box-shadow: 0 0 0 3px var(--cobalt-soft);
}
.field.bad input {
  border-color: var(--rust);
  background: var(--rust-soft);
}
.field select:disabled,
.field input:disabled {
  background: #edf0f5;
  color: var(--slate);
  cursor: not-allowed;
}
.lockrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--slate);
}
.formfoot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr;
  }
}
.dropzone {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 14px;
  background: #f7f8fb;
}
.dropzone code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  display: block;
  margin-bottom: 9px;
}
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px;
  font-size: 14px;
  min-height: 104px;
  resize: vertical;
  background: #fff;
}
.dropzone textarea {
  min-height: 130px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}
.result {
  margin-top: 12px;
  font-size: 13px;
}
.result .row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}

/* prompts */
.prompts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.pcard {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.pcard h3 {
  margin-bottom: 6px;
}
.pcard .pv {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--slate);
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 11px;
  margin: 10px 0;
  max-height: 168px;
  overflow: auto;
  white-space: pre-wrap;
}
.pcard .pf {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

/* mail */
.mail {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.mail-hd {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.mail-hd .rowm {
  display: flex;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
  flex-wrap: wrap;
  align-items: baseline;
}
.mail-hd .lbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--slate);
  width: 56px;
  flex: none;
  text-transform: uppercase;
}
.mail-hd .subj {
  font-weight: 700;
  font-size: 15px;
}
.mail-bd {
  padding: 18px;
}
.mail-bd p {
  margin: 0 0 12px;
  font-size: 14px;
}
.sendbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* drawer + modal */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 38, 0.55);
  z-index: 60;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  background: #fff;
  z-index: 70;
  overflow-y: auto;
  border-left: 1px solid var(--line);
}
.dr-hd {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
}
.dr-bd {
  padding: 18px;
}
.dr-sec {
  margin-bottom: 20px;
}
.log {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  align-items: center;
}
.log:last-child {
  border-bottom: 0;
}
.log .tm {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
}
.log .du {
  font-family: var(--mono);
  font-size: 12px;
}
.log.meeting-log {
  grid-template-columns: minmax(10ch, max-content) minmax(0, 1fr) auto;
}
.meeting-log .tm {
  line-height: 1.6;
}
.meeting-log .meeting-date,
.meeting-log .meeting-time {
  display: block;
  white-space: nowrap;
}
.modalwrap {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 80;
}
.modal {
  background: #fff;
  border-radius: var(--r);
  width: 100%;
  max-width: 520px;
  padding: 22px;
  border-top: 3px solid var(--cobalt);
  max-height: 88vh;
  overflow: auto;
}
.modal p {
  margin: 0 0 14px;
  color: var(--slate);
  font-size: 13px;
}
.err {
  color: var(--rust);
  font-size: 12px;
  margin-top: 7px;
  font-family: var(--mono);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

/* 成交慶祝 */
.win-modal {
  text-align: center;
  border-top-color: var(--gold);
  max-width: 460px;
}
.win-modal .emoji {
  font-size: 44px;
  line-height: 1;
}
.win-modal h2 {
  font-size: 20px;
  margin: 10px 0 4px;
}
.win-modal .amt {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 46px;
  color: var(--gold);
  letter-spacing: -0.02em;
  margin: 14px 0 2px;
}
.win-modal .cap {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--slate);
  text-transform: uppercase;
}
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}
.confetti i {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 15px;
  opacity: 0.95;
  animation: fall linear forwards;
}
@keyframes fall {
  to {
    transform: translateY(104vh) rotate(760deg);
  }
}
.plans {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
  margin-bottom: 12px;
}
.plan {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r);
  padding: 13px 10px;
  text-align: center;
}
.plan[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.plan b {
  display: block;
  font-family: var(--mono);
  font-size: 18px;
}
.plan span {
  font-size: 12px;
  color: var(--slate);
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 14px;
  max-width: min(88vw, 540px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
  z-index: 98;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #8fe0c4;
  display: block;
  margin-bottom: 3px;
}
.toast.warn .tag {
  color: #f3b26b;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .confetti {
    display: none;
  }
}

/* ---- 登入頁 ---- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--paper);
}
.login .box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 30px;
  width: 100%;
  max-width: 390px;
}
.login .brand {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}
.login .sub2 {
  color: var(--slate);
  font-size: 13px;
  margin: 4px 0 22px;
}
.login .field {
  margin-bottom: 14px;
}
.login .field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 4px;
}
.login .field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 14px;
}
.login .btn {
  width: 100%;
  padding: 11px;
}
.topbtn.logout {
  background: transparent;
  border: 1px solid #2c3549;
  color: #9aa4bc;
  border-radius: var(--r);
  padding: 7px 12px;
  font-size: 13px;
}
.topbtn.logout:hover {
  background: #2c3549;
  color: #fff;
}

/* ---- 共用日期篩選器 ---- */
.datebar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 11px 13px;
  background: var(--ink);
  border-radius: var(--r);
  color: #fff;
  margin-bottom: 14px;
}
.datebar .lbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aa4bc;
}
.datebar input[type="date"] {
  border: 1px solid #2c3549;
  background: #1b2233;
  color: #fff;
  border-radius: var(--r);
  padding: 7px 10px;
  font-size: 13px;
  color-scheme: dark;
}
.datebar select {
  border: 1px solid #2c3549;
  background: #1b2233;
  color: #fff;
  border-radius: var(--r);
  padding: 7px 10px;
  font-size: 13px;
}
.datebar .nav {
  border: 1px solid #2c3549;
  background: #1b2233;
  color: #c9d2e4;
  border-radius: var(--r);
  width: 32px;
  height: 32px;
  font-family: var(--mono);
  font-size: 14px;
  padding: 0;
}
.datebar .nav:hover {
  background: #2c3549;
  color: #fff;
}
.datebar .quick {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.datebar .quick button {
  border: 1px solid #2c3549;
  background: #1b2233;
  color: #9aa4bc;
  border-radius: 99px;
  padding: 5px 11px;
  font-family: var(--mono);
  font-size: 12px;
}
.datebar .quick button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.datebar .span {
  font-family: var(--mono);
  font-size: 12px;
  color: #9aa4bc;
  margin-left: auto;
}
.datebar .sep {
  width: 1px;
  height: 24px;
  background: #2c3549;
}

/* ---- 期間統計卡 ---- */
.actgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.actbox {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 12px 14px;
}
.actbox .k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--slate);
  text-transform: uppercase;
}
.actbox .v {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  margin-top: 3px;
}
.actbox .sub2 {
  font-size: 11px;
  color: var(--slate);
  margin-top: 2px;
}
.actbox.gold .v {
  color: var(--gold);
}
.actbox.cob .v {
  color: var(--cobalt);
}
.srcrow {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ---- 失單 / 二手 / 退回 ---- */
.lost-banner {
  background: var(--rust-soft);
  border: 1px solid #ebb6a8;
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.lost-banner .t {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--rust);
  font-weight: 700;
  margin-bottom: 5px;
}
.reasonpick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.reasonpick button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--slate);
}
.reasonpick button[aria-pressed="true"] {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
  font-weight: 500;
}
.reasonpick.blue button[aria-pressed="true"] {
  background: var(--cobalt);
  border-color: var(--cobalt);
}
.preview {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #f7f8fb;
  padding: 13px;
  margin-bottom: 12px;
}
.preview .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}
.preview .row:last-child {
  border-bottom: 0;
}
.preview .row .k {
  color: var(--slate);
}
.preview .row .v {
  font-family: var(--mono);
  text-align: right;
  max-width: 65%;
}
.warnbox {
  background: var(--rust-soft);
  border: 1px solid #ebb6a8;
  border-radius: var(--r);
  padding: 11px 13px;
  color: var(--rust);
  font-size: 13px;
  margin-bottom: 12px;
}
.hand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid #e7ce97;
  background: var(--amber-soft);
  color: var(--amber);
}

/* ---- 交叉表 ---- */
.xtab {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 13px;
}
.xtab th,
.xtab td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf0f5;
  text-align: center;
}
.xtab th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--slate);
  background: #f7f8fb;
  font-weight: 500;
}
.xtab td:first-child,
.xtab th:first-child {
  text-align: left;
  font-weight: 500;
}
.xtab td.cell {
  cursor: pointer;
  font-family: var(--mono);
}
.xtab td.cell:hover {
  background: var(--cobalt-soft);
}
.xtab td.cell .r {
  display: block;
  font-size: 11px;
  color: var(--slate);
}
.xtab td.cell.lo {
  color: var(--rust);
}
.xtab td.cell.hi {
  color: var(--jade);
}
.xtab tr.tot td {
  background: #f7f8fb;
  font-weight: 700;
}
.xtab td.empty {
  color: #c9d0db;
}
.grouplbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 16px 0 8px;
}
.painlist .item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.painlist .item:last-child {
  border-bottom: 0;
}
.painlist .hd {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}
.painlist .pain {
  font-size: 14px;
  margin-top: 4px;
  padding-left: 9px;
  border-left: 2px solid var(--line);
}
.painlist .pain.thin {
  color: var(--rust);
  border-left-color: var(--rust);
}
.ckbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.ckbar:last-child {
  border-bottom: 0;
}
.ckbar .t {
  flex: 1;
  font-size: 13px;
}
.ckbar .bar {
  width: 140px;
  height: 8px;
  background: #edf0f5;
  border-radius: 99px;
  overflow: hidden;
}
.ckbar .bar i {
  display: block;
  height: 100%;
  background: var(--cobalt);
}
.ckbar .n {
  font-family: var(--mono);
  font-size: 12px;
  width: 28px;
  text-align: right;
}
.fc-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.fc-row:last-child {
  border-bottom: 0;
}
.fc-row .d {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
}
.fc-row.overdue .d {
  color: var(--rust);
  font-weight: 700;
}
.fc-row .nx {
  font-size: 13px;
  color: var(--cobalt);
}
.reclaim-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 12px;
  margin-bottom: 9px;
}
.reclaim-card.frozen {
  opacity: 0.7;
  background: #f7f8fb;
}
.reclaim-card .hd {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.reclaim-card .co {
  font-weight: 600;
  flex: 1;
}
.reclaim-card .meta {
  font-size: 12px;
  color: var(--slate);
  margin-top: 3px;
}
.reclaim-card .act {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  align-items: center;
  flex-wrap: wrap;
}

:root {
  --paper: #e9ecf1;
  --card: #ffffff;
  --ink: #121826;
  --ink-soft: #2a3245;
  --slate: #69738a;
  --line: #d5dae3;
  --cobalt: #2b4be0;
  --cobalt-soft: #e5e9fd;
  --jade: #0b7a5d;
  --jade-soft: #dff1ea;
  --amber: #b87a0b;
  --amber-soft: #fbf0da;
  --rust: #b93b22;
  --rust-soft: #fae6e1;
  --gold: #b8860b;
  --gold-soft: #fbf3dc;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --r: 4px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

/* Administrator settings */
#settingsForm {
  display: grid;
  gap: 18px;
}
#settingsForm h3 {
  margin: 0 0 14px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 14px 0;
}
#settingsForm .field {
  margin: 0;
}
#settingsForm .field label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--slate);
}
#settingsForm input:not([type="checkbox"]),
#settingsForm select {
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--ink);
}
.setting-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: end;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.setting-row .field {
  flex: 1;
  min-width: 160px;
}
.setting-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  margin: 12px 0;
}
.settings-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -3px 18px #12182612;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.settings-actions .err {
  flex-basis: 100%;
}
@media (max-width: 540px) {
  .setting-row .field {
    min-width: 100%;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Header actions and dropdown share one positioning anchor. */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  max-width: 100%;
}
.header-actions .roles {
  margin: 0;
  padding: 0;
  gap: 10px;
}
.header-actions .who {
  border: 0;
  padding: 0;
  min-width: 0;
}
.header-actions .profile-trigger {
  display: block;
  padding: 4px 0;
  border: 0;
  border-radius: 3px;
  color: white;
  text-align: left;
  background: none;
  max-width: 160px;
}
.profile-trigger #whoName {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-trigger:hover #whoName {
  text-decoration: underline;
}
.quick-links {
  position: relative;
  flex-shrink: 0;
}
.quick-links .drivemenu {
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  max-width: calc(100vw - 40px);
  min-width: 0;
}
.person-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--cobalt);
  font: inherit;
  font-weight: 600;
  text-align: left;
}
.person-link:hover {
  text-decoration: underline;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
#profileForm .field,
#accountForm .field {
  margin: 12px 0;
}
#profileForm input,
#accountForm input:not([type="checkbox"]),
#accountForm select {
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
#profileForm label,
#accountForm .field label {
  display: block;
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 6px;
}
.account-notice {
  padding: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  margin: 16px 0;
}
@media (max-width: 600px) {
  .header-actions {
    width: 100%;
    gap: 8px;
  }
  .header-actions .roles {
    flex: 1;
    gap: 8px;
  }
  .header-actions .profile-trigger {
    max-width: 120px;
  }
  .header-actions .logout {
    padding: 6px 9px;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
}
.password-control {
  position: relative;
}
.password-control input {
  padding-right: 48px;
  width: 100%;
}
.password-control button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--slate);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.password-control button[aria-pressed="true"] {
  color: var(--jade);
}
.pwa-install {
  display: block;
  margin: 24px auto;
}

#profileBtn {
  background: transparent;
  color: white;
  cursor: pointer;
  text-align: left;
}
.tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
}
.tab {
  flex-shrink: 0;
}
#settingsForm textarea {
  width: 100%;
  padding: 12px;
}

.rule-description {
  flex: 2 !important;
  min-width: 240px !important;
}
.rule-order {
  align-self: center;
  color: var(--slate);
  font-family: var(--mono);
}
#settingsForm h4 {
  margin: 18px 0 8px;
}
#settingsForm textarea {
  font: inherit;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
}
@media (max-width: 600px) {
  .rule-description {
    min-width: 100% !important;
  }
}

.login .brand {
  font-family: inherit;
  font-size: clamp(20px, 4vw, 24px);
  letter-spacing: 0.03em;
  line-height: 1.5;
}
.wordmark b {
  font-family: inherit;
  letter-spacing: 0.02em;
  font-size: 19px;
  white-space: normal;
}
.wordmark {
  min-width: 0;
}
@media (max-width: 600px) {
  .wordmark b {
    font-size: 16px;
  }
}

.meeting-summary {
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.meeting-summary:hover,
.meeting-summary:focus-visible {
  border-color: var(--cobalt);
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

/* Daily development report keeps labels readable on narrow screens. */
.development-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--slate);
}
.development-filters input,
.development-filters select {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
}
.development-filters .btn {
  align-self: flex-end;
}
.development-table {
  min-width: 1700px;
}
.development-table th,
.development-table td {
  white-space: nowrap;
}
.development-table .btn {
  min-width: 36px;
}
