/* ── Reset & base ────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg:       #121212;
  --color-surface:  #1e1e1e;
  --color-surface2: #2a2a2a;
  --color-topbar:   #000000;
  --color-accent:   #C8102E;
  --color-accent-hover: #a00d24;
  --color-text:     #e0e0e0;
  --color-text-dim: #888888;
  --color-border:   #333333;
  --color-error:    #ff4444;
  --color-success:  #4caf50;
  --color-warning:  #ff9800;
  --color-data-teal:  #50e6b4;
  --color-data-red:   #ff8a8a;
  --radius:         6px;
  --topbar-h:       56px;
  --sidebar-w:      280px;
}

/* ── Light theme ─────────────────────────────────────── */
[data-theme="light"] {
  --color-bg:           #f5f5f5;
  --color-surface:      #ffffff;
  --color-surface2:     #e8e8e8;
  --color-topbar:       #ffffff;
  --color-accent:       #C8102E;
  --color-accent-hover: #a00d24;
  --color-text:         #1a1a1a;
  --color-text-dim:     #666666;
  --color-border:       #d0d0d0;
  --color-error:        #d32f2f;
  --color-success:      #2e7d32;
  --color-warning:      #e65100;
  --color-data-teal:    #006848;
  --color-data-red:     #a02020;
}

/* Override hardcoded whites/blacks for light mode */
[data-theme="light"] .tab-btn.active,
[data-theme="light"] .prod-item.active,
[data-theme="light"] .admin-placeholder h2,
[data-theme="light"] .detail-header h2,
[data-theme="light"] .sub-tab.active,
[data-theme="light"] .sub-panel-header h3,
[data-theme="light"] .fleet-header h2,
[data-theme="light"] .fc-unit,
[data-theme="light"] .fleet-detail-topbar h2,
[data-theme="light"] .fleet-detail-grid .card h3,
[data-theme="light"] .fd-unit-name,
[data-theme="light"] .fd-metric-hero-val,
[data-theme="light"] .fd-metric-val,
[data-theme="light"] .fc-soc-val,
[data-theme="light"] .modal-header h2,
[data-theme="light"] .card h1,
[data-theme="light"] .dl-title,
[data-theme="light"] .dl-section-title,
[data-theme="light"] .dl-metric-val,
[data-theme="light"] .ps-confirm-title,
[data-theme="light"] .fc-header h3 {
  color: #1a1a1a;
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .seg-btn.active,
[data-theme="light"] .role-pill,
[data-theme="light"] .dl-unit-chip.selected,
[data-theme="light"] .dl-fetch-btn {
  color: #ffffff;
}

[data-theme="light"] .login-brand {
  background: #1a1a1a;
}

[data-theme="light"] .data-table tr:hover td {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .fc-result-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .user-menu-dropdown {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] #topbar {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .fc-inv-badge {
  background: rgba(33, 150, 243, 0.12);
}

[data-theme="light"] .ess-badge-inv {
  background: rgba(33, 150, 243, 0.1);
}

[data-theme="light"] .status-active   { background: rgba(46, 125, 50, 0.12); }
[data-theme="light"] .status-suspended { background: rgba(211, 47, 47, 0.12); }
[data-theme="light"] .status-none     { background: rgba(102, 102, 102, 0.12); }
[data-theme="light"] .status-invite   { background: rgba(230, 81, 0, 0.12); }
[data-theme="light"] .status-temp     { background: rgba(33, 150, 243, 0.12); }

[data-theme="light"] .login-logo-main {
  mix-blend-mode: normal;
}

[data-theme="light"] .btn-danger:hover {
  background: rgba(211, 47, 47, 0.1);
}

[data-theme="light"] .fc-production-badge {
  background: rgba(200, 16, 46, 0.08);
}

[data-theme="light"] .fc-online-pill.online  { background: rgba(46, 125, 50, 0.12); }
[data-theme="light"] .fc-online-pill.offline { background: rgba(211, 47, 47, 0.12); }

[data-theme="light"] .ps-option.active {
  background: rgba(200, 16, 46, 0.04);
}

[data-theme="light"] .ess-badge-on {
  background: rgba(46, 125, 50, 0.1);
}

[data-theme="light"] .ess-badge-off {
  background: rgba(102, 102, 102, 0.1);
}

/* ── Theme toggle button ────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--color-text-dim);
  font-size: 18px;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  border-color: var(--color-border);
  color: var(--color-text);
}

.theme-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Global cursor-following tooltip for [data-tip] elements */
.dl-global-tooltip {
  position: fixed;
  display: none;
  max-width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  white-space: normal;
}
.dl-global-tooltip b { color: #fff; font-weight: 700; }

/* Small "info available" indicator on table headers with tooltips */
.dl-tip-icon {
  font-size: 10px;
  opacity: 0.55;
  margin-left: 4px;
  vertical-align: 1px;
  font-weight: 400;
}
th:hover .dl-tip-icon {
  opacity: 1;
}

/* Mono-value toggle — when on, all data-coloured values revert to default text */
html[data-colors="mono"] .dl-gradient-value,
html[data-colors="mono"] [style*="--color-data-red"],
html[data-colors="mono"] [style*="--color-data-teal"],
html[data-colors="mono"] .dl-metric.m-green .dl-metric-lbl,
html[data-colors="mono"] .dl-metric.m-green .dl-metric-val,
html[data-colors="mono"] .dl-metric.m-green .dl-metric-unit,
html[data-colors="mono"] .dl-metric.m-amber .dl-metric-lbl,
html[data-colors="mono"] .dl-metric.m-amber .dl-metric-val,
html[data-colors="mono"] .dl-metric.m-amber .dl-metric-unit,
html[data-colors="mono"] .dl-metric.m-red .dl-metric-lbl,
html[data-colors="mono"] .dl-metric.m-red .dl-metric-val,
html[data-colors="mono"] .dl-metric.m-red .dl-metric-unit {
  color: var(--color-text) !important;
}

/* Neutralize the tinted KPI card backgrounds and borders too */
html[data-colors="mono"] .dl-metric.m-green,
html[data-colors="mono"] .dl-metric.m-amber,
html[data-colors="mono"] .dl-metric.m-red {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ── Topbar ──────────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--color-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  border-bottom: 2px solid var(--color-accent);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar-logo-img {
  height: 32px;
  width: auto;
}

.topbar-nav {
  display: flex;
  gap: 4px;
}

.topbar-nav[hidden] { display: none; }

.tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
  color: var(--color-text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  color: #ffffff;
  border-bottom-color: var(--color-accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#topbar-user {
  font-size: 13px;
  color: var(--color-text-dim);
}

.role-pill {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 10px;
  background: var(--color-accent);
  color: #ffffff;
}

.role-pill[hidden] { display: none; }

/* Production switcher dropdown */
.prod-switcher {
  width: auto;
  min-width: 160px;
  max-width: 240px;
  margin-bottom: 0;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.prod-switcher[hidden] { display: none; }

/* User menu dropdown */
.user-menu-wrap { position: relative; }
.user-menu-wrap[hidden] { display: none; }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  color: var(--color-text-dim);
  transition: border-color 0.15s;
}

.user-menu-btn:hover {
  border-color: var(--color-border);
}

.user-menu-caret {
  font-size: 10px;
  color: var(--color-text-dim);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 1100;
  overflow: hidden;
}

.user-menu-dropdown[hidden] { display: none; }

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
}

.user-menu-item:hover {
  background: var(--color-surface2);
}

.user-menu-item-danger {
  color: var(--color-error);
}

/* ── Screens ─────────────────────────────────────────── */
.screen {
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

.screen-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen[hidden] {
  display: none;
}

/* ── Login two-panel ─────────────────────────────────── */
.login-screen {
  display: flex;
  margin-top: 0;
  min-height: 100vh;
}

.login-brand {
  width: 280px;
  min-width: 280px;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 0;
}

.login-logo-main {
  width: 200px;
  height: auto;
  mix-blend-mode: screen;
}

.login-powered-by {
  margin-top: 28px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #555555;
  text-transform: uppercase;
}

.login-logo-tb {
  width: 220px;
  height: auto;
  margin-top: 10px;
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Password strength bar ───────────────────────────── */
.pw-strength {
  margin-bottom: 16px;
}

.pw-strength-track {
  width: 100%;
  height: 6px;
  background: var(--color-surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.pw-strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s, background 0.2s;
}

.pw-strength-label {
  font-size: 11px;
  font-weight: 600;
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
}

.card-narrow {
  width: 100%;
  max-width: 400px;
}

.card h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #ffffff;
}

/* ── Forms ───────────────────────────────────────────── */
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--color-text-dim);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-accent);
}

input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.hint {
  font-size: 13px;
  color: var(--color-text-dim);
  margin-bottom: 20px;
}

.form-error {
  font-size: 13px;
  color: var(--color-error);
  margin-bottom: 12px;
}

.form-error[hidden] {
  display: none;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > * {
  flex: 1;
}

/* Permissions checklist */
.cust-perms-list {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.cust-perms-list[hidden] { display: none; }

.perm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
}

.perm-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--color-accent);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--color-surface2);
  color: var(--color-text);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--color-border);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-danger {
  color: var(--color-error);
  border-color: var(--color-error);
}

.btn-danger:hover {
  background: rgba(255, 68, 68, 0.15);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
}

/* ── Unit assignment actions ─────────────────────────── */
.pu-actions {
  white-space: nowrap;
  display: flex;
  gap: 4px;
}
.pu-date-input {
  font-size: 12px;
  padding: 3px 6px;
  background: var(--color-surface2);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  width: 130px;
}
.btn-save {
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-save:hover { background: #219a52; }

/* ── Admin layout ────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

.admin-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 0;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-header h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
}

.production-list {
  padding: 8px 0;
}

.prod-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
  border-left: 3px solid transparent;
}

.prod-item:hover {
  background: var(--color-surface2);
}

.prod-item.active {
  background: var(--color-surface2);
  border-left-color: var(--color-accent);
  color: #ffffff;
}

.prod-item-meta {
  display: block;
  font-size: 11px;
  color: var(--color-text-dim);
  margin-top: 2px;
}

/* Archived productions panel */
.archived-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.archived-card {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px 20px;
}
.archived-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.archived-tag {
  display: inline-block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.82em;
  margin: 2px;
}

.sidebar-section {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}

.sidebar-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
  margin-bottom: 8px;
}

.sidebar-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 0;
  font-size: 14px;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.1s;
}

.sidebar-link:hover {
  color: var(--color-accent);
}

/* ── Admin main panel ────────────────────────────────── */
.admin-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.admin-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

.admin-placeholder h2 {
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 8px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.detail-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

/* ── Sub-tabs ────────────────────────────────────────── */
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
}

.sub-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.sub-tab:hover {
  color: var(--color-text);
}

.sub-tab.active {
  color: #ffffff;
  border-bottom-color: var(--color-accent);
}

.sub-panel[hidden] { display: none; }

.sub-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sub-panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

/* ── Data tables ─────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table .empty-row td {
  text-align: center;
  color: var(--color-text-dim);
  padding: 24px 12px;
}

/* ── Status badges ───────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  text-transform: uppercase;
}

.status-active      { background: rgba(76, 175, 80, 0.2); color: var(--color-success); }
.status-suspended   { background: rgba(255, 68, 68, 0.2); color: var(--color-error); }
.status-none        { background: rgba(136, 136, 136, 0.2); color: var(--color-text-dim); }
.status-invite      { background: rgba(255, 152, 0, 0.2); color: var(--color-warning); }
.status-temp        { background: rgba(33, 150, 243, 0.2); color: #2196f3; }

/* ── Fleet grid ──────────────────────────────────────── */
.fleet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.fleet-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

.fleet-header select {
  width: auto;
  min-width: 200px;
  margin-bottom: 0;
}

.fleet-header #fleet-search {
  width: 180px;
  margin-bottom: 0;
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  padding: 24px;
}

.fleet-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 24px 0;
  font-size: 12px;
  flex-wrap: wrap;
}
.fleet-refresh-info { display: inline-flex; gap: 8px; align-items: center; }
.fleet-refresh-sep  { opacity: 0.4; }
#fleet-refresh-btn[disabled] { opacity: 0.6; cursor: progress; }
.fd-refresh { margin-left: auto; display: inline-flex; align-items: center; }
#fd-refresh-btn[disabled] { opacity: 0.6; cursor: progress; }

.fleet-errors-btn {
  /* Default: clean state, dim outline so it reads as "monitor is alive, no issues." */
  background: rgba(46, 204, 113, 0.10);
  color: rgb(46, 204, 113);
  border: 1px solid rgba(46, 204, 113, 0.5);
  font-weight: 600;
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fleet-errors-btn .fleet-errors-icon { font-size: 13px; }
.fleet-errors-btn[disabled] { opacity: 0.85; }
/* Alert state: at least one unit had a failed start in the window. */
.fleet-errors-btn.has-errors {
  background: rgba(231, 76, 60, 0.15);
  color: rgb(231, 76, 60);
  border-color: rgba(231, 76, 60, 0.6);
  cursor: pointer;
}
.fleet-errors-btn.has-errors:hover { background: rgba(231, 76, 60, 0.25); }
.fleet-errors-btn.active {
  background: rgb(231, 76, 60);
  color: #fff;
}
/* Per-card flag for units with a recent failed start */
.fc-error-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgb(231, 76, 60);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.fleet-card.has-error {
  border-color: rgba(231, 76, 60, 0.6);
  box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.3);
}
.dl-gen-failed-row { background: rgba(231, 76, 60, 0.06); }

.fd-chart-view-tabs {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-right: 8px;
  flex-shrink: 0;
}
.fd-chart-view-tab {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--color-text-dim);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.fd-chart-view-tab:hover { color: var(--color-text); }
.fd-chart-view-tab.active {
  background: var(--color-accent);
  color: #fff;
}

/* ── Fleet card (table-style) ────────────────────────── */
.fleet-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
  overflow: hidden;
}

.fleet-card:hover {
  border-color: var(--color-accent);
}

.fc-header {
  padding: 14px 16px 0;
}

.fc-unit {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.fc-classgen {
  padding: 2px 16px 0;
  font-size: 12px;
  color: var(--color-text-dim);
  font-weight: 500;
}

.fc-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}

.fc-production-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(200, 16, 46, 0.12);
  color: var(--color-accent);
}

.fc-online-pill {
  display: inline-block;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 8px;
}

.fc-online-pill.online  { background: rgba(76,175,80,0.2); color: var(--color-success); }
.fc-online-pill.offline { background: rgba(255,68,68,0.2);  color: var(--color-error); }
/* Stale-data pill — shown when a unit's cached live_data is older than
   the normal refresh interval (currently 15 min, vs the 5-min cron). Off-
   rent units skip the cron entirely so their age grows unbounded. */
.fc-stale-pill {
  display: inline-block;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 8px;
  background: rgba(255,152,0,0.18);
  color: var(--color-warning);
  margin-left: 6px;
}

/* AC input state pill — Shore / Generator rows */
.ac-pill {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 7px;
  vertical-align: middle;
}
.ac-pill-on   { background: rgba(76,175,80,0.2);  color: var(--color-success); }
.ac-pill-idle { background: rgba(255,180,0,0.18); color: var(--color-warning); }
.ac-pill-off  { background: rgba(160,160,160,0.18); color: var(--color-text-dim); }

/* SOC bar */
.fc-soc {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
}

.fc-soc-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
}

.fc-soc-label { color: var(--color-text-dim); }
.fc-soc-val   { color: #ffffff; font-weight: 700; }

.fc-soc-track {
  width: 100%;
  height: 8px;
  background: var(--color-surface2);
  border-radius: 4px;
  overflow: hidden;
}

.fc-soc-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s;
}

/* Data rows */
.fc-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.fc-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}

.fc-row:nth-child(odd) {
  border-right: 1px solid var(--color-border);
}

.fc-row-label { color: var(--color-text-dim); }
.fc-row-val   { color: var(--color-text); font-weight: 500; }

/* Inverter badge at bottom */
.fc-footer {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-dim);
}

.fc-inv-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 8px;
  background: rgba(33,150,243,0.2);
  color: #2196f3;
}

/* Solar Priority pill on fleet cards. Pushed to the right of the footer so
   the inverter badge stays anchored to the "Inverter" label. Matches
   .fd-solar-pill semantics — neutral when off, green when on. */
.fc-solar-pill {
  margin-left: auto;
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 8px;
  background: var(--color-surface2);
  color: var(--color-text-dim);
  border: 1px solid var(--color-border);
}
.fc-solar-pill.on {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  border-color: rgba(34, 197, 94, 0.4);
}

/* ── Fleet detail view ────────────────────────────────── */
/* ── Fleet Controls dashboard ────────────────────────── */
.fc-section {
  margin: 0 24px 20px;
  padding: 20px 24px;
}
.fc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.fc-header h3 { margin: 0; font-size: 18px; }
.fc-hint {
  font-size: 12px;
  color: var(--color-text-dim);
  margin: 0 0 16px;
}
.fc-unit-picker { margin-bottom: 18px; }
.fc-unit-picker-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.fc-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.fc-control-card {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.fc-control-card h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.fc-select {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.fc-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc-input {
  flex: 1;
  width: auto;
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
  background: var(--color-surface);
  color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.fc-input::placeholder {
  /* Match the brightness of the select's "— No change —" option so the
     control doesn't look disabled. */
  color: var(--color-text);
  opacity: 1;
}
.fc-unit { font-size: 12px; color: var(--color-text-dim); }
.fc-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.fc-execute-btn {
  padding: 8px 24px;
  font-size: 14px;
}
.fc-status {
  font-size: 13px;
  color: var(--color-text-dim);
}
.fc-results {
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
}
.fc-results h4 {
  margin: 0 0 10px;
  font-size: 14px;
}
.fc-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.fc-result-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}
.fc-result-ok .fc-result-icon { color: #27ae60; }
.fc-result-fail .fc-result-icon { color: #e74c3c; }
.fc-result-name { font-weight: 600; min-width: 70px; }
.fc-result-msg { color: var(--color-text-dim); }

.fleet-detail[hidden] { display: none; }

.fleet-detail-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
}

.fleet-detail-topbar h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

.fleet-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
  align-items: start;
}

/* No controls perm → only dashboard renders, span full width */
.fleet-detail-grid.fd-grid-single {
  grid-template-columns: 1fr;
}

.fd-chart-card {
  margin: 0 24px 24px;
  padding: 16px;
}
.fd-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.fd-chart-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fd-chart-date-input {
  width: auto;
  margin: 0;
  padding: 4px 6px;
  font-size: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.fd-chart-wrap {
  position: relative;
  height: 320px;
}
.fd-chart-hint {
  font-size: 11px;
  color: var(--color-text-dim);
  text-align: center;
  margin-top: 6px;
}

.fd-chart-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.fd-total-box {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-text-dim);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.fd-total-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
  margin-bottom: 3px;
}
.fd-total-val {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}
.fd-total-val .fd-total-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-dim);
  margin-left: 3px;
}

.fleet-detail-grid .card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 16px;
}

.fd-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Detail dashboard (left panel) ───────────────────── */
.fd-dashboard {
  padding: 0 !important;
  overflow: hidden;
}

.fd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 0;
}

.fd-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-offline-duration {
  font-size: 12px;
  color: var(--color-text-dim);
}

.fd-unit-name {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.fd-classgen {
  padding: 2px 24px 0;
  font-size: 13px;
  color: var(--color-text-dim);
}

.fd-production {
  padding: 8px 24px 14px;
  min-height: 36px;
}

/* SOC hero metric */
.fd-metric-hero {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface2);
}

.fd-metric-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.fd-metric-hero-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
}

.fd-metric-hero-val {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
}

.fd-soc-track {
  height: 10px;
}

/* Metric cards grid */
.fd-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--color-border);
}

.fd-metric {
  padding: 14px 24px;
  border-bottom: 1px solid var(--color-border);
}

.fd-metric:nth-child(odd) {
  border-right: 1px solid var(--color-border);
}

.fd-metric:nth-last-child(-n+2) {
  border-bottom: none;
}

.fd-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
  margin-bottom: 4px;
}

.fd-metric-val {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.fd-metric-val.offline {
  color: var(--color-text-dim);
  font-size: 16px;
}

.fd-metric-sub {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-top: 2px;
}

.fd-offline-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 4px;
  background: rgba(255,68,68,0.15);
  color: var(--color-error);
  margin-left: 4px;
  vertical-align: middle;
}

/* Power Source (left) + Rental dates (right) row at the bottom of the card. */
.fd-source-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--color-border);
}
.fd-active-source {
  display: flex;
  flex-direction: column;
}
.fd-active-source-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
  margin-bottom: 4px;
}
.fd-active-source-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-success);
}

.fd-source-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.fd-rental {
  font-size: 13px;
  color: var(--color-text-dim);
  text-align: right;
}

.fd-rental[hidden] { display: none; }

/* Solar Priority status pill — indicator only, distinct from action buttons.
   On = relay closed (AC charging gated by SOC assistant);
   Off = relay open (no gating). VRM/MQTT can't write this back to the device. */
.fd-solar-pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-surface2);
  color: var(--color-text-dim);
  border: 1px solid var(--color-border);
}
.fd-solar-pill.on {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  border-color: rgba(34, 197, 94, 0.4);
}
.fd-solar-pill[hidden] { display: none; }

/* ── Admin inverter controls ─────────────────────────── */
.admin-ctrl-row {
  margin-bottom: 16px;
}

.admin-ctrl-row:last-of-type {
  margin-bottom: 0;
}

.admin-ctrl-row > label {
  margin-bottom: 6px;
}

/* Compact spacing for the fleet-detail Controls card so it doesn't
   tower next to the dashboard column. */
#fleet-detail-admin {
  padding: 20px 24px;
}
#fleet-detail-admin > div:first-child {
  margin-bottom: 8px !important;
}
#fleet-detail-admin > .hint {
  margin-bottom: 14px;
}
#fleet-detail-admin .admin-ctrl-row {
  margin-bottom: 10px;
}
#fleet-detail-admin .admin-ctrl-row > label {
  margin-bottom: 3px;
}

/* Segmented button group */
.seg-group {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.seg-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-surface2);
  color: var(--color-text-dim);
  border: none;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn:hover {
  color: var(--color-text);
  background: var(--color-border);
}

.seg-btn.active {
  background: var(--color-accent);
  color: #ffffff;
}

.seg-group-2 .seg-btn {
  min-width: 60px;
}

/* Editable chip */
.chip-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip-input {
  width: 90px !important;
  margin-bottom: 0 !important;
  padding: 6px 10px !important;
  font-size: 14px !important;
  text-align: right;
}

.chip-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-dim);
  min-width: 18px;
}

.chip-save {
  margin-left: 4px;
}

/* ESS mode badge */
.ess-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 4px;
}

.ess-badge-on {
  background: rgba(76, 175, 80, 0.15);
  color: var(--color-success);
}

.ess-badge-off {
  background: rgba(136, 136, 136, 0.15);
  color: var(--color-text-dim);
}

.ess-badge-inv {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
}

/* ── Power Source — Active bar ────────────────────────── */
.ps-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.ps-active-label {
  font-size: 12px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.ps-active-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-success);
}

.ps-change-btn {
  margin-bottom: 16px;
}

/* ── Power Source — option cards ──────────────────────── */
.ps-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-options[hidden] { display: none; }

.ps-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface2);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ps-option:hover {
  border-color: var(--color-text-dim);
}

.ps-option.active {
  border-color: var(--color-accent);
  background: rgba(200, 16, 46, 0.06);
}

.ps-option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  position: relative;
}

.ps-option.active .ps-option-radio {
  border-color: var(--color-accent);
}

.ps-option.active .ps-option-radio::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.ps-option-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.ps-option-desc {
  font-size: 12px;
  color: var(--color-text-dim);
}

/* ── Power Source — confirm panel ─────────────────────── */
.ps-confirm {
  margin-top: 16px;
  padding: 20px;
  background: var(--color-surface2);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
}

.ps-confirm[hidden] { display: none; }

.ps-confirm-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.ps-confirm-body {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 16px;
}

.ps-confirm-body .warn {
  color: var(--color-accent);
  font-weight: 700;
}

.ps-confirm-actions {
  display: flex;
  gap: 8px;
}

/* ── Data Logs ───────────────────────────────────────── */
/* ── Data Logs — page layout ────────────────────────── */
.dl-page {
  padding: 20px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.dl-page-header { margin-bottom: 16px; }
.dl-title { font-size: 20px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.dl-subtitle { font-size: 13px; color: var(--color-text-dim); }

/* ── Data Logs — cards ─────────────────────────────── */
.dl-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.dl-card-inner { padding: 16px 20px; }
.dl-card-inner-top { padding-top: 12px; }
.dl-section-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 10px; }

.dl-chart-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}
.dl-chart-tab {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.dl-chart-tab:hover { color: var(--color-text); }
.dl-chart-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

/* Pie chart hover affordances */
.dl-pie-svg [data-slice-idx] {
  cursor: pointer;
  transition: opacity 0.12s, filter 0.12s;
}
.dl-pie-svg [data-slice-idx]:hover,
.dl-pie-svg [data-slice-idx].dl-slice-active {
  filter: brightness(1.15);
}
.dl-pie-svg [data-slice-idx]:hover ~ [data-slice-idx],
.dl-pie-svg:has([data-slice-idx].dl-slice-active) [data-slice-idx]:not(.dl-slice-active) {
  opacity: 0.55;
}
.dl-pie-row.dl-row-active {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
[data-theme="light"] .dl-pie-row.dl-row-active {
  background: rgba(0, 0, 0, 0.05);
}

/* Cursor-following pie tooltip */
.dl-pie-tooltip {
  position: fixed;
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  white-space: nowrap;
}
.dl-pie-tooltip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.dl-pie-tooltip-label { font-weight: 700; }
.dl-pie-tooltip-val   { color: var(--color-text-dim); }
.dl-hint { font-size: 12px; color: var(--color-text-dim); margin-bottom: 10px; }

/* ── Data Logs — filter bar ────────────────────────── */
.dl-filter-card { padding: 16px 20px; }
.dl-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.dl-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dl-filter-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
}
.dl-filter-group select,
.dl-filter-group input[type="date"] {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface2);
  color: var(--color-text);
}
.dl-filter-group select[multiple] {
  height: auto;
  min-width: 180px;
}
.dl-fetch-btn {
  padding: 7px 20px;
  min-width: 110px;
  border-radius: var(--radius);
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.dl-fetch-btn:hover { background: var(--color-accent-hover); }
.dl-fetch-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dl-show-settings-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.dl-show-settings-btn:hover { background: var(--color-surface2); border-color: var(--color-accent); }

/* ── Data Logs — unit chips ───────────────────────── */
.dl-unit-chips-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.dl-unit-chips-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.dl-unit-chips-actions {
  font-size: 11px;
}
.dl-unit-chips-actions a {
  color: var(--color-accent);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}
.dl-unit-chips-actions a:hover {
  text-decoration: underline;
}
.dl-chips-sep {
  color: var(--color-text-dim);
  margin: 0 4px;
}
.dl-unit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dl-unit-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-dim);
  user-select: none;
}
.dl-unit-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}
.dl-unit-chip.selected {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.dl-unit-chip.selected:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}
.dl-unit-chip .chip-type {
  font-weight: 400;
  opacity: 0.7;
  margin-left: 4px;
  font-size: 11px;
}

/* ── Data Logs — metric cards ──────────────────────── */
.dl-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.dl-metric {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.dl-metric-lbl { font-size: 11px; color: var(--color-text-dim); margin-bottom: 4px; }
.dl-metric-val { font-size: 22px; font-weight: 500; color: #fff; }
.dl-metric-unit { font-size: 11px; color: var(--color-text-dim); margin-left: 3px; }
.dl-metric.m-green { background: #0d2818; border-color: #1a6b3c; }
.dl-metric.m-green .dl-metric-lbl,
.dl-metric.m-green .dl-metric-val,
.dl-metric.m-green .dl-metric-unit { color: #5dcaa5; }
.dl-metric.m-amber { background: #2a1f0a; border-color: #8a6a1a; }
.dl-metric.m-amber .dl-metric-lbl,
.dl-metric.m-amber .dl-metric-val,
.dl-metric.m-amber .dl-metric-unit { color: #ef9f27; }
.dl-metric.m-red { background: #2a0f0f; border-color: #8a2a2a; }
.dl-metric.m-red .dl-metric-lbl,
.dl-metric.m-red .dl-metric-val,
.dl-metric.m-red .dl-metric-unit { color: #f09595; }

/* ── Data Logs — sustainability cell colors ────────── */
.dl-sustain { font-weight: 600; }
.dl-s-green { color: #5dcaa5; }
.dl-s-amber { color: #ef9f27; }
.dl-s-red   { color: #f09595; }

/* ── Data Logs — fleet table ───────────────────────── */
.dl-fleet-tbl { min-width: 760px; }
.dl-bank-row td {
  border-top: 2px solid #5dcaa5;
  border-bottom: 2px solid #5dcaa5;
}
.dl-bank-row td:first-child {
  border-left: 2px solid #5dcaa5;
}
.dl-bank-row td:last-child {
  border-right: 2px solid #5dcaa5;
}
.dl-totals-row td {
  border-top: 2px solid var(--color-text-dim);
  border-bottom: 2px solid var(--color-text-dim);
}
.dl-fleet-header-repeat th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
  padding: 10px 8px 6px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255,255,255,0.02);
}
.dl-fleet-unit-row:hover td {
  background: rgba(255, 255, 255, 0.04);
}
.dl-unit-detail td {
  border-bottom: 1px solid var(--color-border);
}
.dl-unit-detail .data-table td {
  padding: 6px 10px;
}
.dl-unit-detail .data-table th {
  padding: 6px 10px;
  font-size: 11px;
}

/* Center-align values in Data Logs tables */
#tab-data .data-table th,
#tab-data .data-table td {
  text-align: center;
}

/* Weekly view — week-level rows */
.dl-week-row td {
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.dl-week-row:hover td {
  background: rgba(255, 255, 255, 0.07);
}
.dl-week-unit-row:hover td {
  background: rgba(255, 255, 255, 0.04);
}
.dl-week-day-detail td {
  border-bottom: 1px solid var(--color-border);
}
.dl-week-day-detail .data-table td {
  padding: 6px 10px;
}
.dl-week-day-detail .data-table th {
  padding: 6px 10px;
  font-size: 11px;
}

/* ── Data Logs — charts ────────────────────────────── */
.dl-chart-wrap { position: relative; width: 100%; height: 260px; }
.dl-chart-short { height: 200px; }
.dl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--color-text-dim);
}
.dl-leg-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── Data Logs — pie chart layout ────────────────── */
.dl-pie-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  padding: 12px 0;
}
/* Unit selector for the Solar % chart — chips below the pie that let
   the user drill from Fleet into individual units. Takes the full row
   below the pie + legend via flex-basis: 100%. */
/* Marketing/explainer panel that sits to the right of the legend.
   Bounded width so it stays readable, soft border to mark it as a
   sidebar rather than another stat tile. */
.dl-solar-pct-blurb {
  flex: 1 1 360px;
  max-width: 640px;
  min-width: 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid #EF9F27;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-dim);
}
.dl-solar-pct-blurb-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}
.dl-solar-pct-blurb p { margin: 0 0 8px; }
.dl-solar-pct-blurb p:last-child { margin-bottom: 0; }
/* Bold text in the blurbs gets the brighter --color-text so emphasized
   phrases visually pop against the dim body copy. Applies to every
   blurb on the chart-tab sidebar. */
.dl-solar-pct-blurb b { color: var(--color-text); font-weight: 700; }
.dl-solar-pct-blurb-foot {
  font-style: italic;
  opacity: 0.85;
}
/* Vertical priority chain: Solar → Battery → Shore → Backup Gen.
   Rendered inside an explainer blurb to visualize the source-priority
   logic the units actually run. Vertical stack keeps all four pills
   on their own line so the chain reads top-to-bottom as priority. */
.dl-priority-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}
.dl-priority-chain-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.dl-priority-chain-sub {
  font-size: 11px;
  font-style: italic;
  color: var(--color-text-dim);
  text-align: center;
  margin-bottom: 10px;
  max-width: 280px;
  line-height: 1.4;
}
.dl-priority-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  min-width: 150px;
  justify-content: center;
}
.dl-priority-icon {
  font-size: 14px;
  line-height: 1;
}
.dl-priority-arrow {
  font-size: 14px;
  color: var(--color-text-dim);
  line-height: 1;
}
.dl-priority-step-last {
  opacity: 0.6;
  border-style: dashed;
}
.dl-priority-suffix {
  font-weight: 400;
  font-style: italic;
  color: var(--color-text-dim);
  font-size: 11px;
  margin-left: 2px;
}

.dl-solar-pct-chips {
  flex-basis: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
}
.dl-solar-pct-chips-label {
  flex-shrink: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--color-text-dim);
  padding-top: 6px;
}
.dl-solar-pct-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dl-solar-pct-chip {
  cursor: pointer;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.1s, border-color 0.1s;
}
.dl-solar-pct-chip:hover {
  border-color: var(--color-accent);
}
.dl-solar-pct-chip.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  font-weight: 600;
}
.dl-pie-svg {
  flex-shrink: 0;
}
.dl-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dl-pie-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.dl-pie-row .dl-leg-swatch {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.dl-pie-label {
  min-width: 140px;
  color: var(--color-text);
}
.dl-pie-val {
  min-width: 80px;
  text-align: right;
  color: var(--color-text-dim);
  font-variant-numeric: tabular-nums;
}
.dl-pie-pct {
  min-width: 45px;
  text-align: right;
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.dl-pie-total {
  border-top: 1px solid var(--color-border);
  padding-top: 6px;
  margin-top: 2px;
}

/* ── Data Logs — unit search ─────────────────────── */
#dl-unit-search::placeholder { color: var(--color-muted); }
#dl-unit-results { box-shadow: 0 4px 12px rgba(0,0,0,.4); }
#dl-unit-results::-webkit-scrollbar { width: 6px; }
#dl-unit-results::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

/* ── Data Logs — collapsible sections ──────────────── */
.dl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  cursor: pointer;
  user-select: none;
}
.dl-card-header:hover { background: var(--color-surface2); }
.dl-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dl-chevron {
  font-size: 11px;
  color: var(--color-text-dim);
  transition: transform 0.2s;
}
.dl-chevron.open { transform: rotate(180deg); }
.dl-collapsible { display: none; border-top: 1px solid var(--color-border); }
.dl-collapsible.open { display: block; }

/* ── Data Logs — badges ────────────────────────────── */
.dl-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.dl-badge-amber { background: #3d2c0a; color: #ef9f27; }
.dl-badge-red   { background: #3d1414; color: #f09595; }
.dl-badge-blue  { background: #0a1f3d; color: #85b7eb; }
.dl-badge-green { background: #0a3d1f; color: #5dcaa5; }

/* ── Data Logs — gen table ─────────────────────────── */
.dl-gen-tbl { min-width: 700px; }
.dl-early-flag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #3d1414;
  color: #f09595;
  font-weight: 600;
}

/* ── Data Logs — detail table ──────────────────────── */
.dl-detail-tbl { min-width: 640px; }

/* ── Data Logs — export buttons ────────────────────── */
.dl-export-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dl-tab-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.dl-tab-footer .dl-exp-btn { font-size: 11px; padding: 3px 10px; }

/* ── Metric card hide/show controls ──────────────────── */
.dl-metric { position: relative; }
.dl-metric-hide,
.dl-metric-show {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
}
.dl-metric-hide:hover,
.dl-metric-show:hover { color: var(--color-accent); background: var(--color-surface2); }
.dl-metric-show { display: none; }
.dl-metric.metric-hidden {
  padding: 4px 28px 4px 10px;
  min-height: 0;
}
.dl-metric.metric-hidden .dl-metric-val { display: none; }
.dl-metric.metric-hidden .dl-metric-hide { display: none; }
.dl-metric.metric-hidden .dl-metric-show { display: inline-block; }
.dl-metric.metric-hidden .dl-metric-lbl { font-size: 11px; }

/* ── Inline column hide/show controls ────────────────── */
.dl-col-th { display: inline-flex; align-items: center; gap: 4px; }
.dl-col-label { display: inline-flex; align-items: center; gap: 4px; }
.dl-col-collapse,
.dl-col-expand {
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  padding: 0 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
}
.dl-col-collapse:hover,
.dl-col-expand:hover { color: var(--color-accent); background: var(--color-surface2); }
.dl-col-expand { display: none; }

/* Collapsed column — narrow strip with just the expand button visible */
th.col-hidden,
td.col-hidden {
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  padding: 2px 1px !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
td.col-hidden  { font-size: 0 !important; color: transparent !important; pointer-events: none; }
td.col-hidden * { visibility: hidden !important; }
th.col-hidden .dl-col-th    { display: none; }
th.col-hidden .dl-col-expand { display: inline-block; }

/* ── Gen reason cell (click-to-edit) ─────────────────── */
.dl-gen-reason-cell {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 22px 2px 4px;
  margin: -2px -4px;
  display: inline-block;
  position: relative;
}
.dl-gen-reason-cell:hover,
.dl-gen-reason-cell:focus { background: var(--color-surface2); outline: none; }
.dl-gen-reason-cell .dl-cond-caret { position: absolute; top: 2px; right: 4px; font-size: 14px; }

/* ── Notes column (sits between Date and Conditions) ─── */
.dl-notes-col { width: 28px; text-align: center; padding: 0 4px; }
.dl-notes-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1;
}
.dl-notes-cell:focus { outline: none; }
.dl-notes-cell.has-notes { color: var(--color-accent); }

/* ── Condition override picker ───────────────────────── */
.dl-cond-cell {
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 18px 4px 4px;   /* room for the corner caret */
  margin: -4px -4px;
  display: block;
  position: relative;
}
.dl-cond-cell:hover,
.dl-cond-cell:focus {
  background: var(--color-surface2);
  outline: none;
}
.dl-cond-star {
  color: var(--color-accent);
  font-weight: 700;
  margin-left: 2px;
}
.dl-cond-caret {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 28px;
  line-height: 1;
  color: var(--color-text-dim);
  opacity: 0.7;
}
.dl-cond-cell:hover .dl-cond-caret,
.dl-cond-cell:focus .dl-cond-caret {
  opacity: 1;
  color: var(--color-accent);
}
.dl-cond-picker { padding: 4px 2px; }
.dl-cond-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.dl-cond-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.dl-cond-opt:hover { background: var(--color-surface2); }
.dl-cond-opt.active {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}
.dl-cond-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text);
  cursor: pointer;
}

/* ── Shore-source picker (2×2 grid: BG/G top, TB/BB bottom) ───
   Four explicit buttons so producers can mark a day with any of the
   four sources without the picker guessing based on what gear is in
   the show — useful when a production tries different battery systems
   over the same run. Internal dividers via nth-child rules instead of
   the old `+ .dl-shore-btn` sibling selector that only worked in a
   single flex row. */
.dl-shore-toggle {
  display: inline-grid;
  grid-template-columns: auto auto;
  margin-left: 8px;
  vertical-align: middle;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}
.dl-shore-btn {
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
}
/* Column separators (right border on left column) */
.dl-shore-btn:nth-child(2n+1) { border-right: 1px solid var(--color-border); }
/* Row separators (bottom border on top row) */
.dl-shore-btn:nth-child(-n+2) { border-bottom: 1px solid var(--color-border); }
.dl-shore-btn:hover:not(.active):not(:disabled) { background: var(--color-surface2); color: var(--color-text); }
.dl-shore-btn.active { background: var(--color-accent); color: var(--color-bg); cursor: default; }
.dl-shore-btn:disabled { opacity: 0.5; cursor: wait; }
.dl-exp-btn {
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}
.dl-exp-btn:hover { background: var(--color-surface2); }

/* ── Data Logs — status bar ────────────────────────── */
.dl-status {
  font-size: 11px;
  color: var(--color-text-dim);
  text-align: center;
  padding: 8px 0;
}

/* ── Tab panels ──────────────────────────────────────── */
.tab-panel[hidden] { display: none; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.modal-wide {
  max-width: 900px;
}

/* ── Show Settings — fuel-price 3-way toggle ─────────── */
.ss-fuel-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 4px;
}
.ss-fuel-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  color: var(--color-text-dim);
  border: none;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-fuel-btn + .ss-fuel-btn { border-left: 1px solid var(--color-border); }
.ss-fuel-btn:hover:not(.active):not(:disabled) { background: var(--color-surface2); color: var(--color-text); }
.ss-fuel-btn.active { background: var(--color-accent); color: #fff; cursor: default; }
.ss-fuel-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.modal-section { margin-bottom: 18px; }
.modal-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-dim);
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--color-text);
}

#modal-body .form-error {
  margin-top: -8px;
}

/* ── Utility ─────────────────────────────────────────── */
.text-dim   { color: var(--color-text-dim); }
.text-error { color: var(--color-error); }
.text-success { color: var(--color-success); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.inline-flex { display: inline-flex; }

/* ── Impersonation banner ─────────────────────────────
   Persistent strip across the very top of the viewport when an
   admin/owner is viewing the portal as another user. Distinct
   warning palette so it never blends into normal chrome. */
.imp-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--color-warning);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.imp-banner-text strong { font-weight: 700; }
.imp-banner .btn {
  background: rgba(0,0,0,0.18);
  color: #1a1a1a;
  border: 1px solid rgba(0,0,0,0.25);
}
.imp-banner .btn:hover {
  background: rgba(0,0,0,0.28);
}
/* Slide the fixed topbar down and shift main content so the banner doesn't
   cover the topbar or eat into the page. */
body.has-imp-banner #topbar { top: 36px; }
body.has-imp-banner { padding-top: 36px; }
