* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  color: #1f2d36;
  background: #eef3f5;
  display: grid;
  grid-template-columns: 238px 1fr;
}
.sidebar {
  background: #263238;
  color: #e9f0f4;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #14b8a6;
  color: #082f2b;
  font-weight: 800;
  font-size: 21px;
}
.brand h1 { margin: 0; font-size: 17px; line-height: 1.2; }
.brand p { margin: 4px 0 0; font-size: 12px; color: #a9bdc7; }
.nav {
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b9c8cf;
  text-align: left;
  padding: 0 13px;
  cursor: pointer;
  font: inherit;
}
.nav.active { background: #e6f7f5; color: #0f766e; font-weight: 700; }
.side-note {
  margin-top: auto;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 9px;
  font-size: 12px;
  color: #c6d2d8;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.dot.running { background: #16a34a; }
.dot.idle { background: #0284c7; }
.dot.today { background: #f59e0b; }
.dot.overdue { background: #dc2626; }
.app { min-width: 0; padding: 22px 26px; overflow: auto; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.topbar h2 { margin: 0; font-size: 24px; }
.topbar p { margin: 6px 0 0; color: #64757d; font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.current-user-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid #dbe3e7;
}
label { color: #60717a; font-size: 12px; font-weight: 700; }
input, select {
  height: 34px;
  border: 1px solid #cfd8dc;
  background: #fff;
  border-radius: 6px;
  padding: 0 9px;
  color: #263943;
}
.import-label input {
  width: 126px;
  padding-top: 6px;
}
button {
  height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}
button.primary { border: 0; color: #fff; background: #0f766e; }
button.secondary { border: 1px solid #cfd8dc; color: #30444f; background: #fff; }
.hidden { display: none !important; }
.view { display: none; }
.view.active { display: block; }
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.kpi, .panel, .region {
  background: #fff;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(15,23,42,.03);
}
.kpi { padding: 16px; }
.kpi span { color: #61717b; font-size: 13px; }
.kpi strong { display: block; margin: 10px 0 6px; font-size: 32px; }
.kpi small { color: #65777f; }
.panel { padding: 16px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head span, .board-head p { color: #64757d; font-size: 12px; }
.task-list { display: grid; gap: 8px; }
.task {
  display: grid;
  grid-template-columns: 80px 120px 1fr 110px;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid #edf1f3;
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 54px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}
.badge.running { background: #dcfce7; color: #166534; }
.badge.idle { background: #e0f2fe; color: #075985; }
.badge.today { background: #fef3c7; color: #92400e; }
.badge.overdue { background: #fee2e2; color: #991b1b; }
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.device-tools {
  margin-bottom: 12px;
}
.device-board-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.device-summary-item {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px 14px;
  display: grid;
  gap: 5px;
}
.device-summary-item span {
  color: #64757d;
  font-size: 12px;
  font-weight: 700;
}
.device-summary-item b {
  color: #263238;
  font-size: 26px;
  line-height: 1;
}
.device-summary-item small {
  color: #7b8b93;
  font-size: 12px;
}
.legend {
  display: flex;
  gap: 18px;
  align-items: center;
  background: #fff;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  height: 38px;
  padding: 0 15px;
  color: #52616b;
  font-size: 12px;
}
.device-board {
  display: grid;
  grid-template-columns: 1.2fr .96fr .96fr;
  gap: 14px;
}
.region { padding: 12px; min-width: 0; }
.region-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
  border-bottom: 1px solid #edf1f3;
  margin-bottom: 10px;
}
.region-title h3 {
  margin: 0;
  font-size: 19px;
  padding-left: 12px;
  border-left: 6px solid #0f766e;
}
.region-title .meta { color: #64757d; font-size: 12px; }
.region-grid { display: grid; gap: 6px; }
.region.west .region-grid { grid-template-columns: repeat(5, minmax(86px, 1fr)); }
.region.east .region-grid, .region.third .region-grid { grid-template-columns: repeat(4, minmax(86px, 1fr)); }
.machine-card {
  position: relative;
  min-height: 74px;
  border: 1px solid #dbe3e7;
  border-radius: 7px;
  background: #fff;
  padding: 8px 8px 7px 12px;
  overflow: hidden;
}
.machine-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--status);
}
.machine-card.running { --status: #16a34a; }
.machine-card.idle { --status: #0284c7; }
.machine-card.today { --status: #f59e0b; background: #fffaf2; border-color: #f3d8a3; }
.machine-card.overdue { --status: #dc2626; background: #fff7f7; border-color: #f2b8b8; }
.machine-code {
  width: 100%;
  height: 22px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 16px;
  color: #17252f;
  font-weight: 700;
}
.machine-code:focus {
  outline: 2px solid #14b8a6;
  border-radius: 4px;
  background: #fff;
}
.product { margin-top: 3px; font-size: 13px; color: #111827; min-height: 18px; word-break: break-all; }
.qty {
  display: inline-flex;
  margin-top: 5px;
  height: 22px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8f9ee;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}
.machine-card.idle .qty { background: #e0f2fe; color: #075985; }
.machine-card.today .qty { background: #fef3c7; color: #92400e; }
.machine-card.overdue .qty { background: #fee2e2; color: #991b1b; }
.plan-filter {
  align-items: center;
}
.plan-filter label {
  min-width: 130px;
}
.plan-filter span {
  color: #60717a;
  font-size: 12px;
  font-weight: 700;
}
.plan-notes-editor {
  flex: 1 1 560px;
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(380px, 1.15fr);
  gap: 10px;
  align-self: stretch;
  min-width: 520px;
  border: 1px solid #dbe3e7;
  border-radius: 6px;
  background: #fbfdfe;
  padding: 8px 10px;
}
.plan-note-column {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.plan-note-title {
  color: #263238;
  font-size: 13px;
  font-weight: 800;
}
.plan-note-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 6px;
  min-width: 0;
}
.plan-note-row span {
  color: #263238;
  font-size: 12px;
  line-height: 24px;
}
.plan-note-row textarea {
  width: 100%;
  min-height: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #263238;
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  padding: 2px 5px;
  resize: vertical;
  overflow: hidden;
}
.plan-note-row textarea:focus {
  outline: 2px solid #14b8a6;
  border-color: #8ddbd1;
  background: #fff;
  overflow: auto;
}
.plan-day-summary {
  margin: -2px 0 10px;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.summary-head b {
  color: #263238;
  font-size: 13px;
}
.summary-head span,
.summary-empty {
  color: #64757d;
  font-size: 12px;
}
.summary-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.summary-day {
  height: 48px;
  min-width: 66px;
  border: 1px solid #dbe3e7;
  background: #f8fafb;
  color: #34444f;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 4px 8px;
}
.summary-day span {
  font-size: 11px;
  color: #60717a;
}
.summary-day b {
  font-size: 18px;
  line-height: 1;
  color: #0f766e;
}
.summary-day small {
  font-size: 10px;
  color: #7b8b93;
}
.summary-day.active {
  border-color: #0f766e;
  background: #e6f4f1;
}
.plan-wrap {
  overflow: auto;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  max-height: calc(100vh - 190px);
  position: relative;
  cursor: grab;
  scrollbar-gutter: stable both-edges;
}
.plan-wrap.dragging {
  cursor: grabbing;
  user-select: none;
}
.plan-table { border-collapse: collapse; width: max-content; min-width: 0; background: #fff; table-layout: fixed; }
.plan-table th, .plan-table td {
  border: 1px solid #edf1f3;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 28px;
  text-align: center;
  font-size: 11px;
  padding: 0;
}
.plan-table th:first-child, .plan-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 138px;
  min-width: 138px;
  max-width: 138px;
  background: #fff;
  text-align: left;
  padding-left: 8px;
}
.plan-table th {
  position: sticky;
  top: 26px;
  z-index: 4;
  background: #f8fafb;
  color: #64757d;
}
.plan-table thead tr:first-child th {
  top: 0;
  z-index: 5;
}
.plan-table thead th:first-child {
  z-index: 7;
}
.plan-table .month-row th {
  height: 26px;
  background: #eaf5f2;
  color: #0f766e;
  font-weight: 800;
}
.plan-table .month-row th:first-child {
  background: #f8fafb;
  color: #34444f;
}
.star { font-size: 15px; font-weight: 900; }
.star.normal { color: #16a34a; }
.star.today { color: #92400e; background: #fef08a; display: block; height: 100%; padding-top: 4px; }
.star.overdue { color: #fff; background: #dc2626; display: block; height: 100%; padding-top: 4px; }
.actual-input {
  width: 100%;
  height: 100%;
  border: 0;
  text-align: center;
  background: transparent;
}
.actual-input.done { background: #dcfce7; color: #166534; font-weight: 800; }
.master-table { width: 100%; border-collapse: collapse; }
.master-table th, .master-table td {
  border-bottom: 1px solid #edf1f3;
  padding: 10px 8px;
  text-align: left;
  font-size: 13px;
}
.master-table th { color: #64757d; background: #f8fafb; position: sticky; top: 0; z-index: 2; }
.master-table thead th { box-shadow: 0 1px 0 #edf1f3; }
.new-entry-row td { background: #f7fffd; }
.cycle-input { width: 90px; }
.last-date-input {
  width: 138px;
  height: 30px;
}
.master-edit {
  width: 130px;
  height: 30px;
}
.qty-edit {
  width: 82px;
}
.inline-tools {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 8px;
  margin: 0 0 8px;
}
.inline-label {
  display: grid;
  gap: 4px;
  min-width: 150px;
}
.linked-product {
  background: #f8fffd;
  border-color: #b9e5dc;
}
.entry-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #f8fafb;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
}
.entry-form label { display: grid; gap: 6px; }
.entry-form button { align-self: end; }
.autocomplete-host {
  position: relative;
}
.autocomplete-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  display: none;
  max-height: 220px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}
.autocomplete-panel.show {
  display: block;
}
.autocomplete-option {
  width: 100%;
  height: auto;
  min-height: 38px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #263943;
  text-align: left;
  font: inherit;
  font-weight: 600;
}
.autocomplete-option + .autocomplete-option {
  border-top: 1px solid #edf1f3;
}
.autocomplete-option:hover,
.autocomplete-option:focus-visible {
  background: #eef8f6;
  color: #0f766e;
  outline: none;
}
#logTableWrap { overflow: auto; border: 1px solid #dbe3e7; border-radius: 8px; }
#logTableWrap .master-table { min-width: 1260px; }
.user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.user-wide {
  grid-column: 1 / -1;
}
.user-panel {
  overflow: hidden;
}
.user-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.user-summary-card {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #f8fafb;
  padding: 14px;
}
.user-summary-card span {
  display: block;
  color: #64757d;
  font-size: 12px;
  margin-bottom: 8px;
}
.user-summary-card strong {
  display: block;
  color: #102028;
  font-size: 24px;
}
.user-form-grid,
.password-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
}
.user-form-grid label,
.password-form label {
  display: grid;
  gap: 6px;
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.user-empty {
  color: #64757d;
  font-size: 13px;
  padding: 8px 0 2px;
}
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}
.login-overlay.hidden {
  display: none !important;
}
.login-card {
  width: min(460px, 100%);
  border: 1px solid #dbe3e7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  padding: 24px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.login-brand h2 {
  margin: 0;
  font-size: 22px;
}
.login-brand p {
  margin: 6px 0 0;
  color: #64757d;
  font-size: 13px;
}
.login-form {
  display: grid;
  gap: 12px;
}
.login-form label {
  display: grid;
  gap: 6px;
}
.login-error {
  min-height: 18px;
  margin: 0;
  color: #b91c1c;
  font-size: 12px;
}
.login-help {
  color: #64757d;
  font-size: 12px;
}
.table-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
}
.report-tools {
  margin-bottom: 14px;
}
.table-tools label { display: grid; gap: 6px; min-width: 150px; }
.scroll-hint {
  margin: -4px 0 10px;
  color: #60717a;
  font-size: 12px;
  font-weight: 700;
}
button.small { height: 26px; padding: 0 9px; font-size: 12px; }
button.danger {
  border: 1px solid #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}
.master-grid {
  display: grid;
  gap: 14px;
}
.master-grid .panel { overflow: hidden; }
.master-grid .panel > div[id$="Wrap"] {
  overflow: auto;
  max-height: 360px;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
}
.inventory-grid {
  display: grid;
  gap: 14px;
}
.flow-lookup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.flow-lookup-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -2px 0 12px;
}
.flow-lookup-status span,
.flow-lookup-status b {
  border: 1px solid #dbe3e7;
  border-radius: 999px;
  background: #f8fafb;
  color: #34444f;
  padding: 5px 10px;
  font-size: 12px;
}
.flow-lookup-status b {
  background: #e6f7f5;
  color: #0f766e;
}
.flow-card {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #fff;
  padding: 12px 12px 10px;
  min-height: 170px;
  display: grid;
  gap: 10px;
}
.flow-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.flow-card-head b {
  display: block;
  font-size: 18px;
  color: #17252f;
}
.flow-card-head span {
  color: #60717a;
  font-size: 12px;
}
.flow-total {
  text-align: right;
  min-width: 82px;
}
.flow-total small {
  display: block;
  color: #60717a;
  font-size: 12px;
  font-weight: 700;
}
.flow-total strong {
  display: block;
  color: #0f766e;
  font-size: 30px;
  line-height: 1;
}
.flow-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-stats span {
  background: #e6f7f5;
  color: #0f766e;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.flow-result {
  border-top: 1px dashed #d7e2e6;
  padding-top: 10px;
  display: grid;
  gap: 6px;
}
.flow-code-list {
  display: grid;
  gap: 6px;
}
.flow-code-row {
  border: 1px solid #edf1f3;
  border-radius: 6px;
  background: #fbfdfe;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}
.flow-code-row b {
  font-size: 13px;
  color: #17252f;
}
.flow-code-row span,
.flow-code-row small {
  color: #60717a;
  font-size: 12px;
}
.flow-code-empty {
  border: 1px dashed #cbd8dd;
  border-radius: 6px;
  padding: 10px;
  color: #64757d;
  background: #fff;
  font-size: 13px;
}
.flow-result b {
  font-size: 13px;
  color: #263238;
}
.flow-result p {
  margin: 0;
  color: #17252f;
  line-height: 1.5;
  font-size: 13px;
  word-break: break-word;
}
.flow-result small {
  color: #7b8b93;
  font-size: 12px;
}
.inventory-query-tools {
  margin-bottom: 12px;
}
.inventory-query-result {
  display: grid;
  gap: 10px;
}
.mold-code-card {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #fbfdfe;
  padding: 12px;
}
.mold-code-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf1f3;
  padding-bottom: 10px;
}
.mold-code-head b {
  display: block;
  color: #17252f;
  font-size: 18px;
}
.mold-code-head span {
  color: #60717a;
  font-size: 12px;
}
.mold-code-total {
  min-width: 90px;
  text-align: right;
}
.mold-code-total span {
  display: block;
  color: #60717a;
  font-size: 12px;
  font-weight: 700;
}
.mold-code-total b {
  color: #0f766e;
  font-size: 28px;
  line-height: 1;
}
.mold-code-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.mold-code-stats span {
  border-radius: 999px;
  background: #e6f7f5;
  color: #0f766e;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.mold-code-list {
  display: grid;
  gap: 6px;
}
.mold-code-item {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr)) 70px minmax(160px, 1.2fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #edf1f3;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  font-size: 12px;
}
.mold-code-item b {
  color: #166534;
}
.mold-code-item small {
  color: #7b8b93;
}
.mold-code-empty {
  border: 1px dashed #cbd8dd;
  border-radius: 8px;
  color: #64757d;
  background: #fff;
  padding: 12px;
  font-size: 13px;
}
.inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.inventory-kpi {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #f8fafb;
  padding: 13px 14px;
  display: grid;
  gap: 5px;
}
.inventory-kpi span {
  color: #60717a;
  font-size: 12px;
  font-weight: 700;
}
.inventory-kpi b {
  color: #263238;
  font-size: 26px;
  line-height: 1;
}
.inventory-kpi small {
  color: #7b8b93;
  font-size: 12px;
}
.inventory-table-wrap {
  overflow: auto;
  max-height: 360px;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
}
.inventory-table {
  min-width: 860px;
}
.inventory-table td:nth-child(7) {
  min-width: 180px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  background: #17252f;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(15,23,42,.18);
  font-size: 13px;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}
.module-card {
  background: #fff;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  padding: 16px;
  min-height: 150px;
}
.module-card h3 {
  margin: 0 0 10px;
  color: #17252f;
  font-size: 17px;
}
.module-card p {
  margin: 0;
  color: #52616b;
  line-height: 1.6;
  font-size: 13px;
}
.module-card span {
  display: inline-flex;
  margin-top: 14px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e6f7f5;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}
.module-table th,
.module-table td {
  vertical-align: top;
  line-height: 1.45;
}
.module-table td:nth-child(4),
.module-table td:nth-child(5) {
  min-width: 220px;
}
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}
.report-wide {
  grid-column: 1 / -1;
}
.report-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}
.report-chart-grid > div {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #fbfdfe;
  padding: 12px;
}
.report-chart-grid > div b {
  display: block;
  margin-bottom: 10px;
  color: #17252f;
  font-size: 14px;
}
.report-chart {
  min-height: 170px;
}
.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.report-kpi {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #f8fafb;
  padding: 13px 14px;
  display: grid;
  gap: 5px;
}
.report-kpi span {
  color: #60717a;
  font-size: 12px;
  font-weight: 700;
}
.report-kpi b {
  color: #263238;
  font-size: 26px;
  line-height: 1;
}
.report-kpi small {
  color: #7b8b93;
  font-size: 12px;
}
.bar-chart {
  display: grid;
  gap: 12px;
}
.bar-row-chart {
  display: grid;
  grid-template-columns: 110px 1fr 48px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-row-chart span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  height: 12px;
  background: #eef3f5;
  border-radius: 999px;
  overflow: hidden;
}
.bar-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.bar-track i.running { background: #16a34a; }
.bar-track i.idle { background: #0284c7; }
.bar-track i.today { background: #f59e0b; }
.bar-track i.overdue { background: #dc2626; }
.import-preview-panel { margin-top: 14px; }
.schedule-preview {
  overflow: auto;
  max-height: 280px;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  scrollbar-gutter: stable both-edges;
}
.schedule-preview.dragging {
  cursor: grabbing;
  user-select: none;
}
.schedule-preview.empty {
  padding: 18px;
  color: #64757d;
  background: #f8fafb;
}
.preview-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}
.preview-table th,
.preview-table td {
  border: 1px solid #edf1f3;
  padding: 5px 7px;
  min-width: 76px;
  max-width: 130px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-table th:first-child,
.preview-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 80px;
  max-width: 80px;
  background: #fff;
  font-weight: 700;
}
.preview-table th:nth-child(2),
.preview-table td:nth-child(2) {
  position: sticky;
  left: 80px;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 #edf1f3;
}
.preview-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafb;
  color: #34444f;
  font-weight: 700;
}
.preview-table th:first-child {
  z-index: 5;
}
.preview-table th:nth-child(2) {
  z-index: 5;
  background: #f8fafb;
}
.schedule-insights {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}
.schedule-empty-panel {
  min-height: 260px;
  border: 1px dashed #cbd8dd;
  border-radius: 8px;
  background: #f8fafb;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #60717a;
}
.schedule-empty-panel b {
  color: #34444f;
  font-size: 16px;
}
.schedule-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.schedule-kpi {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.schedule-kpi span {
  color: #60717a;
  font-size: 12px;
  font-weight: 700;
}
.schedule-kpi b {
  color: #263238;
  font-size: 24px;
  line-height: 1;
}
.schedule-kpi small {
  color: #7b8b93;
  font-size: 12px;
}
.schedule-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}
.insight-panel {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  min-height: 210px;
}
.insight-panel.wide {
  min-height: 250px;
}
.insight-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.insight-head b {
  color: #263238;
  font-size: 15px;
}
.insight-head span {
  color: #7b8b93;
  font-size: 12px;
}
.compact-bars {
  display: grid;
  gap: 9px;
}
.compact-bar-row {
  display: grid;
  grid-template-columns: 116px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.compact-bar-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #34444f;
}
.compact-bar-row b {
  text-align: right;
  color: #34444f;
}
.compact-track {
  height: 10px;
  background: #edf3f5;
  border-radius: 999px;
  overflow: hidden;
}
.compact-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.compact-track i.running { background: #16a34a; }
.compact-track i.idle { background: #0284c7; }
.status-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
}
.status-pill {
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
  background: #f8fafb;
}
.status-pill span {
  font-size: 12px;
  color: #60717a;
  font-weight: 700;
}
.status-pill b {
  font-size: 26px;
  line-height: 1;
  color: #263238;
}
.status-pill.ended { border-color: #bae6fd; background: #f0f9ff; }
.status-pill.delayed { border-color: #fecaca; background: #fef2f2; }
.status-pill.hold { border-color: #fde68a; background: #fffbeb; }
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.mini-table th,
.mini-table td {
  border: 1px solid #edf1f3;
  padding: 7px 8px;
  text-align: left;
}
.mini-table th {
  background: #f8fafb;
  color: #34444f;
}
.muted-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: #7b8b93;
  background: #f8fafb;
  border-radius: 8px;
  font-size: 13px;
}
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body {
    display: block;
    background: #fff;
  }
  .sidebar,
  .topbar,
  .toast,
  .view:not(.active) {
    display: none !important;
  }
  .app {
    padding: 0;
    overflow: visible;
  }
  .view.active {
    display: block !important;
  }
  .panel,
  .region,
  .kpi {
    box-shadow: none;
    break-inside: avoid;
  }
  .chart-grid,
  .module-grid,
  .kpis,
  .schedule-kpis,
  .schedule-insight-grid {
    grid-template-columns: 1fr 1fr;
  }
  .plan-wrap,
  .schedule-preview,
  #logTableWrap,
  .master-grid .panel > div[id$="Wrap"] {
    max-height: none;
    overflow: visible;
  }
  .device-board {
    grid-template-columns: 1fr;
  }
  button,
  input[type="file"] {
    display: none !important;
  }
}
@media (max-width: 1200px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .device-board { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .schedule-kpis,
  .schedule-insight-grid { grid-template-columns: 1fr; }
  .entry-form { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .user-grid,
  .user-summary,
  .user-form-grid,
  .password-form { grid-template-columns: 1fr; }
  .current-user-bar {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid #dbe3e7;
  }
}
