/* HOV Parts Reference — early-2010s enterprise theme */

:root {
  --bg: #dfe3e8;
  --panel: #f4f6f8;
  --panel-head: #e4e8ed;
  --topbar-hi: #46586c;
  --topbar-lo: #33414f;
  --border: #aab3bf;
  --border-soft: #c8cfd8;
  --text: #1c2228;
  --text-dim: #5a6572;
  --thead: #d8dde4;
  --thead-text: #22303e;
  --zebra: #eef1f5;
  --accent: #2d5f8f;
  --accent-hi: #3d74a8;
  --active: #cfe0f0;
  --code-bg: #e8edf2;
  --code-border: #b9c4d0;
  --highlight: #fff3b0;
  --toast-bg: #2f3b47;
  --toast-text: #f0f4f8;
  --nav-bg: #e9ecf0;
}

[data-theme="dark"] {
  --bg: #171b20;
  --panel: #1f242b;
  --panel-head: #262d36;
  --topbar-hi: #2b333d;
  --topbar-lo: #20262e;
  --border: #3a424d;
  --border-soft: #333b45;
  --text: #d3dae2;
  --text-dim: #8b96a3;
  --thead: #2b323c;
  --thead-text: #c6cfda;
  --zebra: #232932;
  --accent: #4a86c5;
  --accent-hi: #5c97d6;
  --active: #24425f;
  --code-bg: #2a323c;
  --code-border: #46505c;
  --highlight: #5c4d14;
  --toast-bg: #39424e;
  --toast-text: #e8edf3;
  --nav-bg: #21262d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", Tahoma, Verdana, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ---- top bar ---- */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: linear-gradient(var(--topbar-hi), var(--topbar-lo));
  border-bottom: 1px solid #1d242c;
  color: #fff;
  flex: 0 0 auto;
}

#brand { display: flex; flex-direction: column; line-height: 1.25; }
#brand-title { font-size: 16px; font-weight: 600; letter-spacing: 1px; }
#brand-sub { font-size: 12px; color: #b8c4d0; }

#topbar-right { display: flex; gap: 8px; align-items: center; }

#global-search {
  width: 340px;
  padding: 4px 8px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #1d242c;
  border-radius: 2px;
  background: #fff;
  color: #1c2228;
}
#global-search:focus { outline: 2px solid #7fb2e5; }

#theme-toggle {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border: 1px solid #1d242c;
  border-radius: 2px;
  background: linear-gradient(#5a6c80, #46586c);
  color: #fff;
  cursor: pointer;
}
#theme-toggle:active { background: #3d4d5f; }

/* ---- layout ---- */
#layout {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

#sidenav {
  flex: 0 0 190px;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  padding: 8px 0;
  overflow-y: auto;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 10px 12px 4px 12px;
}
.nav-label-bottom { border-top: 1px solid var(--border-soft); margin-top: 10px; }

.nav-item {
  display: block;
  padding: 6px 12px;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.nav-item:hover { background: var(--panel-head); }
.nav-item.active {
  background: var(--active);
  border-left-color: var(--accent);
  font-weight: 600;
}

.cdk-sources { padding: 2px 12px 10px 12px; font-size: 12px; line-height: 1.7; color: var(--text-dim); }
.cdk-sources div { display: flex; justify-content: space-between; gap: 6px; cursor: pointer; }
.cdk-sources div:hover { color: var(--text); }
.cdk-sources b { color: var(--text); font-weight: 600; }

.source-links { padding: 2px 12px 10px 12px; font-size: 12px; line-height: 1.9; }
.source-links a { color: var(--text-dim); text-decoration: none; cursor: pointer; }
.source-links a:hover { color: var(--accent); text-decoration: underline; }

#main {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
}

/* ---- panels ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 12px;
  background: var(--panel-head);
  border-bottom: 1px solid var(--border-soft);
}
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-note { font-size: 12px; color: var(--text-dim); }

.panel-body { padding: 12px; }

.subhead {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
}

.fineprint { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* ---- tables ---- */
table.data {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-soft);
  font-size: 13px;
  table-layout: fixed;
}
table.data th {
  background: var(--thead);
  color: var(--thead-text);
  font-weight: 600;
  text-align: left;
  padding: 5px 8px;
  border: 1px solid var(--border-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
table.data td {
  padding: 4px 8px;
  border: 1px solid var(--border-soft);
  vertical-align: top;
  word-wrap: break-word;
}
table.data tr:nth-child(even) td { background: var(--zebra); }
table.data tr:hover td { background: var(--active); }
table.data td.copyable, table.data th { cursor: copy; }
table.data td.copyable { background-image: linear-gradient(transparent, transparent); }

td.num, th.num { text-align: center; }
td.dim { color: var(--text-faint, #999); text-align: center; }
td.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }

.row-hidden { display: none; }
tr.hl td { background: var(--highlight) !important; }

/* ---- fluid model list ---- */
.model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 10px;
  max-height: 118px;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  padding: 6px;
  background: var(--panel);
}
.model-chip {
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  background: var(--panel-head);
  cursor: pointer;
  user-select: none;
}
.model-chip:hover { border-color: var(--accent); }
.model-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ---- battery program notes ---- */
#battery-program { margin-top: 12px; }
.prog-block {
  border: 1px solid var(--border-soft);
  background: var(--panel);
  margin-bottom: 8px;
}
.prog-block h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  background: var(--thead);
  color: var(--thead-text);
  border-bottom: 1px solid var(--border-soft);
}
.prog-block .prog-body { padding: 8px 10px; font-size: 13px; line-height: 1.55; }
.prog-block ul { margin-left: 18px; }
.prog-block li { margin-bottom: 3px; }

/* ---- single use ---- */
.checklist, .auditlist { margin-top: 10px; }
.checklist h4, .auditlist h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--text-dim);
}
.checklist li, .auditlist li {
  font-size: 13px;
  line-height: 1.6;
  list-style: none;
  padding-left: 20px;
  position: relative;
}
.checklist li::before { content: "\2610"; position: absolute; left: 2px; color: var(--accent); }
.auditlist li::before { content: "\25B8"; position: absolute; left: 4px; color: var(--text-dim); }

/* ---- packages ---- */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}
.pkg-card {
  border: 1px solid var(--border-soft);
  background: var(--panel);
}
.pkg-card .pkg-title {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  background: var(--thead);
  color: var(--thead-text);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
}
.pkg-card .pkg-price { font-size: 14px; }
.pkg-card ul { list-style: none; padding: 6px 10px; }
.pkg-card li {
  font-size: 13px;
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}
.pkg-card li::before { content: "\25A0"; position: absolute; left: 2px; font-size: 10px; top: 4px; color: var(--accent); }
.pkg-card li .pkg-pn {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 11px;
  font-family: Consolas, "Courier New", monospace;
  color: var(--accent);
  background: var(--zebra);
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  vertical-align: 1px;
  cursor: copy;
}
.pkg-card li .pkg-pn:hover { background: var(--active); }
.pkg-card .pkg-repeat {
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---- status bar ---- */
#statusbar {
  flex: 0 0 auto;
  padding: 3px 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
}

/* ---- toast ---- */
#toast {
  position: fixed;
  bottom: 34px;
  right: 16px;
  padding: 7px 14px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 13px;
  border-radius: 2px;
  border: 1px solid #14181d;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 50;
}
#toast.show { opacity: 1; }

/* ---- search highlight ---- */
mark { background: var(--highlight); color: inherit; padding: 0 1px; }

/* ---- mobile ---- */
@media (max-width: 760px) {
  #layout { flex-direction: column; }
  #sidenav {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    padding: 4px;
  }
  .nav-label { display: none; }
  .nav-item { border: 1px solid var(--border-soft); margin: 2px; border-radius: 2px; }
  .cdk-sources { display: none; }
  #topbar { flex-wrap: wrap; gap: 6px; }
  #global-search { width: 100%; order: 3; }
  table.data { font-size: 12px; }
}
