/* Filter bar */
.pnl-filter-shell {
  padding: 0.75rem 0.75rem 0 0.75rem;
}

.pnl-filter-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pnl-filter-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pnl-filter-card--controls {
  flex: 0 1 auto;
  min-width: 420px;
}

.pnl-filter-card--algos {
  flex: 1 1 420px;
}

.pnl-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.pnl-filter-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.pnl-filter-right {
  flex: 1;
  min-width: 280px;
}

.pnl-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
}

.pnl-filter-group label {
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pnl-filter-select,
.pnl-filter-date {
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pnl-filter-select:focus,
.pnl-filter-date:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.16);
  transform: translateY(-1px);
}

.pnl-filter-select {
  appearance: none;
}

.pnl-filter-date {
  min-width: 180px;
  appearance: auto;
  color-scheme: dark;
}

.pnl-filter-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.85);
}

.pnl-filter-actions {
  display: flex;
  align-items: stretch;
}

.pnl-filter-clear {
  background: transparent;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pnl-filter-clear:hover {
  background: rgba(88, 166, 255, 0.08);
  border-color: #58a6ff;
}

.pnl-filter-group--algo {
  min-width: 0;
}

.pnl-algo-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pnl-algo-btn.region-btn {
  width: auto;
  min-width: 130px;
  height: 40px;
  padding: 0.75rem 1.1rem;
  background: transparent;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  opacity: 1;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.pnl-algo-btn.region-btn:hover:not(.active) {
  background: #e9ecef;
  color: #495057;
  border-color: #e9ecef;
  box-shadow: none;
}

.pnl-algo-btn.region-btn.active {
  background: #238636;
  border-color: #238636;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(35, 134, 54, 0.3);
  font-weight: 700;
}

/* Main PNL dashboard: 2-column layout */
.dashboard-container-pnl {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  align-items: flex-start;
  min-height: 100vh;
  overflow: visible;
}

/* Left column = 60% width */
.left-column-pnl {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
}

/* Right column = 40% width */
.right-column-pnl {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
}

/* Table containers */
.table-container-pnl {
  background: rgba(22, 27, 34, 0.8);
  border-radius: 8px;
  border: 1px solid #30363d;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  flex: 1;
  min-height: 500px;
  box-sizing: border-box;
}

/* Table headers */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #30363d;
}

.table-header h3 {
  color: #c9d1d9;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.table-timestamp {
  color: #8b949e;
  font-size: 12px;
}

/* Table wrappers and tables */
.table-wrapper {
  overflow-x: auto;
  max-height: 450px;
  overflow-y: auto;
  position: relative;
  border-radius: 6px;
  border: 1px solid #30363d;
}

.pnl-table {
  width: 100%;
  border-collapse: collapse;
  color: #c9d1d9;
  font-size: 13px;
}

.pnl-table thead {
  position: sticky;
  top: 0;
  z-index: 100;
}

.pnl-table th {
  background: #21262d;
  color: #f0f6fc;
  padding: 12px 8px;
  text-align: right;
  font-weight: 600;
  border-bottom: 2px solid #30363d;
  border-right: 1px solid #6e7681;
  position: sticky;
  top: 0;
  z-index: 101;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pnl-table th:first-child {
  text-align: left;
  border-left: none;
}

.pnl-table th:last-child {
  border-right: none;
}

.pnl-table tbody {
  background: transparent;
}

.pnl-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #21262d;
  border-right: 1px solid #6e7681;
  font-size: 14px;
  text-align: right;
  position: relative;
  z-index: 1;
}

.pnl-table td:first-child {
  text-align: left;
  font-weight: 600;
  border-left: none;
}

.pnl-table td:last-child {
  border-right: none;
}

.pnl-table tr:hover {
  background-color: rgba(48, 54, 61, 0.3);
}

.pnl-table tbody tr:last-child td {
  border-bottom: none;
}

/* Info boxes row */
.info-boxes-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  height: 200px;
}

.info-box {
  flex: 1;
  background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 30px 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  min-height: 160px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.info-box-title {
  color: #8b949e;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.info-box-value {
  font-size: 36px;
  font-weight: 1200;
  margin-bottom: 8px;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.info-box-context {
  color: #6e7681;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* PNL value styling */
.green-text {
  color: #2ea043 !important;
  font-weight: 600;
}

.red-text {
  color: #da3633 !important;
  font-weight: 600;
}

.power-hour-cell {
  text-align: left !important;
  font-weight: 600 !important;
  color: #c9d1d9 !important;
}

.numeric-value {
  text-align: right;
  font-weight: 500;
}

/* Table error styling */
.table-error {
  color: #f85149;
  text-align: center;
  padding: 20px;
  font-style: italic;
  background: rgba(248, 81, 73, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.graph-container-pnl {
    flex: 0 0 calc(33.333% - 0.5rem); 
    min-width: 250px;
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 400px;
    box-sizing: border-box;
}

.graph-container-pnl canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 300px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .graph-container-pnl {
        flex: 0 0 calc(33.333% - 0.5rem); 
        height: 100%;
    }
}

@media (max-width: 900px) {
    .graph-container-pnl {
        flex: 0 0 calc(50% - 0.5rem);
        height: 100%;
    }
}

@media (max-width: 600px) {
    .graph-container-pnl {
        flex: 0 0 100%;
        height: 100%;
    }
}

/* Fullscreen mode */
.graph-container-pnl.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background: #0d1117;
    border-radius: 0;
    padding: 20px;
    flex: none;
    box-sizing: border-box;
}

.graph-container-pnl.fullscreen canvas {
    width: calc(100vw - 40px) !important;
    height: calc(100vh - 40px) !important;
    min-height: calc(100vh - 40px) !important;
    max-height: none !important;
}

#pnl-timeline-canvas {
    width: 100% !important;
}

.graph-container-pnl {
    flex: none;          /* Prevent shrinking */
    height: 100%;       /* Force height */
}

.graph-container-pnl canvas {
    width: 100% !important;
}

/* ---- Win/Loss Stats Panel ---- */
.pnl-charts-row {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px 28px;
    box-sizing: border-box;
    position: relative;
}

#win-loss-stats-panel {
    width: 100%;
}

.wl-panel-title {
    color: #c9d1d9;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 24px;
}

.wl-stats-row {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.wl-stats-row--bottom {
    margin-top: 32px;
}

.wl-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wl-stat-label {
    color: #8b949e;
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    white-space: nowrap;
}

.wl-stat-value {
    color: #e6edf3;
    font-size: 22px;
    font-weight: 600;
    white-space: nowrap;
}

.pnl-loading-state {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .pnl-filter-card--controls,
  .pnl-filter-card--algos,
  .pnl-filter-left {
    width: 100%;
    min-width: 0;
  }

  .pnl-filter-group {
    min-width: 100%;
  }

  .pnl-filter-actions {
    width: 100%;
  }

  .pnl-filter-clear {
    width: 100%;
  }
}

/* Algos Statistics */
.algo-statistics-page {
  padding: 0.75rem;
}

.algo-statistics-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.algo-statistics-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.algo-statistics-filter-block {
  flex: 0 1 auto;
}

.algo-statistics-filter-block--algos {
  flex: 1 1 420px;
}

.algo-statistics-filter-block--toggle {
  margin-left: auto;
  min-width: 220px;
}

.algo-statistics-toggle-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.algo-statistics-filter-note {
  margin-top: 0.65rem;
  color: #8b949e;
  font-size: 12px;
  line-height: 1.45;
  max-width: 360px;
}

.algo-statistics-filter-note code {
  color: #c9d1d9;
}

.algo-statistics-toggle-label {
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.algo-statistics-toggle {
  position: relative;
  width: 58px;
  height: 32px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.algo-statistics-toggle:hover {
  border-color: #58a6ff;
}

.algo-statistics-toggle.is-active {
  background: rgba(35, 134, 54, 0.22);
  border-color: #238636;
}

.algo-statistics-toggle-handle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #f0f6fc;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.algo-statistics-toggle.is-active .algo-statistics-toggle-handle {
  transform: translateX(26px);
}

.algo-statistics-view-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.08);
  color: #9ecbff;
  font-size: 12px;
  font-weight: 700;
}

.algo-statistics-view-badge--active {
  background: rgba(35, 134, 54, 0.16);
  color: #7ee787;
}

.algo-statistics-summary-strip {
  background: rgba(22, 27, 34, 0.82);
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.algo-statistics-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.algo-statistics-summary-title {
  color: #f0f6fc;
  font-size: 18px;
  font-weight: 700;
}

.algo-statistics-summary-meta,
.algo-statistics-summary-generated {
  color: #8b949e;
  font-size: 13px;
}

.algo-statistics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.algo-statistics-summary-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.algo-statistics-summary-label {
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.algo-statistics-summary-value {
  color: #f0f6fc;
  font-size: 28px;
  font-weight: 700;
}

.algo-statistics-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.algo-statistics-cards--summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(540px, 1fr));
  align-items: start;
}

.algo-statistics-card {
  background: rgba(22, 27, 34, 0.82);
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.algo-statistics-card--summary {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0.7rem;
  padding: 0.8rem;
}

.algo-statistics-card--summary .algo-statistics-card-head,
.algo-statistics-card--summary .algo-statistics-card-body,
.algo-statistics-card--summary .algo-statistics-detail {
  grid-column: 1 / -1;
}

.algo-statistics-card--summary .algo-statistics-compare-panel,
.algo-statistics-card--summary .algo-statistics-card-preview {
  margin-top: 0;
}

.algo-statistics-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.algo-statistics-card--summary .algo-statistics-card-head {
  margin-bottom: 0.7rem;
}

.algo-statistics-card-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.algo-statistics-card--summary .algo-statistics-card-actions {
  gap: 0.55rem;
}

.algo-statistics-analysis-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 220px;
}

.algo-statistics-card--summary .algo-statistics-analysis-control {
  min-width: 180px;
  gap: 0.25rem;
}

.algo-statistics-analysis-control label {
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.algo-statistics-card--summary .algo-statistics-analysis-control label {
  font-size: 11px;
}

.algo-statistics-analysis-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.algo-statistics-analysis-date {
  min-width: 150px;
}

.algo-statistics-card--summary .algo-statistics-analysis-date {
  min-width: 128px;
}

.algo-statistics-analysis-clear {
  background: transparent;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.algo-statistics-analysis-clear:hover {
  background: rgba(88, 166, 255, 0.08);
  border-color: #58a6ff;
}

.algo-statistics-card-title {
  color: #f0f6fc;
  font-size: 20px;
  font-weight: 700;
}

.algo-statistics-card--summary .algo-statistics-card-title {
  font-size: 17px;
}

.algo-statistics-card-subtitle {
  color: #8b949e;
  font-size: 13px;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.algo-statistics-card--summary .algo-statistics-card-subtitle {
  font-size: 11px;
}

.algo-statistics-expand-btn {
  background: transparent;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.algo-statistics-expand-btn:hover {
  background: rgba(88, 166, 255, 0.08);
  border-color: #58a6ff;
}

.algo-statistics-card--summary .algo-statistics-expand-btn,
.algo-statistics-card--summary .algo-statistics-analysis-clear {
  padding: 0.58rem 0.75rem;
  font-size: 12px;
}

.algo-statistics-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.algo-statistics-card--summary .algo-statistics-card-body {
  gap: 0.55rem;
}

.algo-statistics-card-preview {
  margin-top: 0.9rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.algo-statistics-compare-panel {
  margin-top: 0.9rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.algo-statistics-seasonal-panel {
  margin-top: 0.9rem;
}

.algo-statistics-recent-panel {
  margin-top: 0.9rem;
  padding-top: 0.1rem;
}

.algo-statistics-recent-status-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.algo-statistics-recent-reasons {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: #8b949e;
  font-size: 12px;
  line-height: 1.45;
}

.algo-statistics-recent-reasons li + li {
  margin-top: 0.3rem;
}

.algo-statistics-compare-table th,
.algo-statistics-compare-table td {
  white-space: nowrap;
}

.algo-statistics-card--summary .algo-statistics-compare-panel .table-header h3 {
  font-size: 15px;
}

.algo-statistics-card--summary .algo-statistics-compare-table th,
.algo-statistics-card--summary .algo-statistics-compare-table td {
  padding: 0.45rem 0.55rem;
  font-size: 12px;
}

.algo-statistics-card--summary .algo-statistics-compare-status {
  min-width: 50px;
  padding: 0.2rem 0.45rem;
  font-size: 10px;
}

.algo-statistics-card--summary .algo-statistics-recent-panel {
  display: none;
}

.algo-statistics-compare-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.algo-statistics-compare-status--pass {
  background: rgba(35, 134, 54, 0.18);
  color: #7ee787;
}

.algo-statistics-compare-status--fail {
  background: rgba(248, 81, 73, 0.18);
  color: #ff7b72;
}

.algo-statistics-compare-status--na {
  background: rgba(110, 118, 129, 0.18);
  color: #c9d1d9;
}

.algo-statistics-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.algo-statistics-preview-title {
  color: #c9d1d9;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.algo-statistics-preview-meta {
  color: #8b949e;
  font-size: 12px;
}

.algo-statistics-preview-canvas-wrap {
  position: relative;
  height: 140px;
}

.algo-statistics-preview-canvas-wrap--large {
  height: 260px;
}

.algo-statistics-card--summary .algo-statistics-preview-head {
  margin-bottom: 0.45rem;
}

.algo-statistics-card--summary .algo-statistics-preview-title {
  font-size: 12px;
}

.algo-statistics-card--summary .algo-statistics-preview-meta {
  font-size: 11px;
}

.algo-statistics-card--summary .algo-statistics-preview-canvas-wrap {
  height: 88px;
}

.algo-statistics-card--summary .algo-statistics-preview-canvas-wrap--large {
  height: 138px;
}

.algo-statistics-card--summary .algo-statistics-preview-main {
  margin-bottom: 0.55rem;
}

.algo-statistics-card--summary .algo-statistics-preview-subgrid {
  gap: 0.55rem;
}

.algo-statistics-card--summary .algo-statistics-preview-block {
  padding: 0.6rem;
}

.algo-statistics-card--summary .algo-statistics-preview-block-title {
  font-size: 11px;
  margin-bottom: 0.35rem;
}

.algo-statistics-preview-main {
  margin-bottom: 0.85rem;
}

.algo-statistics-preview-subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.algo-statistics-preview-block {
  background: rgba(22, 27, 34, 0.55);
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 0.8rem;
}

.algo-statistics-preview-block-title {
  color: #c9d1d9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.algo-statistics-direction-panel {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.algo-statistics-direction-label {
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.algo-statistics-direction-action {
  color: #f0f6fc;
  font-size: 22px;
  font-weight: 700;
}

.algo-statistics-card--summary .algo-statistics-direction-panel {
  padding: 0.75rem 0.85rem;
  gap: 0.35rem;
}

.algo-statistics-card--summary .algo-statistics-direction-action {
  font-size: 18px;
}

.algo-statistics-card--summary .algo-statistics-panel-meta {
  font-size: 12px;
}

.algo-statistics-card--summary .algo-statistics-panel-submeta {
  font-size: 11px;
}

.algo-statistics-panel-meta {
  color: #8b949e;
  font-size: 13px;
  line-height: 1.45;
}

.algo-statistics-panel-submeta {
  color: #6e7681;
  font-size: 12px;
  line-height: 1.4;
}

.algo-statistics-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.algo-statistics-status--green {
  background: rgba(35, 134, 54, 0.18);
  color: #7ee787;
}

.algo-statistics-status--yellow {
  background: rgba(210, 153, 34, 0.18);
  color: #e3b341;
}

.algo-statistics-status--red {
  background: rgba(248, 81, 73, 0.18);
  color: #ff7b72;
}

.algo-statistics-status--grey {
  background: rgba(110, 118, 129, 0.2);
  color: #c9d1d9;
}

.algo-statistics-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #30363d;
}

.algo-statistics-detail[hidden] {
  display: none !important;
}

.algo-statistics-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: start;
}

.algo-statistics-detail-table,
.algo-statistics-drilldown {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 1rem;
}

.algo-statistics-table th,
.algo-statistics-table td {
  white-space: nowrap;
}

.algo-statistics-table th:first-child,
.algo-statistics-table td:first-child {
  min-width: 120px;
}

.algo-statistics-detail-note {
  color: #8b949e;
  font-size: 12px;
  margin-bottom: 0.8rem;
  line-height: 1.45;
}

.algo-statistics-detail-row {
  cursor: pointer;
}

.algo-statistics-detail-row.is-selected {
  background: rgba(88, 166, 255, 0.18);
}

.algo-statistics-drilldown {
  display: flex;
  flex-direction: column;
}

.algo-statistics-drilldown-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.algo-statistics-test-breakdown {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.algo-statistics-test-item {
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

.algo-statistics-test-item--pass {
  background: rgba(35, 134, 54, 0.10);
  border-color: rgba(35, 134, 54, 0.35);
}

.algo-statistics-test-item--fail {
  background: rgba(248, 81, 73, 0.10);
  border-color: rgba(248, 81, 73, 0.35);
}

.algo-statistics-test-item--na {
  background: rgba(110, 118, 129, 0.10);
}

.algo-statistics-test-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.3rem;
}

.algo-statistics-test-label {
  color: #e6edf3;
  font-size: 13px;
  font-weight: 600;
}

.algo-statistics-test-state {
  color: #c9d1d9;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.algo-statistics-test-values,
.algo-statistics-test-empty {
  color: #8b949e;
  font-size: 12px;
  line-height: 1.4;
}

.algo-statistics-drilldown-title {
  color: #f0f6fc;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.algo-statistics-drilldown-meta {
  color: #8b949e;
  font-size: 13px;
}
.algo-statistics-empty-state,
.algo-statistics-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 1px dashed #30363d;
  border-radius: 12px;
  color: #8b949e;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .algo-statistics-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .algo-statistics-filter-block--toggle {
    margin-left: 0;
    width: 100%;
  }

  .algo-statistics-toggle-wrap {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .algo-statistics-page {
    padding: 0.5rem;
  }

  .algo-statistics-card-head,
  .algo-statistics-summary-head {
    flex-direction: column;
  }

  .algo-statistics-card-actions {
    width: 100%;
    flex-direction: column;
  }

  .algo-statistics-card-body {
    grid-template-columns: 1fr;
  }

  .algo-statistics-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .algo-statistics-preview-subgrid {
    grid-template-columns: 1fr;
  }

  .algo-statistics-cards--summary {
    grid-template-columns: 1fr;
  }

  .algo-statistics-card--summary {
    grid-template-columns: 1fr;
  }
}
