/* 门户在发票工具样式（app.css）之上的补充：登录页、时间线、仪表盘图、手机适配 */

/* 未登录：隐藏外壳，只留登录卡 */
body.auth-only .sidebar, body.auth-only .topbar { display: none; }
body.auth-only .main { margin-left: 0; padding: 0; min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login-wrap { width: min(400px, 94vw); }
.login-card { background: var(--panel); border-radius: 6px; padding: 28px 28px 22px; box-shadow: 0 15px 35px rgba(20, 28, 52, .12); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-brand .brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--primary-500); color: #fff; display: grid; place-items: center; }
.login-brand h1 { margin: 0; font-size: 18px; font-weight: 600; }
.login-brand .muted { font-size: 12px; }
.login-card .input { height: 36px; font-size: 13px; }
.login-card .btn-primary { width: 100%; height: 36px; font-size: 13px; margin-top: 4px; }
.login-foot { margin-top: 14px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.login-err { margin: 0 0 10px; }

/* 顶栏 */
.top-right .btn-ghost { height: 28px; }
#global-search::placeholder { color: var(--gray-500); }

/* 订单列表 */
.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 22px; background: var(--panel); font-size: 12px; cursor: pointer; color: var(--fg); }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--gray-900); border-color: var(--gray-900); color: #fff; }
.chip .n { font-size: 11px; font-weight: 600; padding: 0 5px; border-radius: 10px; background: var(--gray-100); color: var(--fg); }
.chip.on .n { background: rgba(255, 255, 255, .25); color: #fff; }
.view-tabs { display: inline-flex; gap: 2px; background: var(--gray-100); border-radius: 4px; padding: 2px; }
.view-tabs .btn { height: 26px; border: 0; background: transparent; }
.view-tabs .btn.on { background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 600; }
.table td.mono, .mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.table tbody tr.row-blocked td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tbody tr.row-done td { color: var(--muted); }
.cell-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 详情弹窗（PortPro Load 详情那种整页灰底白卡） */
.lp { display: flex; gap: 10px; width: 100%; min-height: 0; }
.lp-main { flex: 1 1 auto; min-width: 0; overflow-y: auto; }
.lp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.lp-grid .form-section { margin: 0; }
.date-list { display: grid; grid-template-columns: 1fr; gap: 0; }
.date-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.date-row:last-child { border-bottom: 0; }
.date-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gray-200); flex: 0 0 auto; }
.date-row.is-set .dot { background: var(--accent); }
.date-row.is-cur .dot { background: var(--warn-bg, #f19c38); box-shadow: 0 0 0 3px rgba(241, 156, 56, .25); }
.date-row .k { flex: 1 1 auto; color: var(--fg-soft); }
.date-row .v { font-weight: 500; font-variant-numeric: tabular-nums; }
.date-row .v.muted { font-weight: 400; }
.banner-blocked { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 3px; background: #fdecea; border: 1px solid var(--danger); color: var(--danger); margin-bottom: 15px; }
.banner-blocked b { font-weight: 600; }
.banner-blocked .muted { color: #9b3b32; }
.banner-ok { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 3px; background: #edf8e8; border: 1px solid #65ca44; color: #2e6b1c; margin-bottom: 15px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 12px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 14px; bottom: -2px; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .tl-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.timeline .tl-who { color: var(--muted); font-size: 11px; }
.timeline .tl-body { color: var(--fg-soft); margin-top: 2px; white-space: pre-wrap; }
.timeline .tl-state { font-size: 10.5px; }

/* 仪表盘 */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 15px; }
.kpi { background: var(--panel); border-radius: 3px; padding: 12px 14px; }
.kpi .k { font-size: 12px; color: var(--gray-400); }
.kpi .v { font-size: 22px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi.is-warn .v { color: var(--warn); }
.kpi.is-danger .v { color: var(--danger); }
.kpi.is-ok .v { color: var(--ok); }
.chart-card { background: var(--panel); border-radius: 3px; padding: 14px 16px 8px; margin-bottom: 15px; }
.chart-card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; }
.bar-seg { width: 100%; }
.bar-seg.login { background: #377df6; } .bar-seg.view { background: #98b9fb; } .bar-seg.update { background: #f19c38; }
.bar-lbl { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.temp-pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; padding: 8px 12px; background: var(--gray-50); border: 1px dashed var(--border-strong); border-radius: 3px; user-select: all; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs .btn { border: 0; border-radius: 0; background: transparent; border-bottom: 2px solid transparent; height: 34px; }
.tabs .btn.on { border-bottom-color: var(--accent); font-weight: 600; }

/* 手机 */
@media (max-width: 720px) {
  :root { --side-w: 0px; --side-cur: 0px; }
  .sidebar { display: none; }
  .topbar { left: 0; padding: 0 12px; gap: 8px; }
  .top-search { flex: 1 1 auto; }
  .top-company { display: none; }
  .main { margin-left: 0; padding: calc(var(--top-h) + 8px) 10px 70px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--panel); border-top: 1px solid var(--border); z-index: 45; }
  .mobile-nav a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 8px; font-size: 10.5px; color: var(--muted); text-decoration: none; }
  .mobile-nav a.active { color: var(--accent); }
  .lp { flex-direction: column; }
  .lp-left { flex: none; width: auto; }
  .lp-grid, .two-col { grid-template-columns: 1fr; }
  .modal-page-backdrop { padding: 0; }
  .modal.modal-page { border-radius: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 721px) { .mobile-nav { display: none; } }
