/* ============================================================
   LogiERP · style C screens
   Depends on app.css (theme C tokens)
   ============================================================ */

body { background: var(--bg); }

/* ---------- shared ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hello h1 { font-size: 26px; }
.hello .date { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card-head .more { font-size: 11.5px; color: var(--brand); }
.card-body { padding: 4px 0; }

/* ---------- workbench ---------- */
.todo-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line-soft);
}
.todo-row:last-child { border-bottom: 0; }
.todo-ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 7px;
  display: grid; place-items: center; background: var(--brand-weak); color: var(--brand);
}
.todo-ico.warn { background: var(--pill-warn-bg); color: var(--pill-warn-text); }
.todo-ico.danger { background: var(--pill-danger-bg); color: var(--pill-danger-text); }
.todo-ico.ok { background: var(--pill-ok-bg); color: var(--pill-ok-text); }
.todo-ico svg { width: 15px; height: 15px; }
.todo-main { min-width: 0; }
.todo-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-right { margin-left: auto; text-align: right; flex: 0 0 auto; }
.todo-time { font-size: 11px; color: var(--muted); }
.todo-time.hot { color: var(--danger); }

.alert-item { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.alert-item:last-child { border-bottom: 0; }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-top: 6px; flex: 0 0 7px; }
.alert-dot.warn { background: var(--warning); }
.alert-title { font-size: 12.5px; font-weight: 600; }
.alert-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.train-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); }
.train-row:last-child { border-bottom: 0; }
.train-time { font-family: var(--font-num); font-size: 12px; color: var(--brand); width: 42px; flex: 0 0 42px; }
.train-main { min-width: 0; }
.train-title { font-size: 12.5px; font-weight: 600; }
.train-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.train-tag { margin-left: auto; font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }

/* ---------- detail ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 14px; }
.back {
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--muted); display: grid; place-items: center; flex: 0 0 32px;
}
.back svg { width: 15px; height: 15px; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h1 { font-size: 23px; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; }
.detail-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-top: 16px;
}
.meta-item { background: var(--surface); padding: 12px 15px; }
.meta-label { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.meta-value { font-size: 13px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.meta-value.num { font-family: var(--font-num); }
.meta-value.muted { font-weight: 500; color: var(--muted); }

.detail-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 20px 0 16px; }
.detail-tab { padding: 9px 0 10px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.detail-tab.active { color: var(--text); border-color: var(--brand); font-weight: 600; }

/* timeline */
.timeline { padding: 14px 18px 6px; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 17px; }
.tl-item:before {
  content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--line);
}
.tl-item:last-child:before { display: none; }
.tl-dot {
  width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); position: relative; z-index: 1;
}
.tl-dot.done { background: var(--brand); border-color: var(--brand); }
.tl-dot.done:after {
  content: ""; position: absolute; inset: 4px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12 4 4 10-10'/></svg>") center/10px no-repeat;
}
.tl-dot.current { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-weak); }
.tl-body { flex: 1; min-width: 0; padding-top: 1px; }
.tl-title { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tl-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tl-note { font-size: 11px; color: var(--faint); margin-top: 2px; }
.tl-tag { font-size: 9.5px; color: var(--brand); background: var(--brand-weak); border-radius: 4px; padding: 1px 5px; font-weight: 500; }

/* doc checklist */
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.doc-row:last-child { border-bottom: 0; }
.doc-ico { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; display: grid; place-items: center; }
.doc-ico.ok { background: var(--pill-ok-bg); color: var(--pill-ok-text); }
.doc-ico.warn { background: var(--pill-warn-bg); color: var(--pill-warn-text); }
.doc-ico.todo { background: var(--surface-3); color: var(--faint); }
.doc-ico svg { width: 11px; height: 11px; }
.doc-state { margin-left: auto; font-size: 10.5px; }

/* next step */
.next-step { padding: 16px 18px 18px; }
.next-kicker { font-size: 10.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.next-title { font-size: 16px; font-weight: 650; margin-top: 6px; }
.next-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.next-step .btn { margin-top: 14px; width: 100%; justify-content: center; }

/* ---------- documents table ---------- */
.filter-row { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; }
.filter-row .spacer { margin-left: auto; }
.table-card.standalone { border-top: 1px solid var(--line); border-radius: var(--radius); }
.doc-type { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.doc-type svg { width: 14px; height: 14px; color: var(--muted); }

/* ---------- mini program ---------- */
.mp-page { background: #E9EDF3; min-height: 100vh; padding: 42px 0 24px; }
.mp-head { text-align: center; margin-bottom: 26px; }
.mp-head h1 { font-size: 24px; }
.mp-head p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.phones { display: flex; gap: 56px; justify-content: center; align-items: flex-start; }
.phone-wrap { width: 360px; }
.phone-label { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.phone-label b { color: var(--text); }
.phone {
  width: 360px; height: 744px; background: #0B1220; border-radius: 40px; padding: 10px;
  box-shadow: 0 24px 60px rgba(15,23,42,.18); position: relative;
}
.screen {
  width: 340px; height: 724px; background: #F4F6F9; border-radius: 30px;
  overflow: hidden; position: relative;
}
.statusbar { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-size: 11px; color: var(--text); }
.statusbar .sig { letter-spacing: 2px; font-size: 9px; }
.mp-header { padding: 6px 16px 12px; }
.mp-title { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.mp-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.lang-chip {
  float: right; font-size: 10.5px; color: #fff; background: var(--brand);
  border-radius: 999px; padding: 4px 9px; margin-top: 2px;
}
.mp-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  margin: 0 12px 10px; padding: 12px 13px; box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.mp-top { display: flex; align-items: center; gap: 8px; }
.mp-id { font-family: var(--font-num); font-size: 11px; color: var(--muted); }
.mp-route { font-size: 14.5px; font-weight: 650; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.mp-route .arw { color: var(--faint); font-size: 12px; }
.mp-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.mp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.mp-eta { font-size: 11px; color: var(--muted); }
.mp-eta b { color: var(--text); font-family: var(--font-num); font-weight: 600; }
.mp-btn {
  font-size: 11px; color: var(--brand); background: var(--brand-weak);
  border-radius: 7px; padding: 6px 12px; font-weight: 600;
}
.mp-nav {
  position: absolute; left: 0; right: 0; bottom: 0; height: 58px; background: #fff;
  border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-around;
  font-size: 10px; color: var(--faint);
}
.mp-nav .on { color: var(--brand); font-weight: 600; }
.mp-nav .item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mp-nav svg { width: 18px; height: 18px; }
.thai { font-family: "Leelawadee UI", "Tahoma", "Noto Sans Thai", sans-serif; }
.thai .mp-route { font-size: 15px; }
.thai .mp-title { font-size: 20px; }
.mp-note { text-align: center; font-size: 11px; color: var(--muted); margin-top: 20px; }

/* ---------- mini portal: container query ---------- */
.phones.four { gap: 18px; }
.mp-summary { margin: 0 12px 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.mp-big { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mp-big small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.mp-sum-label { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.mp-stats { display: flex; gap: 0; margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.mp-stat { flex: 1; }
.mp-stat + .mp-stat { border-left: 1px solid var(--line-soft); padding-left: 10px; }
.mp-stat b { display: block; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mp-stat span { font-size: 10px; color: var(--muted); }
.mp-stat .red { color: var(--danger); }
.mp-section { display: flex; align-items: center; justify-content: space-between; margin: 12px 16px 7px; }
.mp-section h3 { margin: 0; font-size: 12.5px; font-weight: 650; }
.mp-section span { font-size: 10px; color: var(--muted); }
.mp-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin-top: 10px; }
.mp-kv .k { font-size: 9.5px; color: var(--muted); }
.mp-kv .v { font-size: 11.5px; font-weight: 600; margin-top: 1px; }
.mp-kv .v.num { font-family: var(--font-num); }
.mp-temp-now { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.mp-temp-now b { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mp-temp-now span { font-size: 11px; color: var(--muted); }
.mp-tl { margin-top: 4px; }
.mp-tl-row { display: flex; gap: 9px; position: relative; padding-bottom: 12px; }
.mp-tl-row:before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.mp-tl-row:last-child:before { display: none; }
.mp-tl-dot { width: 13px; height: 13px; flex: 0 0 13px; border-radius: 50%; border: 2px solid var(--line); background: #fff; margin-top: 2px; z-index: 1; }
.mp-tl-dot.done { background: var(--brand); border-color: var(--brand); }
.mp-tl-dot.now { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.mp-tl-dot.hot { background: var(--danger); border-color: var(--danger); }
.mp-tl-body { min-width: 0; }
.mp-tl-title { font-size: 11.5px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.mp-tl-meta { font-size: 10px; color: var(--muted); margin-top: 1px; }
.mp-tl-temp { margin-left: auto; font-size: 10px; color: var(--muted); font-family: var(--font-num); }
.mp-tl-temp.hot { color: var(--danger); font-weight: 600; }
.mp-chart { margin: 4px 0 2px; }
.mp-chart svg { width: 100%; height: auto; display: block; }
.mp-chart-legend { display: flex; gap: 14px; font-size: 9.5px; color: var(--muted); margin-top: 6px; }
.mp-chart-legend i { display: inline-block; width: 14px; height: 6px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.mp-alert-row { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 9px; border-radius: 7px; background: var(--pill-danger-bg); color: var(--pill-danger-text); font-size: 10.5px; }
.mp-alert-row b { font-weight: 650; }
