/* ── Design tokens ──────────────────────────────────────────────────── */
:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1d4ed8;
  --sidebar-text: #94a3b8;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
}

body {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  margin: 0;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  padding: 15px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.sidebar-logo img {
  height: 45px;
  filter: brightness(0) invert(1);
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 10px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.14s, color 0.14s;
  position: relative;
  line-height: 1.2;
}

.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.sidebar-footer {
  padding: 10px 8px 14px;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
}

.sidebar-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: #475569;
  margin-top: 1px;
}

/* ── Main content ───────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.page-header-left h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
}

.page-header-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}


.detail-header-ws {
  min-width: max-content;
}

.page-body {
  padding: 15px;
  flex: 1;
}

/* ── Inverter cards ─────────────────────────────────────────────────── */
.inv-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow 0.2s, border-color 0.2s;
}

/* Status-based left border */
.inv-card.status-running { border-left-color: #22c55e; }
.inv-card.status-stopped { border-left-color: #ef4444; }
.inv-card.status-offline { border-left-color: #94a3b8; }

/* Alert level overrides */
.inv-card.level-warning {
  border-left-color: #f59e0b;
  box-shadow: 0 0 0 2px #fef3c7;
}
.inv-card.level-critical {
  border-left-color: #ef4444;
  box-shadow: 0 0 0 2px #fee2e2;
  animation: card-pulse 1.5s infinite;
}

@keyframes card-pulse {
  0%,100% { box-shadow: 0 0 0 2px #fee2e2; }
  50%      { box-shadow: 0 0 0 5px #fecaca; }
}

.card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.card-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Run status badge ───────────────────────────────────────────────── */
.run-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.6;
}

.run-badge.running { background: #dcfce7; color: #15803d; }
.run-badge.stopped { background: #fee2e2; color: #dc2626; }
.run-badge.offline { background: #fef3c7; color: #b45309; }

/* ── Alert level badge (on card) ────────────────────────────────────── */
.alert-badge-card {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.alert-badge-card.warning  { background: #fef3c7; color: #b45309; }
.alert-badge-card.critical { background: #fee2e2; color: #b91c1c; }

/* ── Params grid inside card ────────────────────────────────────────── */
.params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
  margin: 10px 0;
}

.param-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  align-self: center;
}

.param-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.param-unit {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 400;
}

.err-ok   { color: #16a34a; font-weight: 600; }
.err-fault { color: #dc2626; font-weight: 600; }

/* comp-tag mặc định khi offline (không có comp-ok / comp-fault) */
.comp-tag:not(.comp-ok):not(.comp-fault) { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }

.card-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── WS status dot ──────────────────────────────────────────────────── */
.ws-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.ws-dot.connected    { background: #22c55e; }
.ws-dot.disconnected { background: #ef4444; animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* ── Stat cards (alerts page) ───────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ── Data table ─────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead tr {
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: #f8fafc;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr.row-critical { background: #fff5f5; }
.data-table tbody tr.row-warning  { background: #fffbeb; }
.data-table tbody tr.row-acked td { color: #94a3b8; }

/* ── Panel (filter / section) ───────────────────────────────────────── */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
  line-height: 1.2;
  font-family: inherit;
}
.btn:hover { opacity: 0.82; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-danger  { background: #ef4444; color: #fff; }
.btn-success { background: #22c55e; color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); background: var(--card-bg); }
.btn-sm      { padding: 5px 10px; font-size: 12px; border-radius: 6px; }


/* Global alert dropdown */
.alert-menu {
  position: relative;
  display: inline-flex;
}

.alert-menu-button {
  position: relative;
}

.alert-menu-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.alert-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .18);
  z-index: 260;
}

.alert-menu.open .alert-dropdown {
  display: block;
}

.alert-dropdown-head,
.alert-dropdown-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  background: #f8fafc;
}

.alert-dropdown-head {
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.alert-dropdown-head span:last-child {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.alert-dropdown-list {
  max-height: 330px;
  overflow: auto;
}

.alert-dropdown-empty {
  padding: 22px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}

.alert-dropdown-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
}

.alert-dropdown-item:hover {
  background: #f8fafc;
}

.alert-dropdown-item:last-child {
  border-bottom: 0;
}

.alert-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #f59e0b;
}

.alert-dot.critical,
.alert-dot.fault {
  background: #ef4444;
}

.alert-dot.early-warning {
  background: #8b5cf6;
}

.alert-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.alert-item-title {
  min-width: 0;
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-item-time {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.alert-item-message {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-dropdown-foot {
  border-top: 1px solid #e2e8f0;
}

.alert-dropdown-foot a {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.alert-dropdown-foot a:hover {
  text-decoration: underline;
}
/* ── Level badges (alert table) ─────────────────────────────────────── */
.badge-critical { display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;background:#fee2e2;color:#b91c1c; }
.badge-warning  { display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;background:#fef3c7;color:#b45309; }
.badge-ok       { display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;background:#dcfce7;color:#15803d; }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  color: #fff;
  font-size: 13px;
  min-width: 280px;
  max-width: 340px;
  animation: toast-in 0.25s ease;
}
.toast-critical { background: #dc2626; }
.toast-warning  { background: #d97706; }
@keyframes toast-in {
  from { transform: translateX(60px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── History modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body { flex: 1; padding: 20px; overflow: auto; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}
.modal-close:hover { background: #e2e8f0; }

/* ── Factory section header ─────────────────────────────────────────── */
.factory-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.factory-header h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.factory-header .factory-loc {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── Charts ─────────────────────────────────────────────────────────── */
.chart-container { width: 100%; height: 280px; }
.chart { width: 100%; height: 500px; }

/* ── Parameter tiles (detail page) ──────────────────────────────────── */
.param-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: border-color .2s;
}
.param-tile.t-warning  { border-left-color: #f59e0b; }
.param-tile.t-critical { border-left-color: #ef4444; animation: card-pulse 1.5s infinite; }

.tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.tile-value {
  font-size: 26px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.param-tile.t-warning  .tile-value { color: #d97706; }
.param-tile.t-critical .tile-value { color: #dc2626; }

.tile-unit {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.tile-bar-wrap {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.tile-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 2px;
  transition: width .4s ease;
}
.param-tile.t-warning  .tile-bar-fill { background: #f59e0b; }
.param-tile.t-critical .tile-bar-fill { background: #ef4444; }

.tile-range {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Range buttons (chart) ───────────────────────────────────────────── */
.range-btn {
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all .14s;
}
.range-btn:hover  { background: #f1f5f9; }
.range-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ── Detail link button (inverter card) ──────────────────────────────── */
.btn-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
  transition: background .15s;
  font-family: inherit;
}
.btn-detail:hover { background: #eff6ff; }
.btn-detail svg   { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Trend chart groups (detail page) ───────────────────────────────── */
.chart-group {
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  margin-top: 6px;
}
.chart-group:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }

.chart-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #94a3b8;
  margin-bottom: 4px;
  padding-left: 2px;
}

.trend-chart          { height: 190px; }
.trend-chart--bottom  { height: 250px; }

/* ── Card ops strip (realtime card) ─────────────────────────────── */
.card-ops {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 0 0;
  margin-top: 7px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #64748b;
}
.card-ops-stats { display: flex; gap: 12px; }
.card-ops-stat  { display: flex; align-items: baseline; gap: 3px; }
.card-ops-stat b { font-weight: 700; color: #334155; }
.comp-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.comp-tag {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid;
}
.comp-ok    { background: #f0fdf4; color: #16a34a; border-color: #dcfce7; }
.comp-fault { background: #fef2f2; color: #dc2626; border-color: #fee2e2; }

/* ── Ops bar (inverter detail) ──────────────────────────────────── */
.ops-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ops-counters {
  display: flex;
  flex: 1;
}
.ops-counter {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 20px;
  border-right: 1px solid #f1f5f9;
}
.ops-counter-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin-bottom: 4px; }
.ops-counter-val   { font-size: 26px; font-weight: 500; color: #0f172a; line-height: 1; }
.ops-counter-unit  { font-size: 11px; color: #64748b; margin-top: 3px; }
.ops-comps {
  display: flex;
  align-items: stretch;
  border-left: 2px solid #f1f5f9;
}
.ops-comp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 18px;
  border-right: 1px solid #f1f5f9;
}
.ops-comp:last-child { border-right: none; }
.ops-comp-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ops-comp-dot.ok    { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.35); }
.ops-comp-dot.warning { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.35); }
.ops-comp-dot.fault { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.4); animation: card-pulse 1.4s ease-in-out infinite; }
.ops-comp-name { font-size: 10px; color: #64748b; text-align: center; white-space: nowrap; }
.ops-comp-val  { font-size: 12px; font-weight: 700; color: #334155; font-family: monospace; }

/* ── 8-tile parameter grid ──────────────────────────────────────────── */
.tiles-8 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}
@media (max-width: 1200px) { .tiles-8 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px)  { .tiles-8 { grid-template-columns: repeat(2, 1fr); } }

/* ── Performance analysis (SCADA style) ─────────────────────────────── */
.perf-scada-panel {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

.perf-scada-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.perf-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.perf-period-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.perf-period-switch .range-btn {
  min-width: 62px;
}

.perf-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.perf-stat-card {
  --perf-accent: #64748b;
  min-width: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--perf-accent);
  border-radius: 8px;
}

.perf-stat-card--availability { --perf-accent: #16a34a; }
.perf-stat-card--energy { --perf-accent: #0891b2; }
.perf-stat-card--current { --perf-accent: #0f766e; }
.perf-stat-card--power { --perf-accent: #d97706; }
.perf-stat-card--frequency { --perf-accent: #4f46e5; }
.perf-stat-card--temperature { --perf-accent: #dc2626; }

.perf-stat-label {
  min-height: 24px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  line-height: 1.25;
}

.perf-stat-main {
  margin-top: 4px;
  color: #0f172a;
  font-family: monospace;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.perf-stat-main span {
  color: var(--perf-accent);
}

.perf-stat-unit {
  margin-top: 5px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.2;
  white-space: nowrap;
}

.perf-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(320px, .95fr);
  gap: 14px;
  align-items: start;
  padding: 14px 18px 18px;
  background: #fff;
}

.perf-chart-module {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.perf-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.perf-module-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  line-height: 1.25;
}

.perf-module-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.25;
}

.perf-module-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}

.perf-chart-body {
  height: 280px;
  padding: 8px 8px 6px;
}

.perf-chart-body > div {
  width: 100%;
  height: 100%;
}

.perf-table-wrap {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.perf-baseline-table {
  width: 100%;
}

.perf-baseline-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.perf-baseline-table tbody td {
  height: 38px;
}

.perf-baseline-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.perf-baseline-table tbody tr:hover {
  background: #eff6ff;
}

/* 3-col modifier for detail-bottom-grid (overrides the default 2-col) */
.detail-bottom-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── AI Suggestion Modal ────────────────────────────────────────────────── */
.ai-h3  { font-weight: 700; font-size: 17px; margin: 22px 0 8px; color: #0f172a; border-bottom: 2px solid #e2e8f0; padding-bottom: 6px; }
.ai-h4  { font-weight: 700; font-size: 16px; margin: 18px 0 6px; color: #0f172a; }
.ai-h5  { font-weight: 700; font-size: 15px; margin: 14px 0 5px; color: #1e40af; padding-left: 10px; border-left: 3px solid #3b82f6; }
.ai-h6  { font-weight: 600; font-size: 14px; margin: 10px 0 3px; color: #222222; }
.ai-subhead {
  font-weight: 700; font-size: 13.5px; color: #1e293b;
  margin: 12px 0 3px; padding-left: 10px;
  border-left: 2px solid #94a3b8;
}
.ai-subdetail { margin: 1px 0 2px 22px; font-size: 13px; line-height: 1.65; color: #4b5563; }
.ai-ul  { margin: 5px 0px; padding-left: 20px; list-style: disc;}
.ai-ul > li { margin: 5px 0; font-size: 14px; line-height: 1.7; color: #222222; }
.ai-ul-nested { margin: 4px 0 0; padding-left: 16px; list-style-type: circle; }
.ai-ul-nested > li { margin: 3px 0; font-size: 14px; color: #222222; line-height: 1.6; }
.ai-ol  { margin: 4px 0 12px; padding-left: 20px; }
.ai-ol > li { margin: 5px 0; font-size: 13.5px; line-height: 1.7; color: #222222; }
.ai-hr  { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0; }
.ai-p   { margin: 0 0 10px; line-height: 1.8; font-size: 14px; color: #222222; }
.ai-task {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 8px 0 2px; font-size: 14px; font-weight: bold;
  line-height: 1.6; color: #222222;
}
.ai-check {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border: 1.5px solid #22c55e; border-radius: 3px;
  margin-top: 2px; font-size: 11px; font-weight: 700; color: #22c55e; background: #f0fdf4;
}
.ai-task-done .ai-check { background: #22c55e; border-color: #22c55e; }
.ai-arrow { color: #3b82f6; font-weight: 600; }
.ai-result { margin: 4px 0 8px; font-size: 14px; line-height: 1.7; color: #222222; }
.ai-detail {
  margin: 1px 0 1px 24px; font-size: 12.5px; line-height: 1.65; color: #4b5563;
}
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.ai-loading::before {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: ai-spin 0.75s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-error {
  display: flex; align-items: center; gap: 10px;
  background: #fff7ed; border: 1px solid #fed7aa; border-left: 4px solid #f97316;
  border-radius: 8px; padding: 12px 16px; margin: 8px 0;
  color: #9a3412; font-size: 13px; line-height: 1.6;
}
.ai-error > span:first-child { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.ai-sensor-section { margin-bottom: 4px; }
.ai-sensor-head {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-secondary); margin-bottom: 8px;
}
.ai-sensor-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px;
}
.ai-sensor-tile {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px;
  transition: border-color 0.15s;
}
.ai-sensor-tile:hover { border-color: #94a3b8; }
.ai-sensor-tile-warn { background: #fff7ed; border-color: #fed7aa; }
.ai-sensor-tile-label {
  font-size: 11px; color: #64748b; font-weight: 500; white-space: nowrap;
}
.ai-sensor-tile-val {
  font-size: 17px; font-weight: 700; color: #0f172a;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.ai-sensor-tile-warn .ai-sensor-tile-val { color: #c2410c; }
.ai-sensor-tile-unit { font-size: 11px; font-weight: 400; color: #94a3b8; }

/* ── AI modal scrollbar ─────────────────────────────────────────────────── */
.ai-modal-scroll {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.ai-modal-scroll::-webkit-scrollbar { width: 5px; }
.ai-modal-scroll::-webkit-scrollbar-track { background: transparent; }
.ai-modal-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
.ai-modal-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.btn-ai {
  font-size: 12px;
  background: none;
  border: 1px solid #93c5fd;
  color: #2563eb;
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-ai:hover { background: #eff6ff; }

@media (max-width: 1180px) {
  .perf-stat-grid        { grid-template-columns: repeat(3, 1fr); }
  .perf-chart-grid       { grid-template-columns: 1fr; align-items: start; }
  .perf-chart-body       { height: 240px; }
}
@media (max-width: 640px) {
  .perf-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .perf-scada-head {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 14px;
  }
  .perf-period-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .perf-period-switch .range-btn {
    min-width: 0;
  }
  .perf-chart-grid {
    padding: 10px 14px 14px;
  }
  .perf-chart-body {
    height: 220px;
  }
}
@media (max-width: 420px) {
  .perf-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 12px;
  }
  .perf-stat-card { padding: 9px 10px; }
  .perf-stat-label { min-height: 0; }
  .perf-stat-main { font-size: 18px; }
  .perf-stat-unit {
    font-size: 10px;
    white-space: normal;
  }
  .perf-chart-grid { padding: 8px 12px 12px; }
}

/* ── Fault badge (inverter detail header) ───────────────────────────── */
.fault-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  transition: background .2s, color .2s, border-color .2s;
}
.fault-badge.fault-active {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  animation: card-pulse 1.4s ease-in-out infinite;
}

/* ── Form controls ──────────────────────────────────────────────────── */
.form-select, .form-input {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.form-select:focus, .form-input:focus { border-color: #2563eb; box-shadow: 0 0 0 2px #dbeafe; }
/* ── Responsive dashboard layout ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-width: 0; }
img, svg { max-width: 100%; }

.page-header-left { min-width: 0; flex: 1; }
.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.inverter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.inv-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.inv-card-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}
.filter-panel > div { min-width: 0; }
.filter-panel .form-select,
.filter-panel .form-input { width: 100%; }
.filter-panel .search-input { min-width: 0; }
.filter-panel .btn { justify-content: center; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.chart-toolbar,
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.chart-toolbar { margin-bottom: 16px; }
.pagination-bar {
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
}
.pagination-actions,
.range-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.range-actions { gap: 4px; }

.detail-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.detail-bottom-grid.detail-bottom-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}
.detail-panel-head {
  background: #f8fafc;
}

.panel-title-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-title-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel-title-icon svg { width: 15px; height: 15px; }
.panel-title-icon--alert { background: #fff7ed; color: #d97706; }
.panel-title-icon--maintenance { background: #eff6ff; color: #2563eb; }

.panel-title-text {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.panel-head-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.panel-head-link:hover { background: #dbeafe; }
.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.panel,
.inv-card,
.param-tile,
.stat-card,
.modal-box { min-width: 0; }

.data-table { min-width: 680px; }
.data-table.detail-compact-table {
  min-width: 0;
  table-layout: auto;
}

.data-table.detail-compact-table th,
.data-table.detail-compact-table td {
  padding-left: 12px;
  padding-right: 12px;
}

.panel > div[style*="overflow-x:auto"] { -webkit-overflow-scrolling: touch; }

/* ── Scrollable table wrapper ────────────────────────────────────────────── */
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.table-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.table-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

.mobile-topbar,
.sidebar-backdrop,
.sidebar-close { display: none; }

@media (max-width: 1180px) {
  .inverter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .detail-bottom-grid { grid-template-columns: 1fr; }
  .detail-bottom-grid.detail-bottom-grid--3 { grid-template-columns: 1fr; }

  .ops-bar { flex-direction: column; }
  .ops-counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-comps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-left: 0;
    border-top: 2px solid #f1f5f9;
  }
  .ops-counter,
  .ops-comp { min-width: 0; }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 0px;
    --mobile-topbar-h: 56px;
  }

  body.sidebar-open { overflow: hidden; }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 180;
    height: var(--mobile-topbar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 1px 8px rgba(15,23,42,.18);
  }

  .sidebar-toggle,
  .sidebar-close {
    width: 38px;
    height: 38px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #111827;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }
  .sidebar-toggle {
    position: absolute;
    left: 14px;
  }
  .sidebar-toggle svg,
  .sidebar-close svg { width: 20px; height: 20px; }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
  }
  .mobile-brand img {
    height: 34px;
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: block;
    background: rgba(15,23,42,.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(82vw, 290px);
    height: 100dvh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    z-index: 240;
    transform: translateX(-100%);
    transition: transform .24s ease;
    box-shadow: none;
    pointer-events: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 14px 0 34px rgba(15,23,42,.28);
    pointer-events: auto;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #1e293b;
  }
  .sidebar-logo a { justify-content: center !important; min-width: 0; }
  .sidebar-logo img { height: 38px; width: auto; }
  .sidebar-close {
    display: inline-flex;
    position: absolute;
    right: 14px;
  }

  .sidebar-nav {
    display: block;
    flex: 1;
    padding: 10px 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .sidebar-label { display: block; }
  .nav-item {
    margin-bottom: 2px;
    white-space: normal;
    flex: none;
  }
  .nav-badge { right: 10px; top: 50%; transform: translateY(-50%); }

  .sidebar-footer {
    display: block;
    padding: 10px 8px 14px;
    border-top: 1px solid #1e293b;
    flex: 0 0 auto;
  }
  .sidebar-user { display: flex; }
  .sidebar-footer form { margin: 0; }

  .main-content { margin-left: 0; }
  .page-header {
    position: sticky;
    top: var(--mobile-topbar-h);
    padding: 14px 18px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .page-body { padding: 18px; }
  .page-header-actions { justify-content: flex-start; }

  .tiles-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart-container { height: 250px; }
  .trend-chart { height: 180px; }
  .trend-chart--bottom { height: 220px; }
}
@media (max-width: 640px) {
  .inverter-grid { grid-template-columns: 1fr; }

  .page-header {
    top: var(--mobile-topbar-h);
    align-items: center;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }
  .page-header-left,
  .page-header-actions {
    width: 100%;
  }
  .page-header-actions {
    align-items: center;
    gap: 8px 10px;
  }

  .detail-header-ws {
    min-width: 0;
  }
  .detail-header-ws #wsStatus {
    white-space: nowrap;
  }
  .page-body { padding: 14px; }
  .panel { padding: 12px 14px; }
  .panel.perf-scada-panel { padding: 0px; }
  .panel-section-head { padding: 12px 14px; }

  .factory-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
  .factory-header .factory-loc { flex-basis: 100%; padding-left: 22px; }

  .inv-card { padding: 12px 13px; }
  .inv-card-head { flex-direction: column; }
  .inv-card-status { align-items: flex-start; }
  .params-grid { gap: 6px 10px; }
  .card-ops {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .card-ops-stats { flex-wrap: wrap; gap: 8px 12px; }
  .card-footer { flex-wrap: wrap; gap: 6px; }

  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }

  .filter-panel { grid-template-columns: 1fr; }
  .filter-panel .btn { width: 100%; }

  .tiles-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .param-tile { padding: 12px; }
  .tile-value { font-size: 22px; }

  .ops-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-counter {
    padding: 12px 14px;
    border-right: 1px solid #f1f5f9 !important;
    border-bottom: 1px solid #f1f5f9;
  }
  .ops-counter:nth-child(2n) { border-right: 0 !important; }
  .ops-counter:nth-last-child(-n+2) { border-bottom: 0; }
  .ops-counter-val { font-size: 22px; }
  .ops-comps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ops-comp { padding: 12px 10px; }

  .chart-toolbar,
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-actions,
  .range-actions { width: 100%; }
  .range-actions .range-btn { flex: 1 1 calc(50% - 4px); }

  .chart-container { height: 220px; }
  .trend-chart { height: 170px; }
  .trend-chart--bottom { height: 200px; }

  .modal-overlay { padding: 10px; align-items: flex-start; }
  .modal-box { max-height: calc(100vh - 20px); border-radius: 10px; }
  .modal-header {
    padding: 12px 14px;
    align-items: flex-start;
    gap: 10px;
  }
  .modal-body { padding: 14px; }
  .modal-actions { justify-content: flex-end; }
.modal-info-grid { grid-template-columns: 1fr; }
  #historyChart { height: 300px !important; }

  .toast {
    min-width: 0;
    width: calc(100vw - 28px);
    max-width: none;
  }
}

@media (max-width: 420px) {
  .sidebar-logo img { height: 30px; }
  .nav-item { padding: 8px 10px; font-size: 12px; }
  .nav-item svg { width: 15px; height: 15px; }

  .page-header-left h1 { font-size: 16px; }
  .page-header-sub { font-size: 11.5px; }
  .btn { width: 100%; justify-content: center; }
  .page-header-actions .btn { width: auto; }
  .page-header-actions {
    justify-content: space-between;
  }
  .page-header-actions .run-badge {
    max-width: 100%;
  }

  .data-table { min-width: 620px; }
}
