/* Current Status keeps the operations table within the available workspace. */
body.current-status-active .page-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
}
body.current-status-active .main { min-height: 0; }
body.current-status-active .page-heading { flex: none; margin-bottom: 16px; }
body.current-status-active .secondary-view { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; padding-bottom: 12px; }

.current-status-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #e4dfd5;
  border-radius: 13px;
  background: var(--white, #fff);
  box-shadow: var(--shadow);
}

.current-status-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 10px 16px;
  padding: 13px 16px;
  border-bottom: 1px solid #e4dfd5;
  background: var(--surface-soft, #faf9f7);
}

.current-status-summary { min-width: 0; color: var(--secondary); font-size: var(--text-body, 13px); line-height: 1.5; overflow-wrap: anywhere; }
.current-status-summary strong { color: var(--ink); font-weight: 700; }
.current-status-summary small { display: block; margin-top: 2px; color: var(--secondary); font-size: var(--text-small, 12px); }
.current-status-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.current-status-actions > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 12px; border: 1px solid #dfd8e9; border-radius: 8px; background: #fff; color: var(--violet); font-size: var(--text-body, 13px); font-weight: 600; line-height: 1.4; }
.current-status-actions > button:hover:not(:disabled) { background: var(--violet-soft); border-color: #c7b6e6; }
.current-status-actions .icon { flex: none; width: 16px; height: 16px; }
.current-status-panel button:disabled { cursor: default; opacity: 1; color: #8d8b93; background: #f8f7f5; border-color: #e9e5df; box-shadow: none; transform: none; }

.current-status-notice {
  flex: none;
  padding: 10px 16px;
  color: #785621;
  background: #fff8e8;
  border-bottom: 1px solid #eee2c7;
  font-size: var(--text-small, 12px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.current-status-notice:empty { display: none; }

.current-status-table-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c9c1d4 #f7f5f1;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.current-status-table-wrap:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.current-status-table {
  width: 100%;
  min-width: 1810px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  white-space: normal;
  color: var(--ink);
}
.current-status-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 9px;
  border-right: 1px solid #ead7ad;
  border-bottom: 1px solid #ddc28d;
  background: #fbe3b4;
  color: #554b38;
  font-size: var(--text-small, 12px);
  font-weight: 700;
  line-height: 1.35;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.current-status-table td {
  padding: 10px 9px;
  border-right: 1px solid #eeebe5;
  border-bottom: 1px solid #e9e6e0;
  background: #fff;
  color: var(--ink);
  font-size: var(--text-body, 13px);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.current-status-table tbody tr:nth-child(even) td { background: #faf9f7; }
.current-status-table tbody tr:hover td { background: #f5f0fc; }
.current-status-table th:last-child, .current-status-table td:last-child { border-right: 0; }
.current-status-table tr:last-child td { border-bottom: 0; }
.current-status-table th:nth-child(-n+4), .current-status-table td:nth-child(-n+4) { text-align: center; padding-left: 6px; padding-right: 6px; }
.current-status-table th:nth-child(1), .current-status-table th:nth-child(2) { width: 54px; }
.current-status-table th:nth-child(3) { width: 66px; }
.current-status-table th:nth-child(4) { width: 36px; }
.current-status-table th:nth-child(5) { width: 135px; }
.current-status-table th:nth-child(6) { width: 144px; }
.current-status-table th:nth-child(7) { width: 270px; }
.current-status-table th:nth-child(8) { width: 84px; }
.current-status-table th:nth-child(9) { width: 118px; }
.current-status-table th:nth-child(10) { width: 136px; }
.current-status-table th:nth-child(11), .current-status-table th:nth-child(14) { width: 174px; }
.current-status-table th:nth-child(12), .current-status-table th:nth-child(13) { width: 144px; }
.current-status-table input[type="checkbox"] { width: 15px; height: 15px; margin: 0; vertical-align: middle; accent-color: var(--violet); cursor: pointer; }
.current-status-action { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 7px; border: 1px solid #e4dced; border-radius: 7px; background: #fff; color: var(--violet); vertical-align: middle; }
.current-status-action .icon { width: 16px; height: 16px; }
.current-status-action:hover:not(:disabled) { background: var(--violet-soft); border-color: #c7b6e6; }
.current-status-vehicle { font-weight: 700; letter-spacing: .015em; }
.current-status-vehicle small { margin-top: 3px; color: var(--secondary); font-size: var(--text-small, 12px); font-weight: 400; letter-spacing: 0; }
.current-status-position { line-height: 1.45; }
.current-status-table .current-status-time { color: var(--secondary); font-size: var(--text-small, 12px); font-variant-numeric: tabular-nums; }
.current-status-time time, .current-status-time small { display: block; }
.current-status-speed, .current-status-duration { text-align: right; font-variant-numeric: tabular-nums; }
.current-status-load { font-weight: 600; }
.current-status-table tbody tr td.stop-short, .current-status-table .current-status-duration.stop-short { background: #e4f2cc; color: #37531c; }
.current-status-table tbody tr td.stop-medium, .current-status-table .current-status-duration.stop-medium { background: #fff3bc; color: #69550a; }
.current-status-table tbody tr td.stop-long, .current-status-table .current-status-duration.stop-long { background: #ffd5a2; color: #764415; }
.current-status-empty, .current-status-table td.current-status-empty { padding: 40px 20px; text-align: left; color: var(--secondary); font-size: var(--text-body, 13px); line-height: 1.6; }
.current-status-footnote { flex: none; padding: 10px 16px; border-top: 1px solid #e9e6e0; background: var(--surface-soft, #faf9f7); color: var(--secondary); font-size: var(--text-small, 12px); line-height: 1.5; overflow-wrap: anywhere; }
.current-status-footnote:empty { display: none; }

@media (max-width:760px), (max-width:1024px) and (max-height:500px) {
  body.current-status-active .page-content { min-width: 0; padding-left: 12px; padding-right: 12px; }
  body.current-status-active .secondary-view { min-width: 0; padding-left: 0; padding-right: 0; }
  .current-status-panel { border-radius: 10px; }
  .current-status-toolbar { align-items: flex-start; padding: 11px; gap: 9px; }
  .current-status-summary { flex-basis: 100%; }
  .current-status-actions { width: 100%; gap: 7px; }
  .current-status-actions > button { min-height: 40px; }
  .current-status-table-wrap { max-height: none; min-height: 0; }
  .current-status-table th, .current-status-table td { padding-top: 9px; padding-bottom: 9px; }
  .current-status-action { width: 36px; height: 36px; }
  .current-status-notice, .current-status-footnote { padding: 10px 11px; }
}
