/* Aoteng MES board: presentation layer only. Load after the original styles. */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --card-solid: #ffffff;
  --border: #e2e8f0;
  --accent: #173f75;
  --accent-light: #eaf0f8;
  --text: #14243b;
  --text2: #64748b;
  --blue: #2862a3;
  --green: #168465;
  --red: #c93a45;
  --orange: #b56b22;
  --yellow: #9b771b;
  --cyan: #187b8b;
  --purple: #7059a2;
  --pink: #b45179;
  --violet: #7059a2;
  --header-bg: #ffffff;
  --shadow: 0 2px 6px rgb(23 46 77 / 3%);
  --shadow-lg: 0 12px 32px rgb(23 46 77 / 9%);
  --ui-sidebar-width: 208px;
}

html { background: var(--bg); }
body {
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}
body, .main-container { width: 100%; height: 100vh; height: 100dvh; }
.main-container { min-height: 0; }
.main-content, .content-area { min-width: 0; min-height: 0; }
.main-content { background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, [onclick] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, [onclick]:focus-visible, a:focus-visible {
  outline: 3px solid #91add2;
  outline-offset: 3px;
}
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .58; }
input, select, textarea { accent-color: var(--accent); }
::selection { background: #dce7f5; color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: #c8d2df transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #c8d2df; border: 2px solid transparent; background-clip: padding-box; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* Persistent navigation: every original item and click target is retained. */
.sidebar {
  width: var(--ui-sidebar-width);
  padding: 20px 14px;
  gap: 5px;
  align-items: stretch;
  background: #ffffff;
  border-right: 1px solid var(--border);
  backdrop-filter: none;
  overflow-y: auto;
  overflow-x: hidden;
}
.ui-sidebar-brand {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 1px 10px;
  align-items: center;
  padding: 2px 5px 24px;
  margin: 0 0 17px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.ui-sidebar-brand img { grid-row: 1 / 3; width: 54px; height: 43px; object-fit: contain; background: #fff; }
.ui-sidebar-brand strong { align-self: end; color: var(--accent); font-size: 18px; font-weight: 700; letter-spacing: .1px; }
.ui-sidebar-brand small { align-self: start; color: #8590a0; font-size: 10px; letter-spacing: 1px; }
.sidebar-item {
  position: relative;
  width: 100%;
  min-height: 48px;
  height: auto;
  flex-shrink: 0;
  flex-direction: row;
  justify-content: flex-start;
  gap: 13px;
  margin-bottom: 0;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #64748b;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.sidebar-item .si-icon { width: 20px; height: 20px; margin-bottom: 0; flex-shrink: 0; font-size: 19px; line-height: 20px; }
.sidebar-item .si-label { text-align: left; font-size: 13px; font-weight: 600; line-height: 1.4; letter-spacing: .1px; }
.sidebar-item:hover { background: #f1f5fa; color: var(--accent); }
.sidebar-item.active { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 8px rgb(23 63 117 / 12%); }
.sidebar-item.active .si-label { font-weight: 650; }

/* Stable header hierarchy separates branding, time and utility actions. */
.top-bar {
  min-height: 84px;
  height: auto;
  padding: 14px 30px;
  gap: 22px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgb(23 46 77 / 2%);
}
.top-bar-left { min-width: 0; gap: 12px; }
.top-bar-left .logo { display: inline-flex; align-items: center; justify-content: center; width: 51px; height: 43px; flex-shrink: 0; font-size: 23px; }
.top-bar-left .logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.top-bar-left .title {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .1px;
  line-height: 1.45;
}
.top-bar-center { flex-shrink: 0; padding-inline: 12px; text-align: center; }
.top-bar-center .clock { font-size: 25px; line-height: 1.2; font-weight: 650; letter-spacing: 1px; color: var(--accent); }
.top-bar-center .date { margin-top: 4px; color: #8490a1; font-size: 11px; }
.top-bar-right { flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; max-width: 450px; font-size: 11px; }
.top-bar-right > span:first-child { white-space: nowrap; }
.top-bar-right .refresh-time { font-variant-numeric: tabular-nums; color: var(--text2); }
.fullscreen-hint { min-height: 32px; display: inline-flex; align-items: center; padding: 6px 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; color: #53657d; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.fullscreen-hint:hover { background: var(--accent-light); border-color: #b8cae0; color: var(--accent); }

.page-view { padding: 26px 30px 88px; overflow-x: hidden; overscroll-behavior: contain; }
.dashboard-header { min-height: 40px; margin-bottom: 22px; gap: 16px; }
.dashboard-header .dh-title { color: var(--text); font-size: 23px; font-weight: 700; letter-spacing: -.3px; }
.section-title { min-width: 0; margin: 28px 0 16px; gap: 9px; color: var(--text); font-size: 16px; font-weight: 700; flex-wrap: wrap; }
.page-view > .section-title:first-child { margin: 0 0 24px; font-size: 23px; letter-spacing: -.3px; }
.section-title .st-icon { font-size: 18px; }
.section-title > span[id] { margin-left: 2px !important; padding: 2px 8px; border-radius: 5px; background: #e9eef5; color: var(--text2); font-size: 11px !important; }
.scroll-control { background: #fff; border: 1px solid var(--border); padding: 5px 6px 5px 12px; border-radius: 8px; gap: 12px; box-shadow: var(--shadow); color: var(--text2); }
.scroll-control .sc-label { color: #44576f; font-size: 12px; }
.scroll-control .sc-speed { gap: 6px; }
.scroll-control .sc-speed select { border-radius: 5px; min-height: 28px; padding: 2px 8px; }
.scroll-control button { min-height: 29px; padding: 5px 12px; border-radius: 5px; background: var(--accent); color: #fff; font-weight: 600; }
.scroll-control button:hover { background: #22528f; }
.scroll-control button.paused { background: #eef2f7; color: #63748a; }

/* KPI cards retain the original semantic colors but use a common typographic grid. */
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 27px; }
.kpi-card {
  --kpi-color: var(--blue);
  --kpi-soft: #edf3fa;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  grid-template-rows: auto 1fr auto;
  column-gap: 10px;
  row-gap: 5px;
  min-width: 0;
  min-height: 146px;
  padding: 20px 21px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow);
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.kpi-card.green { --kpi-color: var(--green); --kpi-soft: #edf7f2; }
.kpi-card.red { --kpi-color: var(--red); --kpi-soft: #fcf0f1; }
.kpi-card.yellow { --kpi-color: var(--yellow); --kpi-soft: #faf6ea; }
.kpi-card.cyan { --kpi-color: var(--cyan); --kpi-soft: #edf7f8; }
.kpi-card.purple { --kpi-color: var(--purple); --kpi-soft: #f3f0f8; }
.kpi-card.orange { --kpi-color: var(--orange); --kpi-soft: #fbf4ec; }
.kpi-card.pink { --kpi-color: var(--pink); --kpi-soft: #faf0f4; }
.kpi-card::before { top: 23px; bottom: 23px; left: 0; right: auto; width: 3px; height: auto; background: var(--kpi-color) !important; border-radius: 0 3px 3px 0; }
.kpi-card:hover { transform: translateY(-2px); border-color: #bdcee2; box-shadow: 0 7px 22px rgb(23 46 77 / 8%); }
.kpi-card .kpi-icon { grid-column: 2; grid-row: 1 / 4; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin: 0; border-radius: 10px; background: var(--kpi-soft); color: var(--kpi-color); font-size: 20px; }
.kpi-card .kpi-label { grid-column: 1; grid-row: 1; margin: 0; color: #63748b; font-size: 12px; font-weight: 500; }
.kpi-card .kpi-value { grid-column: 1; grid-row: 2; align-self: center; padding: 2px 0; font-size: 35px; font-weight: 700; letter-spacing: -1.1px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-card .kpi-sub { grid-column: 1 / 3; grid-row: 3; margin: 0; color: #8893a4; font-size: 11px; }

/* Work lists, alert groups and chart surfaces share a quiet, consistent frame. */
.daily-grid { gap: 14px; margin-bottom: 26px; }
.daily-card { padding: 17px 16px 14px; border-radius: 9px; border-top-width: 2px; box-shadow: var(--shadow); }
.daily-card.red { border-top-color: var(--red); box-shadow: var(--shadow); }
.daily-card.orange { border-top-color: var(--orange); }
.daily-card.yellow { border-top-color: var(--yellow); }
.daily-card.green { border-top-color: var(--green); }
.daily-card.blue { border-top-color: var(--blue); }
.daily-card .dc-head { gap: 8px; margin-bottom: 11px; }
.daily-card .dc-title { font-size: 12px; font-weight: 650; }
.daily-card .dc-count { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.daily-card.red .dc-count { color: var(--red); }
.daily-card.orange .dc-count { color: var(--orange); }
.daily-card.yellow .dc-count { color: var(--yellow); }
.daily-card.green .dc-count { color: var(--green); }
.daily-card.blue .dc-count { color: var(--blue); }
.daily-card .dc-list { max-height: 164px; line-height: 1.7; }
.daily-card .dc-item { padding: 7px 5px; gap: 8px; border-bottom: 1px solid #f0f3f7; border-radius: 3px; }
.daily-card .dc-item:last-child { border-bottom-color: transparent; }
.daily-card .dc-item:hover { background: #f3f6fa; }
.daily-card .dc-empty { padding: 19px 6px; color: #8b96a6; }
.chart-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 27px; }
.chart-panel, .report-chart { min-width: 0; padding: 22px 24px; border-radius: 10px; box-shadow: var(--shadow); }
.chart-panel .panel-title, .report-chart .rc-title { margin-bottom: 22px; padding-bottom: 15px; border-bottom: 1px solid #edf1f6; font-size: 14px; font-weight: 650; }
.chart-panel .panel-title .pt-icon { font-size: 17px; }
.chart-panel canvas { width: 100%; max-width: 560px; height: auto; }
.report-chart canvas { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; }
.urgent-list, .pm-list { gap: 16px; }
body .urgent-card, .pm-card { padding: 19px 20px; border-radius: 10px; box-shadow: var(--shadow); background: #fff; }
body .urgent-card { transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
body .urgent-card:hover { transform: translateY(-2px); box-shadow: 0 7px 22px rgb(23 46 77 / 8%); border-color: #b6c9e0; }
.urgent-card.overdue { border-color: #e8bec3; box-shadow: var(--shadow); }
.urgent-card .uc-id, .pm-card .pm-pid { font-size: 13px; line-height: 1.5; }
.urgent-card .uc-name, .pm-card .pm-name { font-size: 13px; margin-top: 5px; line-height: 1.6; }
.urgent-card .uc-client, .pm-card .pm-client { margin-top: 4px; color: #8792a2; }
.urgent-card .uc-deadline { flex-wrap: wrap; gap: 6px 10px; margin-bottom: 13px; padding: 8px 10px; background: #f5f8fc; border-color: #e5ebf3; border-radius: 6px; font-size: 11px; }
.urgent-card .uc-deadline .ucd-date { font-size: 12px; }
.urgent-card .uc-deadline .ucd-days { padding: 2px 7px; background: #e8eff8; border-radius: 4px; font-size: 11px; }
.urgent-card .uc-deadline .ucd-days.warn { background: #fcf1e5; color: var(--orange); }
.urgent-card .uc-deadline .ucd-days.danger { background: #faecee; color: var(--red); }
.urgent-card .uc-step { margin-top: 9px; line-height: 1.6; }
.pm-card { border-left-width: 3px; }
.pm-card.red { border-left-color: var(--red); box-shadow: var(--shadow); }
.pm-card.orange { border-left-color: var(--orange); box-shadow: var(--shadow); }
.pm-card.yellow { border-left-color: var(--yellow); }
.pm-card .pm-equip { color: var(--orange); font-size: 12px; }
.pm-card .pm-problem { padding: 10px; line-height: 1.7; border-radius: 5px; }
.pm-card .pm-meta { font-size: 11px; line-height: 1.6; }
.pm-card .pm-assign { background: #edf2f9; color: var(--accent); border-radius: 4px; }
.pm-empty { background: #f5faf8; border: 1px dashed #c1dfd3; color: #5b8475; border-radius: 9px; padding: 28px; }
.prog-bar { background: #edf1f6; height: 7px; }
.prog-fill { min-width: 0; }
.pipeline-bar { min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: 5px; }
.pipe-seg { border-radius: 5px; height: 36px; }
.pipe-seg.current { box-shadow: 0 0 0 2px #d5e2f1; }

.urgent-badge, .urgency-badge, .as-status, .pm-card .pm-cnt { border-radius: 5px; padding: 4px 8px; font-size: 11px; line-height: 1.4; }
.urgent-badge.red, .urgency-badge.red, .pm-card .pm-cnt { background: #fbecef; color: var(--red); }
.urgent-badge.orange, .urgency-badge.orange, .pm-card .pm-cnt.orange { background: #fcf1e5; color: var(--orange); }
.urgent-badge.yellow, .urgency-badge.yellow, .pm-card .pm-cnt.yellow { background: #faf4e3; color: var(--yellow); }
.as-status.pending { background: #eff2f6; color: #69788b; }
.as-status.dispatched { background: #edf3fb; color: var(--blue); }
.as-status.processing { background: #fcf1e5; color: var(--orange); }
.as-status.verifying { background: #faf4e3; color: var(--yellow); }
.as-status.done { background: #eaf6ef; color: var(--green); }
.warning-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.warning-card { min-width: 0; padding: 23px; border-radius: 10px; box-shadow: var(--shadow); }
.warning-card.red { border-color: #eacbd0; }
.warning-card.orange { border-color: #edd8bd; }
.warning-card.yellow { border-color: #e8dfc3; }
.warning-card .wc-icon { font-size: 21px; }
.warning-card .wc-title { font-size: 14px; }
.warning-card .wc-count { margin: 13px 0; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.warning-card.red .wc-count { color: var(--red); }
.warning-card.orange .wc-count { color: var(--orange); }
.warning-card.yellow .wc-count { color: var(--yellow); }
.warning-card .wc-list { max-height: 280px; }
.warning-item { border-bottom-color: #eaf0f5; line-height: 1.6; padding: 13px 0; }
.warning-item .wi-meta { margin-top: 5px; }

/* Tables scroll inside their existing containers instead of squeezing columns. */
.filter-bar { gap: 10px; padding: 16px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.filter-bar select, .filter-bar input { min-height: 38px; padding: 8px 11px; border-radius: 6px; font-size: 12px; }
.filter-input { flex: 0 1 260px; min-width: 170px; }
.filter-select { min-width: 132px; }
.filter-bar > span[id] { font-size: 12px !important; padding-inline: 5px; }
#page-projects > div:has(> .proj-table), #page-aftersale > div:has(> .as-table), #page-changelog > div:has(> .as-table) { overflow-x: auto !important; border: 1px solid var(--border); border-radius: 9px !important; box-shadow: var(--shadow); }
.proj-table { min-width: 1060px; }
.as-table { min-width: 800px; }
#page-changelog .as-table { min-width: 740px; }
.proj-table, .as-table, body .step-detail-tbl, table.tbl-insert { background: #fff; border-collapse: collapse; }
.proj-table th, .as-table th, body .step-detail-tbl th, table.tbl-insert th { background: #f7f9fc; color: #6b7b91; border-bottom: 1px solid var(--border); padding: 13px 16px; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.proj-table td, .as-table td, body .step-detail-tbl td { padding: 15px 16px; border-bottom: 1px solid #eaf0f5; color: var(--text); line-height: 1.7; font-size: 12px; }
.proj-table tbody tr:last-child > td, .as-table tbody tr:last-child > td { border-bottom: none; }
.proj-table tbody tr:hover, .as-table tbody tr:hover, body .step-detail-tbl tbody tr:hover { background: #f8fafd; }
.proj-table .pid-col { color: var(--accent); font-weight: 650; }
.proj-table .step-col { line-height: 1.7; }
.detail-row { background: #f5f8fc; }
.equip-mini { background: #f1f5fa; padding: 13px; border: 1px solid #e3ebf4; }
.row-action-btn, .expand-btn { min-height: 28px; padding: 4px 8px; font-size: 11px; font-weight: 500; line-height: 1.6; border-radius: 5px; background: #eef3f9; color: var(--accent); border-color: #dce6f2; }
.row-action-btn { margin-top: 2px; margin-bottom: 2px; }
.row-action-btn:hover, .expand-btn:hover { background: #e0eaf6; }
.row-action-btn.green { background: #edf7f1; color: var(--green); border-color: #cce5d8; }
.row-action-btn.orange { background: #fcf3e9; color: var(--orange); border-color: #ecd9c1; }
.row-action-btn.red { background: #fceff0; color: var(--red); border-color: #edccd1; }
.row-action-btn.yellow { background: #fbf6e9; color: var(--yellow); border-color: #e9dfbe; }
.row-action-btn.gray { background: #f2f4f7; color: #6d7d92; border-color: #dce2e9; }
.row-action-btn.green:hover { background: #e1f1e9; }
.row-action-btn.orange:hover { background: #f8e8d6; }
.row-action-btn.red:hover { background: #f6dfe3; }
.row-action-btn.yellow:hover { background: #f5edce; }

.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { min-width: 0; padding: 23px 20px; border-radius: 10px; box-shadow: var(--shadow); }
.stat-card .sc-icon { font-size: 23px; margin-bottom: 10px; }
.stat-card .sc-value { font-size: 32px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .sc-label { margin-top: 7px; }
.sys-section { padding: 24px; margin-bottom: 20px; border-radius: 10px; box-shadow: var(--shadow); }
.sys-section .ss-title { margin-bottom: 20px; font-size: 15px; font-weight: 650; gap: 9px; }
.sys-section .ss-icon { font-size: 19px; }
.sys-actions { gap: 10px; }
.sys-btn { min-height: 38px; border: 1px solid transparent; padding: 9px 16px; gap: 7px; font-size: 12px; font-weight: 600; line-height: 1.5; border-radius: 6px; transition: background .16s, border-color .16s, box-shadow .16s; }
.sys-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 4px rgb(23 63 117 / 8%); }
.sys-btn-primary:hover { background: #24538f; border-color: #24538f; }
.sys-btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.sys-btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.sys-btn-ghost { background: #fff; color: #43566f; border-color: #d9e2ed; }
.sys-btn-ghost:hover { background: #f2f6fa; border-color: #b9cce3; color: var(--accent); }
.sys-stat { padding: 22px 16px; border: 1px solid #e8eef6; border-radius: 8px; background: #f7f9fc; }
.sys-stat .ss-value { font-size: 29px; line-height: 1.2; font-weight: 700; }
.sys-stat .ss-label { margin-top: 8px; }
.empty-state, .no-data { color: #8491a3; line-height: 1.8; }
.empty-state .es-icon { font-size: 43px; }
.empty-state .es-title { color: #526781; font-size: 18px; }

/* Dialogs inherit existing visibility and authorization behavior. */
.modal-mask { background: rgb(18 35 59 / 38%); backdrop-filter: blur(3px); padding: 24px; }
.modal-box { width: min(100%, 760px); max-height: calc(100dvh - 48px); padding: 26px 28px; border-radius: 12px; border-color: #dce4ed; box-shadow: 0 24px 80px rgb(13 33 61 / 20%); overscroll-behavior: contain; }
.modal-title { gap: 9px; margin-bottom: 22px; padding-bottom: 17px; font-size: 18px; font-weight: 700; line-height: 1.5; border-color: #e9eef5; }
.modal-row { gap: 16px; margin-bottom: 16px; }
.modal-field { min-width: 190px; }
.modal-field label { margin-bottom: 7px; color: #596b82; font-size: 12px; font-weight: 550; }
.modal-field input:not([type="checkbox"]), .modal-field select { min-height: 40px; padding: 10px 12px; border-radius: 6px; font-size: 13px; }
.modal-field input[type="checkbox"] { width: auto; min-height: 0; }
.modal-step-row { padding: 12px; gap: 12px; border: 1px solid #e6edf5; border-radius: 7px; background: #f8fafc; }
.modal-step-row select { min-height: 36px; border-radius: 5px; }
.modal-section-title { color: #526780; margin: 23px 0 12px; font-size: 13px; }
.modal-actions { flex-wrap: wrap; gap: 10px; margin-top: 24px; padding-top: 18px; border-color: #e9eef5; }
.checklist-item { min-height: 37px; padding: 8px 10px; }
.checklist-item:hover { background: #edf3fa; }
.tbl-insert-box { width: 1400px; max-width: 100%; max-height: calc(100dvh - 48px); }
.tbl-insert-toolbar { gap: 8px; padding: 0 0 16px; margin-bottom: 16px; }
.tbl-insert-toolbar .ti-tip { line-height: 1.6; }
.tbl-insert-wrap { min-height: 100px; border-radius: 7px; }
table.tbl-insert { min-width: 1000px; }
table.tbl-insert th { padding: 12px 9px; }
table.tbl-insert td { padding: 7px; border-color: #eaf0f5; }
table.tbl-insert input, table.tbl-insert select { min-height: 34px; padding: 7px 8px; border-radius: 5px; }
table.tbl-insert .row-del button { background: #fbedef; border-color: #efd5d9; color: var(--red); }
body .step-detail-tbl { min-width: 600px; }
#stepDetailBody, #kpiDetailBody { overflow-x: auto; }
body .prj-info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
body .prj-info-grid > div { min-width: 0; padding: 13px 14px; border-color: #e6edf5; border-radius: 7px; background: #f7f9fc; }
body .pi-label { margin-bottom: 5px; font-size: 11px; }
body .pi-value { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
body .prj-section-title { margin: 22px 0 12px; padding-bottom: 10px; border-bottom-style: solid; font-size: 14px; }
body .eq-detail-card { padding: 16px; border-color: #e5ecf4; border-radius: 8px; background: #f8fafc; }
body .ed-pipeline { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
body .ed-step { min-width: 0; padding: 10px 6px; border-width: 1px; border-radius: 6px; }
body .ed-step:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgb(23 46 77 / 9%); }
body .ed-step.done { background: #f0f8f3; }
body .eds-assign { margin-top: 5px; font-size: 10px; line-height: 1.6; }
body .detail-actions { gap: 8px; margin-top: 12px; }
body .detail-actions .sys-btn { min-height: 33px; padding: 6px 11px; font-size: 11px; }

/* This pre-existing dialog uses .show rather than the .modal-mask class. */
#missingDetailModal { position: fixed; inset: 0; z-index: 1000; visibility: hidden; pointer-events: none; align-items: center; justify-content: center; padding: 24px; background: rgb(18 35 59 / 38%) !important; backdrop-filter: blur(3px); }
#missingDetailModal.show { display: flex; visibility: visible; pointer-events: auto; }
#missingDetailModal .modal-content { width: 100%; max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid #dce4ed; border-radius: 12px; background: #fff; padding: 24px; box-shadow: 0 24px 80px rgb(13 33 61 / 20%); }
#missingDetailModal .modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
#missingDetailModal .modal-title { flex: 1; }
#missingDetailModal .modal-close { cursor: pointer; min-width: 28px; min-height: 28px; text-align: center; color: var(--text2); }
#missingDetailModal .modal-footer { flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
#missingDetailModal button { min-height: 38px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }

/* Existing status utilities stay available with lighter, smaller surfaces. */
#tvZoomBar, #autoSaveBar { background: #fff; border-color: #dce4ee; border-radius: 8px; box-shadow: 0 4px 18px rgb(23 46 77 / 9%); backdrop-filter: none; }
#tvZoomBar { right: 20px; bottom: 16px; padding: 6px 8px; gap: 7px; }
#tvZoomBar .tz-btn { background: #f0f4f9; border-color: #dce5f1; color: var(--accent); width: 28px; height: 28px; border-radius: 5px; font-size: 16px; }
#tvZoomBar .tz-btn:hover { background: #e5edf7; }
#tvZoomBar .tz-btn.reset { color: var(--accent); background: #eaf0f8; border-color: #d5e1ef; font-size: 12px; }
#tvZoomBar .tz-label { color: var(--text); font-size: 12px; min-width: 56px; }
#tvZoomBar .tz-tip, #tvZoomBar .tz-toggle { color: #8290a3; }
#autoSaveBar { left: calc(var(--ui-sidebar-width) + 30px); bottom: 16px; padding: 8px 11px; gap: 7px; font-size: 11px; }
#autoSaveBar .as-icon { color: var(--green); font-size: 12px; }
#autoSaveBar .as-text { color: #62738b; font-weight: 500; }
#autoSaveBar .as-time { color: #8d99a9; font-size: 10px; }
#_cloudRefreshHint { background: var(--accent) !important; border-radius: 7px !important; box-shadow: 0 5px 16px rgb(23 63 117 / 15%) !important; }

@media (min-width: 1700px) {
  :root { --ui-sidebar-width: 224px; }
  .sidebar { padding-inline: 18px; }
  .page-view { padding: 30px 36px 88px; }
  .top-bar { padding-inline: 36px; }
  .kpi-card { min-height: 151px; padding: 22px 24px; }
  .kpi-card .kpi-value { font-size: 38px; }
  .daily-card { padding: 18px 20px; }
  .chart-panel { padding: 23px 26px; }
  #autoSaveBar { left: calc(var(--ui-sidebar-width) + 36px); }
}
@media (max-width: 1240px) {
  :root { --ui-sidebar-width: 188px; }
  .sidebar { padding-inline: 11px; }
  .top-bar { gap: 14px; padding: 15px 22px; }
  .top-bar-left .title { font-size: 16px; }
  .top-bar-right { max-width: 270px; gap: 5px 8px; }
  .top-bar-center { padding-inline: 0; }
  .top-bar-center .clock { font-size: 22px; }
  .page-view { padding: 23px 22px 88px; }
  .daily-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-card { padding: 18px; grid-template-columns: minmax(0, 1fr) 33px; min-height: 138px; }
  .kpi-card .kpi-icon { width: 33px; height: 33px; border-radius: 8px; font-size: 18px; }
  .kpi-card .kpi-value { font-size: 31px; }
  .urgent-list, .pm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #autoSaveBar { left: calc(var(--ui-sidebar-width) + 22px); }
}
@media (max-width: 1024px) {
  :root { --ui-sidebar-width: 172px; }
  .sidebar-item { gap: 10px; padding-inline: 11px; }
  .ui-sidebar-brand { grid-template-columns: 42px 1fr; gap: 1px 6px; padding-inline: 0; }
  .ui-sidebar-brand img { width: 42px; }
  .ui-sidebar-brand strong { font-size: 16px; }
  .ui-sidebar-brand small { font-size: 9px; letter-spacing: .5px; }
  .top-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 12px; }
  .top-bar-right { grid-column: 1 / -1; max-width: none; justify-content: flex-start; padding-top: 10px; border-top: 1px solid #f0f3f7; gap: 8px 10px; }
  .top-bar-left .logo { width: 42px; height: 36px; }
  .top-bar-left .title { font-size: 15px; }
  .top-bar-center .clock { font-size: 20px; }
  .top-bar-center .date { font-size: 10px; }
  .dashboard-header .dh-title, .page-view > .section-title:first-child { font-size: 21px; }
  .kpi-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-height: 135px; padding: 18px 20px; grid-template-columns: minmax(0, 1fr) 40px; }
  .kpi-card .kpi-icon { width: 40px; height: 40px; }
  .daily-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-row { grid-template-columns: minmax(0, 1fr); }
  .chart-panel canvas { max-width: 560px; }
  .scroll-control { margin-left: 0; }
  .filter-bar .sys-btn { margin-left: 0 !important; }
  #tvZoomBar { right: 14px; }
}
@media (max-width: 760px) {
  :root { --ui-sidebar-width: 0px; }
  .main-container { flex-direction: column; }
  .sidebar { flex-direction: row; align-items: center; width: 100%; min-height: 69px; height: 69px; padding: 8px 12px; gap: 5px; overflow-x: auto; overflow-y: hidden; border-right: none; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
  .ui-sidebar-brand { flex: 0 0 140px; grid-template-columns: 42px 1fr; margin: 0 7px 0 0; padding: 0 10px 0 0; border-bottom: none; border-right: 1px solid var(--border); }
  .ui-sidebar-brand img { height: 38px; }
  .sidebar-item { flex: 0 0 86px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 49px; padding: 6px; border-radius: 6px; }
  .sidebar-item .si-icon { width: 17px; height: 17px; line-height: 17px; font-size: 17px; }
  .sidebar-item .si-label { font-size: 11px; text-align: center; white-space: nowrap; }
  .top-bar { padding: 13px 17px; gap: 10px; }
  .top-bar-left { gap: 7px; }
  .top-bar-left .logo { width: 36px; height: 30px; }
  .top-bar-left .title { font-size: 14px; }
  .top-bar-center .clock { font-size: 19px; letter-spacing: .4px; }
  .top-bar-center .date { font-size: 9px; margin-top: 2px; }
  .top-bar-right { gap: 7px; padding-top: 9px; font-size: 10px; }
  .fullscreen-hint { min-height: 29px; padding: 4px 8px; font-size: 10px; }
  .page-view { padding: 20px 17px 125px; }
  .dashboard-header { gap: 12px; margin-bottom: 19px; }
  .dashboard-header .dh-title, .page-view > .section-title:first-child { font-size: 20px; }
  .section-title { margin-top: 24px; font-size: 15px; }
  .kpi-grid, .stats-grid { gap: 12px; }
  .kpi-card { min-height: 132px; padding: 16px; }
  .kpi-card .kpi-value { font-size: 30px; }
  .kpi-card .kpi-icon { width: 35px; height: 35px; font-size: 18px; }
  .daily-grid, .urgent-list, .pm-list { gap: 12px; }
  .chart-panel, .report-chart { padding: 18px; }
  .chart-panel .panel-title, .report-chart .rc-title { padding-bottom: 13px; margin-bottom: 16px; }
  .filter-bar { padding: 12px; gap: 9px; }
  .filter-select { flex: 1 1 130px; min-width: 0; }
  .filter-input { flex: 1 1 100%; min-width: 0; }
  .sys-section { padding: 19px; }
  .sys-stats { gap: 10px; }
  .sys-stat { padding: 17px 9px; }
  .sys-stat .ss-value { font-size: 24px; }
  .sys-stat .ss-label { font-size: 11px; }
  #autoSaveBar { left: 17px; bottom: 14px; max-width: calc(100vw - 34px); }
  #tvZoomBar { right: 17px; bottom: 58px; max-width: calc(100vw - 34px); flex-wrap: wrap; }
  #tvZoomBar .tz-tip { font-size: 10px; }
  .modal-mask { padding: 15px; }
  .modal-box { max-height: calc(100dvh - 30px); padding: 20px; border-radius: 10px; }
  .modal-title { font-size: 16px; }
  .modal-field { min-width: 0 !important; flex-basis: 100% !important; }
  body .prj-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .ed-pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #missingDetailModal { padding: 15px; }
  #missingDetailModal .modal-content { max-height: calc(100dvh - 30px); padding: 20px; }
}
@media (max-width: 480px) {
  .top-bar { grid-template-columns: minmax(0, 1fr) 104px; padding-inline: 14px; }
  .top-bar-left .title { font-size: 13px; }
  .top-bar-left .logo { width: 32px; height: 28px; }
  .top-bar-right { column-gap: 6px; }
  .top-bar-right > span:first-child { flex-basis: 100%; }
  .page-view { padding-inline: 14px; }
  .kpi-grid { gap: 10px; }
  .kpi-card { min-height: 129px; padding: 14px; grid-template-columns: minmax(0, 1fr) 29px; column-gap: 4px; }
  .kpi-card .kpi-icon { width: 29px; height: 29px; font-size: 15px; border-radius: 7px; }
  .kpi-card .kpi-label { font-size: 11px; }
  .kpi-card .kpi-sub { font-size: 10px; }
  .kpi-card .kpi-value { font-size: 29px; }
  .daily-grid, .urgent-list, .pm-list, .warning-grid { grid-template-columns: minmax(0, 1fr); }
  #missingTicketsList { grid-template-columns: minmax(0, 1fr) !important; }
  .daily-card { padding: 16px 18px; }
  .daily-card .dc-title { font-size: 13px; }
  .daily-card .dc-list { max-height: 185px; font-size: 12px; }
  .daily-card .dc-item { padding-block: 8px; }
  .scroll-control { width: 100%; justify-content: space-between; gap: 7px; padding-left: 10px; }
  .scroll-control .sc-label { font-size: 11px; }
  .scroll-control button { padding-inline: 10px; }
  .chart-panel, .report-chart { padding: 16px; }
  body .urgent-card, .pm-card { padding: 18px; }
  .sys-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sys-actions .sys-btn { width: 100%; justify-content: flex-start; text-align: left; }
  .modal-box { padding: 18px; }
  .modal-actions .sys-btn { flex: 1 1 auto; }
  .modal-step-label { width: 100%; }
  .modal-step-row select { min-width: 0; width: 100%; flex-basis: 100%; }
  .tbl-insert-toolbar .sys-btn { flex: 1 1 calc(50% - 8px); padding-inline: 8px; font-size: 11px; }
  .tbl-insert-toolbar .ti-tip { width: 100%; margin-left: 0; font-size: 11px; }
  body .prj-info-grid { gap: 8px; }
  body .prj-info-grid > div { padding: 10px; }
  body .eq-detail-card { padding: 11px; }
  #autoSaveBar { left: 14px; }
  #tvZoomBar { right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-item, .kpi-card, body .urgent-card, .sys-btn, body .ed-step { transition: none; }
  .kpi-card:hover, body .urgent-card:hover, body .ed-step:hover { transform: none; }
}
