.portal-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-details-empty,
.portal-details-state {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.portal-details-empty-icon,
.portal-details-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg2);
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.portal-details-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.portal-details-state-loading {
  flex-direction: row;
  min-height: 120px;
  color: var(--text2);
}

.portal-details-state-error {
  color: var(--red);
}

.portal-details-inverter-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.portal-details-inverter-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 12, 12, 0.16) 0%, rgba(255, 12, 12, 0.06) 100%);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.portal-details-inverter-copy {
  min-width: 0;
  flex: 1;
}

.portal-details-inverter-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-details-inverter-sn {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text3);
  font-family: 'IBM Plex Mono', monospace;
}

.portal-details-inverter-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
}

.portal-details-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--brand-primary-bg);
  border: 1px solid var(--brand-primary-border);
  border-radius: var(--radius-lg);
}

.portal-details-meta-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}

.portal-details-meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
}

.portal-details-section-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portal-details-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2) 0%, #fff 100%);
}

.portal-details-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.portal-details-section-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-primary-bg);
  border: 1px solid var(--brand-primary-border);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-details-controls-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.portal-details-date-picker {
  width: 100%;
  max-width: 420px;
}

.portal-details-table-wide thead th:last-child,
.portal-details-table-wide .portal-details-value {
  text-align: right;
}

.portal-details-timestamp {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
}

.portal-details-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.portal-details-page-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  font-family: 'IBM Plex Mono', monospace;
}

.portal-details-table-wrap {
  overflow-x: auto;
}

.portal-details-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.portal-details-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-details-table thead th {
  text-align: left;
  padding: 11px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.portal-details-table thead th:last-child {
  text-align: right;
}

.portal-details-table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.portal-details-table tbody tr:last-child td {
  border-bottom: none;
}

.portal-details-table tbody tr:hover {
  background: rgba(247, 248, 250, 0.85);
}

.portal-details-param {
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.portal-details-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .portal-details-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-details-table thead th:last-child,
  .portal-details-value {
    text-align: left;
  }
}

html[dir="rtl"] .portal-details-table thead th,
html[dir="rtl"] .portal-details-param {
  text-align: right;
}

html[dir="rtl"] .portal-details-table thead th:last-child,
html[dir="rtl"] .portal-details-value {
  text-align: left;
}
