/* EVC TBX Pro - WordPress Plugin Styles */

#evc-tbx-app {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  border-radius: 12px;
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header */
.evc-header {
  background: #161b22;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #21262d;
}
.evc-header h1 {
  margin: 0;
  font-size: 20px;
  color: #58A6FF;
}
.evc-header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.red { background: #F44336; }
.evc-fs-btn {
  background:none;border:1px solid #30363d;border-radius:4px;color:#8b949e;
  cursor:pointer;font-size:16px;padding:2px 6px;margin-left:8px;line-height:1;
}
.evc-fs-btn:hover { color:#58A6FF;border-color:#58A6FF; }
#evc-tbx-app:fullscreen,
#evc-tbx-app:-webkit-full-screen {
  background:#0d1117;overflow:auto;
  width:100vw;height:100vh;
  display:flex;flex-direction:column;
}
#evc-tbx-app:fullscreen .evc-layout,
#evc-tbx-app:-webkit-full-screen .evc-layout {
  flex:1;min-height:0;
}
#evc-tbx-app:fullscreen .evc-content,
#evc-tbx-app:-webkit-full-screen .evc-content {
  max-height:calc(100vh - 120px);
}
#evc-tbx-app:fullscreen .evc-sidebar-scroll,
#evc-tbx-app:-webkit-full-screen .evc-sidebar-scroll {
  max-height:none;
}
#evc-tbx-app:fullscreen .evc-log-body,
#evc-tbx-app:-webkit-full-screen .evc-log-body {
  max-height:40vh;
}
.status-dot.green { background: #4CAF50; }
.status-dot.orange { background: #FF9800; }

/* Command Result Banner */
.evc-result-banner {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 12px;
  border-bottom: 1px solid #21262d;
  animation: evc-flash 0.3s;
}
@keyframes evc-flash { from { opacity: 0.3; } to { opacity: 1; } }
.evc-result-banner.pass { background: #0d2818; }
.evc-result-banner.fail { background: #2d1117; }
.evc-result-banner.warn { background: #2d2200; }
.evc-result-status {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  white-space: nowrap;
}
.evc-result-banner.pass .evc-result-status { background: #238636; color: white; }
.evc-result-banner.fail .evc-result-status { background: #da3633; color: white; }
.evc-result-banner.warn .evc-result-status { background: #d29922; color: black; }
.evc-result-body { flex: 1; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.evc-result-task { font-size: 13px; color: #8b949e; }
.evc-result-msg { font-size: 14px; font-weight: 600; color: #e6edf3; }
.evc-result-time { font-size: 12px; color: #6e7681; }
.evc-result-close {
  background: none; border: none; color: #8b949e; font-size: 20px;
  cursor: pointer; padding: 0 5px; line-height: 1;
}
.evc-result-close:hover { color: #e6edf3; }

/* Layout */
.evc-layout {
  display: flex;
  min-height: 600px;
}

/* Sidebar */
.evc-sidebar {
  width: 220px;
  min-width: 220px;
  background: #161b22;
  border-right: 1px solid #21262d;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}
.evc-sidebar-section {
  padding: 0 8px;
}
.evc-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}
.evc-nav-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin: 3px 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.evc-nav-btn:hover { background: #21262d; }
.evc-nav-btn.active { background: #1f6feb33; border-color: #1f6feb; color: #58A6FF; }
.evc-nav-highlight-orange { color: #FF9800 !important; }
.evc-nav-highlight-blue { color: #2196F3 !important; }
.evc-nav-highlight-green { color: #4CAF50 !important; }
.nav-icon { margin-right: 6px; }
.evc-divider {
  border: none;
  border-top: 1px solid #21262d;
  margin: 10px 12px;
}

/* Content */
.evc-content {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  max-height: 700px;
}
.evc-page { display: none; }
.evc-page.active { display: block; }
.evc-page h2 {
  margin: 0 0 15px 0;
  font-size: 20px;
  color: #e6edf3;
}
.evc-subtitle { color: #8b949e; margin: -10px 0 15px; font-size: 13px; }

/* Dashboard */
.evc-dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 12px;
}
.evc-dash-card {
  background: #161b22; border: 1px solid #21262d; border-radius: 8px; padding: 14px;
}
.evc-dash-card-title {
  font-size: 13px; font-weight: 700; color: #58A6FF; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid #21262d;
}
.evc-dash-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 13px;
}
.evc-dash-label { color: #8b949e; }
.evc-dash-value { color: #e6edf3; font-weight: 600; text-align: right; }
.evc-dash-mono { font-family: 'Consolas', monospace; font-size: 12px; }
.status-green { color: #4CAF50; }
.status-red { color: #F44336; }
.status-orange { color: #FF9800; }

/* File Explorer */
.evc-fe-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding: 8px 12px; background: #161b22; border: 1px solid #21262d; border-radius: 6px;
}
.evc-fe-breadcrumb {
  flex: 1; font-family: 'Consolas', monospace; font-size: 13px; color: #58A6FF;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.evc-fe-breadcrumb span { cursor: pointer; }
.evc-fe-breadcrumb span:hover { text-decoration: underline; }
.evc-fe-breadcrumb .fe-sep { color: #6e7681; cursor: default; }
.evc-fe-status { font-size: 12px; color: #8b949e; margin-bottom: 8px; }
.evc-fe-list { margin-bottom: 12px; }
.evc-fe-row {
  display: flex; align-items: center; padding: 6px 10px; border-bottom: 1px solid #21262d;
  font-size: 12px; cursor: pointer; transition: background 0.1s;
}
.evc-fe-row:hover { background: #161b2288; }
.evc-fe-row.fe-dir { color: #58A6FF; }
.evc-fe-row.fe-file { color: #c9d1d9; }
.evc-fe-icon { width: 20px; text-align: center; margin-right: 8px; font-size: 14px; }
.evc-fe-name { flex: 1; font-family: 'Consolas', monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evc-fe-size { width: 80px; text-align: right; color: #8b949e; font-family: 'Consolas', monospace; }
.evc-fe-date { width: 120px; text-align: right; color: #6e7681; font-size: 11px; }
.evc-fe-perms { width: 90px; color: #6e7681; font-family: 'Consolas', monospace; font-size: 11px; }
.evc-fe-owner { width: 80px; color: #6e7681; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.evc-fe-quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.evc-fe-header {
  display: flex; padding: 4px 10px; font-size: 11px; color: #6e7681; font-weight: 600;
  border-bottom: 2px solid #21262d; background: #0d1117;
}

/* pre-ODIN */
.evc-po-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.evc-po-card {
  background: #161b22; border: 1px solid #21262d; border-radius: 8px; padding: 14px;
}
.evc-po-card-title { font-size: 14px; font-weight: 700; color: #FF9800; margin-bottom: 4px; }
.evc-po-desc { font-size: 12px; color: #8b949e; margin: 0 0 10px; }
.evc-po-response {
  margin-top: 8px; padding: 8px; background: #0d1117; border: 1px solid #21262d;
  border-radius: 4px; font-family: 'Consolas', monospace; font-size: 12px;
  color: #8b949e; max-height: 200px; overflow: auto; display: none;
  white-space: pre-wrap; word-break: break-word;
}
.evc-po-response.visible { display: block; }
.evc-po-status {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 4px; margin-bottom: 4px;
}
.evc-po-status.s200 { background: #238636; color: white; }
.evc-po-status.s404 { background: #d29922; color: black; }
.evc-po-status.serr { background: #da3633; color: white; }
.evc-po-custom { max-width: 700px; }
.evc-btn-orange { background: #FF9800; color: black; }
.evc-btn-orange:hover { background: #F57C00; }

/* Data Value Scanner Table */
.dv-table { width:100%;border-collapse:collapse;font-size:11px;table-layout:fixed; }
.dv-table th { text-align:left;background:#161b22;padding:6px 8px;border:1px solid #21262d;color:#58A6FF;font-weight:600;position:sticky;top:0;z-index:1; }
.dv-table td { padding:4px 8px;border:1px solid #21262d;color:#c9d1d9;font-family:'Consolas',monospace;word-break:break-all;overflow-wrap:break-word; }
.dv-table tr:hover td { background:#161b2266; }
.dv-table .dv-name { width:30%;color:#4DB6AC; }
.dv-table .dv-val { width:auto; }
.dv-table .dv-num { width:35px; }
.dv-table .dv-set-col { width:130px; }
.dv-table .dv-btn-col { width:40px; }
.dv-table .dv-status { width:70px;text-align:center; }
.dv-table .dv-set-input { width:120px;padding:2px 6px;background:#0d1117;border:1px solid #21262d;border-radius:3px;color:#c9d1d9;font-size:11px;font-family:'Consolas',monospace; }
.dv-table .dv-set-btn { padding:2px 8px;font-size:10px;cursor:pointer;background:#FF9800;color:black;border:none;border-radius:3px; }
.dv-table .dv-set-btn:hover { background:#F57C00; }
.dv-table .dv-status { min-width:60px;text-align:center; }
.dv-status-ok { color:#4CAF50;font-weight:600; }
.dv-status-err { color:#F44336;font-weight:600; }
.dv-resp-mini { font-size:10px;color:#6e7681;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }

/* Buttons */
.evc-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.evc-btn:hover { opacity: 0.85; }
.evc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.evc-btn-primary { background: #1f6feb; color: white; }
.evc-btn-green { background: #238636; color: white; }
.evc-btn-blue { background: #1976D2; color: white; }
.evc-btn-gray { background: #30363d; color: #c9d1d9; }
.evc-btn-red { background: #da3633; color: white; }
.evc-btn-orange { background: #d29922; color: black; }
.evc-btn-small { padding: 4px 10px; font-size: 12px; }
.evc-btn-row { display: flex; gap: 10px; margin: 10px 0; }

/* Code boxes */
.evc-code-box {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 15px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  color: #A9B7C6;
  overflow: auto;
  max-height: 500px;
  white-space: pre-wrap;
  word-break: break-word;
}
.evc-code-response { color: #58A6FF; }
.evc-code-bms { color: #00E676; background: #0a0e14; }

/* JSON input */
.evc-json-input {
  width: 100%;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 12px;
  font-family: 'Consolas', monospace;
  font-size: 13px;
  color: #A9B7C6;
  resize: vertical;
  box-sizing: border-box;
}
.evc-json-input:focus { border-color: #1f6feb; outline: none; }

/* Search */
.evc-search-input {
  width: 100%;
  padding: 12px 16px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 14px;
  box-sizing: border-box;
  margin-bottom: 15px;
}
.evc-search-input:focus { border-color: #1f6feb; outline: none; }

/* Card grid */
.evc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.evc-task-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 14px;
  transition: border-color 0.15s;
}
.evc-task-card:hover { border-color: #30363d; }
.evc-task-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #4DB6AC;
}
.evc-task-card .card-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.evc-task-card .card-title-row h4 { margin: 0; }
.evc-task-card .card-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: 600;
}
.evc-task-card .badge-cancelable { background: #1f6feb33; color: #58A6FF; }
.evc-task-card .card-path { font-size: 11px; color: #6e7681; margin-bottom: 6px; font-family: monospace; }
.evc-task-card .card-desc {
  margin: 0 0 8px;
  font-size: 12px;
  color: #8b949e;
  line-height: 1.4;
}
.evc-task-card .card-impact {
  font-size: 11px; color: #d29922; background: #2d220033; border-left: 3px solid #d29922;
  padding: 4px 8px; margin-bottom: 8px; border-radius: 0 4px 4px 0;
}
.evc-task-card .card-states {
  font-size: 10px; color: #6e7681; margin-bottom: 8px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.evc-task-card .card-states span {
  background: #21262d; padding: 1px 5px; border-radius: 3px;
}
.evc-task-card .card-input-group { margin-bottom: 8px; }
.evc-task-card .card-input-label {
  font-size: 11px; color: #8b949e; margin-bottom: 2px; display: block;
}
.evc-task-card .card-input {
  width: 100%; padding: 5px 8px; background: #0d1117; border: 1px solid #21262d;
  border-radius: 4px; color: #c9d1d9; font-size: 12px; box-sizing: border-box;
}
.evc-task-card .card-input:focus { border-color: #1f6feb; outline: none; }
.evc-task-card select.card-input { appearance: auto; }
.evc-task-card .card-btn-row { display: flex; gap: 6px; margin-bottom: 6px; }
.evc-task-card .evc-btn { flex: 1; }
.evc-task-card .card-response {
  background: #0d1117; border: 1px solid #21262d; border-radius: 4px;
  padding: 8px; font-family: monospace; font-size: 11px; color: #8b949e;
  max-height: 200px; overflow: auto; display: none; white-space: pre-wrap; word-break: break-word;
}
.evc-task-card .card-response.visible { display: block; }
.evc-task-card .card-result-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 4px; margin-bottom: 6px;
}
.card-result-pass { background: #238636; color: white; }
.card-result-fail { background: #da3633; color: white; }
.card-result-warn { background: #d29922; color: black; }
.card-result-msg { font-size: 12px; color: #e6edf3; margin-bottom: 4px; }

/* Data display components */
.card-data-section {
  margin: 8px 0; padding: 0; border-left: 2px solid #30363d;
  padding-left: 10px;
}
.card-data-title {
  font-size: 12px; font-weight: 700; color: #58A6FF; margin-bottom: 4px;
}
.card-data-table-wrap { overflow-x: auto; }
.card-data-table {
  width: 100%; border-collapse: collapse; font-size: 11px; margin: 4px 0;
}
.card-data-table th {
  text-align: left; padding: 4px 8px; background: #21262d; color: #c9d1d9;
  border: 1px solid #30363d; font-weight: 600; white-space: nowrap;
}
.card-data-table td {
  padding: 3px 8px; border: 1px solid #21262d; color: #c9d1d9;
  font-family: 'Consolas', monospace; word-break: break-word;
}
.card-data-table tr:hover td { background: #161b2266; }
.card-data-key { color: #8b949e; font-weight: 600; white-space: nowrap; min-width: 120px; }
.card-data-list {
  margin: 4px 0; padding-left: 20px; font-size: 12px; color: #c9d1d9;
  font-family: 'Consolas', monospace; list-style: none;
}
.card-data-list li { padding: 2px 0; border-bottom: 1px solid #21262d; }
.card-data-list li::before { content: ""; margin-right: 6px; color: #6e7681; }
.card-data-pre {
  background: #0d1117; padding: 8px; border-radius: 4px; font-size: 11px;
  color: #c9d1d9; font-family: 'Consolas', monospace; white-space: pre-wrap;
  word-break: break-word; margin: 4px 0; max-height: 200px; overflow: auto;
}
.card-data-nested {
  margin: 6px 0; padding: 8px; background: #0d111766; border-radius: 4px;
  border: 1px solid #21262d;
}
.card-data-nested-title {
  font-size: 12px; font-weight: 700; color: #d29922; margin-bottom: 4px;
  font-family: 'Consolas', monospace;
}

/* Search result cards */
.evc-task-card.search-card h4 { color: #FF9800; }
.evc-task-card .card-category {
  font-size: 11px;
  color: #6e7681;
  margin-bottom: 4px;
}

/* Templates bar */
.evc-template-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.evc-tpl-label { font-size: 12px; color: #8b949e; margin-right: 6px; }
.evc-tpl-btn {
  padding: 4px 10px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #c9d1d9;
  font-size: 12px;
  cursor: pointer;
}
.evc-tpl-btn:hover { background: #30363d; }

/* Progress bar */
.evc-progress-bar {
  width: 100%;
  height: 8px;
  background: #21262d;
  border-radius: 4px;
  margin: 10px 0 5px;
  overflow: hidden;
}
.evc-progress-fill {
  height: 100%;
  background: #238636;
  border-radius: 4px;
  transition: width 0.3s;
}
.evc-progress-label {
  font-size: 12px;
  color: #8b949e;
}

/* Traffic Log Panel */
.evc-log-panel {
  border-top: 1px solid #21262d;
}
.evc-log-header {
  background: #161b22;
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.evc-log-header:hover { background: #1c2129; }
.evc-log-toggle { font-size: 12px; transition: transform 0.2s; }
.evc-log-toggle.open { transform: rotate(180deg); }
#evc-log-counter { font-size: 12px; color: #8b949e; font-weight: normal; }
.evc-log-toolbar {
  padding: 8px 15px;
  background: #0d1117;
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 12px;
  border-bottom: 1px solid #21262d;
}
.evc-log-toolbar label { color: #8b949e; cursor: pointer; }
.evc-log-content {
  background: #0d1117;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  padding: 10px 15px;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.5;
}
.log-ts { color: #6e7681; }
.log-sent { color: #4FC3F7; font-weight: bold; }
.log-recv { color: #81C784; font-weight: bold; }
.log-error { color: #EF5350; font-weight: bold; }
.log-event { color: #FFB74D; font-weight: bold; }
.log-body-sent { color: #90CAF9; }
.log-body-recv { color: #A5D6A7; }
.log-sep { color: #21262d; }

/* Scrollbar */
.evc-sidebar-scroll::-webkit-scrollbar,
.evc-content::-webkit-scrollbar,
.evc-log-content::-webkit-scrollbar,
.evc-code-box::-webkit-scrollbar {
  width: 6px;
}
.evc-sidebar-scroll::-webkit-scrollbar-track,
.evc-content::-webkit-scrollbar-track,
.evc-log-content::-webkit-scrollbar-track,
.evc-code-box::-webkit-scrollbar-track {
  background: transparent;
}
.evc-sidebar-scroll::-webkit-scrollbar-thumb,
.evc-content::-webkit-scrollbar-thumb,
.evc-log-content::-webkit-scrollbar-thumb,
.evc-code-box::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 3px;
}

/* ==================== Vitals Page ==================== */
.vitals-section { margin-bottom: 20px; }
.vitals-h3 {
  font-size: 14px;
  color: #58A6FF;
  border-bottom: 1px solid #30363d;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.vitals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.vitals-table th {
  background: #161b22;
  color: #c9d1d9;
  text-align: left;
  padding: 6px 10px;
  border: 1px solid #30363d;
  font-weight: 600;
}
.vitals-table td {
  padding: 4px 10px;
  border: 1px solid #21262d;
  color: #c9d1d9;
  word-break: break-word;
  vertical-align: top;
}
.vitals-table tr:nth-child(even) td { background: #0d1117; }
.vitals-table tr:nth-child(odd) td { background: #11161d; }
.vitals-table code { background: transparent; color: #79c0ff; font-family: Consolas, monospace; }
.vitals-ok-box {
  background: #0d2818;
  border: 1px solid #4CAF50;
  border-radius: 6px;
  padding: 10px 14px;
  color: #4CAF50;
  font-weight: 600;
}

/* ==================== DTCs Page ==================== */
.dtc-mod {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}
.dtc-mod-head {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
  background: #161b22;
}
.dtc-mod-name {
  font-weight: 700;
  font-size: 14px;
  color: #58A6FF;
  font-family: Consolas, monospace;
  min-width: 80px;
}
.dtc-mod-state {
  flex: 1;
  font-size: 12px;
  color: #8b949e;
}
.dtc-mod-state.sev-red { color: #EF5350; font-weight: 600; }
.dtc-mod-state.sev-orange { color: #FF9800; font-weight: 600; }
.dtc-mod-state.sev-green { color: #4CAF50; }
.dtc-mod-btns { display: flex; gap: 6px; }
.dtc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #0d1117;
}
.dtc-table th {
  background: #11161d;
  color: #c9d1d9;
  text-align: left;
  padding: 6px 10px;
  border-top: 1px solid #30363d;
  border-bottom: 1px solid #30363d;
  font-weight: 600;
}
.dtc-table td {
  padding: 4px 10px;
  border-bottom: 1px solid #21262d;
  color: #c9d1d9;
}
.dtc-table code {
  background: transparent;
  color: #79c0ff;
  font-family: Consolas, monospace;
  font-size: 11px;
}
.dtc-empty {
  padding: 10px 14px;
  color: #6e7681;
  font-size: 12px;
  font-style: italic;
  background: #0d1117;
}
.dtc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.dtc-badge.sev-red { background: #2d1117; color: #EF5350; border: 1px solid #EF5350; }
.dtc-badge.sev-orange { background: #2d1f00; color: #FF9800; border: 1px solid #FF9800; }
.dtc-badge.sev-yellow { background: #2d2200; color: #d29922; border: 1px solid #d29922; }
.dtc-badge.sev-gray { background: #1c2128; color: #6e7681; border: 1px solid #6e7681; }
.dtc-badge.sev-green { background: #0d2818; color: #4CAF50; border: 1px solid #4CAF50; }
.dtc-link { text-decoration: none; }
.dtc-link:hover code { color: #FFB74D; text-decoration: underline; }

/* ==================== DTC Admin Modal ==================== */
.dtc-admin-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dtc-admin-box {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  width: 100%;
  max-width: 1200px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dtc-admin-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #30363d;
  background: #161b22;
  flex-shrink: 0;
}
.dtc-admin-head h2 { margin: 0; font-size: 16px; color: #58A6FF; flex: 0; white-space: nowrap; }
.dtc-admin-head input[type="text"]#dtc-admin-filter {
  flex: 1;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.dtc-admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.dtc-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dtc-admin-table th {
  background: #161b22;
  text-align: left;
  padding: 6px 10px;
  border: 1px solid #30363d;
  color: #c9d1d9;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.dtc-admin-table td {
  padding: 4px 8px;
  border: 1px solid #21262d;
  vertical-align: top;
  background: #0d1117;
  color: #c9d1d9;
}
.dtc-admin-table td code {
  color: #79c0ff;
  background: transparent;
  font-family: Consolas, monospace;
}
.dtc-admin-table td a { color: #79c0ff; text-decoration: none; }
.dtc-admin-table td a:hover { color: #FFB74D; text-decoration: underline; }
/* High specificity to beat WordPress theme input styles */
.dtc-admin-modal input.dtc-admin-input,
.dtc-admin-modal textarea.dtc-admin-input,
.dtc-admin-modal #dtc-admin-filter {
  width: 100%;
  background: #0d1117 !important;
  border: 1px solid #21262d !important;
  color: #c9d1d9 !important;
  padding: 4px 6px !important;
  border-radius: 3px !important;
  font-family: inherit !important;
  font-size: 12px !important;
  resize: vertical;
  box-shadow: none !important;
}
.dtc-admin-modal input.dtc-admin-input:focus,
.dtc-admin-modal textarea.dtc-admin-input:focus,
.dtc-admin-modal #dtc-admin-filter:focus {
  border-color: #58A6FF !important;
  outline: none !important;
  background: #0d1117 !important;
  color: #c9d1d9 !important;
}
.dtc-admin-modal input.dtc-admin-input::placeholder,
.dtc-admin-modal textarea.dtc-admin-input::placeholder {
  color: #6e7681 !important;
}

/* ==================== DTC Info Popup ==================== */
.dtc-info-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dtc-info-box {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dtc-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #30363d;
  background: #161b22;
}
.dtc-info-head h2 { margin: 0; font-size: 16px; color: #58A6FF; }
.dtc-info-head h2 code { background: transparent; color: #79c0ff; font-family: Consolas, monospace; }
.dtc-info-close {
  background: transparent; border: none; color: #8b949e;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.dtc-info-close:hover { color: #EF5350; }
.dtc-info-body { padding: 16px 18px; overflow-y: auto; }
.dtc-info-body section { margin-bottom: 14px; }
.dtc-info-body section h3 {
  font-size: 12px; color: #FFB74D;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 4px 0;
  font-weight: 700;
}
.dtc-info-body section p {
  color: #c9d1d9; line-height: 1.5; font-size: 13px; margin: 0;
  white-space: pre-wrap;
}
.dtc-info-btn {
  background: transparent;
  border: 1px solid #30363d;
  color: #58A6FF;
  border-radius: 50%;
  width: 24px; height: 24px;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.dtc-info-btn:hover { background: #1f6feb; color: white; border-color: #1f6feb; }

/* ==================== Vitals Alert Actions ==================== */
.vitals-action-btn {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px 4px 2px 0;
  background: #1f6feb;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.vitals-action-btn:hover { background: #2a7fff; }
.vitals-action-btn:disabled { cursor: not-allowed; }
.vitals-action-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}
.vitals-action-status.running { color: #58A6FF; }
.vitals-action-status.pass { background: #0d2818; color: #4CAF50; border: 1px solid #4CAF50; }
.vitals-action-status.fail { background: #2d1117; color: #EF5350; border: 1px solid #EF5350; }

/* ==================== Generic Notice Banner ==================== */
.evc-notice-warn {
  background: #2d2200;
  border: 1px solid #d29922;
  border-left: 4px solid #d29922;
  color: #e6c46a;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.evc-notice-warn strong { color: #FFB74D; }

.dtc-mod-error {
  padding: 10px 14px;
  background: #2d1117;
  border-top: 1px solid #EF5350;
  color: #EF5350;
  font-size: 12px;
}

/* ==================== Configuration Page ==================== */
.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.config-table th {
  background: #161b22;
  color: #c9d1d9;
  text-align: left;
  padding: 6px 10px;
  border: 1px solid #30363d;
  font-weight: 600;
}
.config-table td {
  padding: 6px 10px;
  border: 1px solid #21262d;
  color: #c9d1d9;
  vertical-align: middle;
  word-break: break-word;
}
.config-table tr:nth-child(even) td { background: #0d1117; }
.config-table tr:nth-child(odd) td { background: #11161d; }
.config-table tr.config-row-locked td { color: #6e7681; }
.config-table .config-key {
  font-family: Consolas, monospace;
  color: #79c0ff;
  font-size: 11px;
}
.config-table .config-current {
  font-weight: 600;
  color: #c9d1d9;
}
.config-table .config-current-empty { color: #6e7681; }
.config-locked-icon {
  color: #6e7681;
  font-size: 13px;
  cursor: help;
}
.config-locked-icon:hover { color: #FF9800; }

/* ==================== Configuration Change Modal ==================== */
.config-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.config-modal-box {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.config-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
.config-modal-head h2 { margin: 0; font-size: 16px; color: #58A6FF; }
.config-modal-close {
  background: transparent; border: none; color: #8b949e;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.config-modal-close:hover { color: #EF5350; }
.config-modal-body { padding: 18px; overflow-y: auto; }
.config-modal-body .row { margin-bottom: 12px; font-size: 13px; }
.config-modal-body .row label { color: #8b949e; display: block; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.config-modal-body .row .v { color: #c9d1d9; font-weight: 600; }
.config-modal-body select.config-modal-select {
  width: 100%;
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  color: #c9d1d9 !important;
  padding: 8px 10px !important;
  border-radius: 4px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  box-shadow: none !important;
  appearance: auto;
}
.config-modal-warn {
  background: #2d2200;
  border: 1px solid #d29922;
  border-left: 4px solid #d29922;
  color: #e6c46a;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  margin: 12px 0;
  line-height: 1.5;
}
.config-modal-warn strong { color: #FFB74D; }
.config-modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid #30363d;
  background: #161b22;
}
.config-modal-status {
  padding: 10px 14px;
  border-radius: 4px;
  margin: 8px 0;
  font-size: 12px;
  font-weight: 600;
}
.config-modal-status.running { background: #161b22; color: #58A6FF; }
.config-modal-status.pass { background: #0d2818; color: #4CAF50; border: 1px solid #4CAF50; }
.config-modal-status.fail { background: #2d1117; color: #EF5350; border: 1px solid #EF5350; }

/* ==================== GTW Reboot Banner ==================== */
.gtw-reboot-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: #2d2200;
  border-bottom: 3px solid #d29922;
  color: #FFB74D;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  z-index: 10002;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.gtw-reboot-banner.active { display: block; }
.gtw-reboot-banner .spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid #FFB74D;
  border-top-color: transparent;
  border-radius: 50%;
  animation: gtw-spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes gtw-spin { to { transform: rotate(360deg); } }

/* === Sub-tabs (used inside pre-ODIN to split REST API / LDU) === */
.evc-subtabs {
  display: flex;
  gap: 4px;
  margin: 6px 0 14px;
  border-bottom: 1px solid #21262d;
}
.evc-subtab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b949e;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  margin-bottom: -1px;        /* overlap the parent border for a clean tab look */
}
.evc-subtab:hover {
  color: #c9d1d9;
  background: rgba(56, 139, 253, 0.05);
}
.evc-subtab.active {
  color: #58A6FF;
  border-bottom-color: #58A6FF;
  background: rgba(56, 139, 253, 0.08);
}

/* === DI counters & identifiers table (pre-ODIN UDS section) ===
   Single 6-column grid so every action's button column lines up
   vertically across all rows. Empty cells where a DID doesn't
   support that action keep the alignment intact. */
.evc-di-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 4px;
}
.evc-di-table {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.4fr)   /* label */
    minmax(180px, 1.8fr)   /* value */
    auto                    /* read */
    140px                   /* write input */
    auto                    /* write btn */
    auto;                   /* reset */
  gap: 8px 10px;
  align-items: center;
  margin-top: 4px;
}
.evc-di-cell {
  border-top: 1px solid #21262d;
  padding: 6px 0;
  display: flex;
  align-items: center;
  min-height: 38px;
}
.evc-di-cell-label {
  font-size: 13px;
  color: #c9d1d9;
}
.evc-di-cell-did {
  font-size: 10px;
  color: #6e7681;
  font-family: ui-monospace, Consolas, monospace;
  margin-left: 6px;
}
.evc-di-cell-value {
  font-size: 12px;
  color: #58A6FF;
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
  padding: 4px 8px;
  background: #0d1117;
  border-radius: 4px;
  border: 1px solid #21262d;
  min-height: 30px;
}
.evc-di-cell-action .evc-btn {
  padding: 4px 12px !important;
  font-size: 12px;
  width: 100%;
}
.evc-di-write-input {
  height: 28px;
  width: 100%;
  font-size: 12px;
  padding: 4px 8px !important;
  font-family: ui-monospace, Consolas, monospace;
}
.evc-di-running { color: #f0b132; }
.evc-di-ok      { color: #3fb950; font-weight: 600; }
.evc-di-err     { color: #f85149; word-break: break-word; }

/* Below 900 px the table collapses: each row stacks (label/value/actions)
   so the page stays usable on a phone or split-screen window. */
@media (max-width: 900px) {
  .evc-di-table {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .evc-di-cell {
    border-top: none;
    padding: 2px 0;
    min-height: 0;
  }
  .evc-di-cell-label { border-top: 1px solid #21262d; padding-top: 8px; }
}

/* BMS battery-pack layout. Mirrors the physical Model S pack: two side-by-
   side columns of 8 modules. Module 1 sits at the bottom-left, modules 2–7
   stack upward, then module 8 is the upper-deck (physically stacked on top
   of M7) so it's rendered narrower to convey "smaller, on top". The right
   column mirrors: M9 at the top-right (upper deck), M10–M16 going down with
   M16 at the bottom-right. Each module shows its 6 bricks as a 3×2 grid. */
.evc-bms-grid { /* this id stays the host; we replace its content with the layout */
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
}
.evc-batt-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Wide central gap = the "spine" of the physical pack. Upper-deck
     modules sit flush against this gap on either side, so the gap is
     also their visible separation. */
  gap: 64px;
  align-items: start;
}
.evc-batt-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
/* Upper-deck modules sit AGAINST the central gap (flush to the inner edge
   of their column), not centered above the column. Visually reads as
   M8 and M9 sitting side-by-side on the upper deck of the pack. */
.evc-batt-col-left  .evc-batt-module-upper { align-self: flex-end; }
.evc-batt-col-right .evc-batt-module-upper { align-self: flex-start; }
.evc-batt-module {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 5px 6px;
  width: 100%;
  box-sizing: border-box;
  /* Side-by-side: info panel | brick grid. The order is reversed for the
     right-column modules so the info column always sits on the OUTER side
     of the pack (toward the page edge), bricks toward the center. */
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-direction: row;
}
.evc-batt-col-right .evc-batt-module {
  flex-direction: row-reverse;
}
.evc-batt-module-upper {
  /* M8 / M9 sit on the upper deck — narrower and centered above the column. */
  width: 78%;
  background: #0a0d12;
  border-color: #21262d;
  align-self: center;
}

/* Subtle highlighting: module containing the pack's absolute min/max cell.
   Cell-level highlight (.min/.max) provides the strong cue; this just tints
   the whole module border so the eye lands on the right "neighbourhood". */
.evc-batt-module.pack-min { border-color: #2d5a2d; background: #0e1410; }
.evc-batt-module.pack-max { border-color: #5a4030; background: #14110e; }

/* Info panel — 1/3 of the module width. Larger text + brighter colors
   for readability; mono font keeps the numbers in clean columns. */
.evc-batt-module-info {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #c9d1d9;
  font-family: ui-monospace, Consolas, monospace;
}
.evc-batt-module-label {
  font-size: 14px;
  font-weight: 700;
  color: #f0f6fc;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-family: -apple-system, "Segoe UI", sans-serif;
}
.evc-batt-module-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  line-height: 1.35;
}
.evc-batt-module-info-row > span:first-child { color: #8b949e; font-weight: 500; }
.evc-batt-module-info-row strong { color: #f0f6fc; font-weight: 700; }
.evc-batt-module-pdelta { color: #c9d1d9; font-weight: 700; }
.evc-batt-module-pdelta.pos { color: #ffa657; }
.evc-batt-module-pdelta.neg { color: #79c0ff; }

/* Brick grid — takes the remaining 2/3 of the module width. */
.evc-batt-module-grid-wrap {
  flex: 2 1 0;
  min-width: 0;
}
.evc-batt-module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

/* Brick tile: vertical SoC bar on the left, all text values on the right. */
.evc-bms-cell {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 5px;
  padding: 5px 6px 6px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
  transition: background 120ms, border-color 120ms;
  min-width: 0;
  min-height: 76px;
}
.evc-bms-cell-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.evc-bms-cell-idx   { color: #8b949e; font-size: 11px; line-height: 1.2; text-align: center; font-weight: 500; }
.evc-bms-cell-v     { color: #f0f6fc; font-weight: 700; font-size: 14px; line-height: 1.25; text-align: center; }
.evc-bms-cell-delta { color: #adbac7; font-size: 11px; line-height: 1.2; text-align: center; margin-top: 2px; font-family: ui-monospace, Consolas, monospace; font-weight: 500; }
.evc-bms-cell-cac   { color: #c9d1d9; font-size: 11px; line-height: 1.2; text-align: center; margin-top: auto; padding-top: 2px; font-family: ui-monospace, Consolas, monospace; }
.evc-bms-cell.stale .evc-bms-cell-v     { color: #484f58; }
.evc-bms-cell.stale .evc-bms-cell-delta { color: #3a4048; }
.evc-bms-cell.stale .evc-bms-cell-cac   { color: #3a4048; }
.evc-bms-cell.fresh { border-color: #1f6feb; }
/* Module-local extremes — subtle border tint, no background change.
   When a cell is also the pack-wide extreme it picks up the stronger
   .min / .max styling below which overrides the border. */
.evc-bms-cell.mod-min { border-color: #2d5a2d; }
.evc-bms-cell.mod-max { border-color: #5a4030; }
/* Pack-wide extremes — clear shading + colored border. */
.evc-bms-cell.min   { background: #1c2a1c; border-color: #3fb950; }
.evc-bms-cell.max   { background: #2a1f1c; border-color: #f0883e; }

/* Vertical SoC bar — fills bottom-up. Height maps onto 3.0V..4.2V Li-ion
   range; color goes red→yellow→green so SoC reads at a glance. */
.evc-bms-cell-bar {
  width: 11px;
  align-self: stretch;
  background: #586069;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.evc-bms-cell-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: #6e7681;
  transition: height 180ms ease, background-color 180ms ease;
}
.evc-bms-cell.stale .evc-bms-cell-bar-fill { background: transparent; }

/* Narrower viewports shrink the central gap progressively, then collapse
   to one column when there's no room left for two. */
@media (max-width: 1100px) { .evc-batt-layout { gap: 28px; } }
@media (max-width: 900px)  { .evc-batt-layout { gap: 16px; } }
@media (max-width: 700px) {
  .evc-batt-layout { grid-template-columns: 1fr; gap: 10px; }
}
