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

/* Left column = 66% width, wraps its children */
.left-column-nucs-dashboard {
  flex: 0 0 66.66%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
  min-height: 100vh;
  overflow: visible;
}

/* Right column = 33% width, structured layout */
.right-column-nucs-dashboard {
  flex: 0 0 33.33%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100vh;
}

/* Each graph card base styles */
.left-side-graph-container-nucs-dashboard,
.right-side-graph-container-nucs-dashboard {
  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;
  min-height: 300px;
}

/* Left side graphs - first 6 graphs in 2x3 grid */
.left-side-graph-container-nucs-dashboard:nth-child(-n+6) {
  flex: 0 0 calc(50% - 0.25rem);
  min-width: 250px;
}

/* Last 3 graphs on left side - arrange in single row */
.left-side-graph-container-nucs-dashboard:nth-child(n+7) {
  flex: 0 0 calc(33.33% - 0.34rem);
  min-width: 200px;
}

/* Right side layout containers */
.large-graph {
  height: 500px;
  margin-bottom: 0.5rem;
}

.small-graphs-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  height: 400px;
  overflow-x: auto;
}

.small-graph {
  flex: 0 0 450px;
  min-width: 450px;
  width: 450px;
  height: 400px;

}

.medium-graphs-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  height: 350px;
  flex: 1;
}

.medium-graph {
  flex: 1;
  min-width: 0;
  height: 350px;
}

/* Canvas sizing */
canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  background-color: transparent !important;
}

/* Fullscreen button positioning */
.fullscreen-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #58a6ff;
}

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

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

.fullscreen .fullscreen-btn {
  top: 25px;
  right: 25px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.15);
}

/* Responsive behavior */
@media (max-width: 1200px) {
  .dashboard-container-nucs-dashboard {
    flex-direction: column;
    min-height: auto;
    overflow: visible;
  }

  .left-column-nucs-dashboard,
  .right-column-nucs-dashboard {
    flex: 0 0 100%;
    min-height: auto;
    overflow: visible;
  }

  .left-side-graph-container-nucs-dashboard:nth-child(-n+6),
  .left-side-graph-container-nucs-dashboard:nth-child(n+7) {
    flex: 0 0 calc(50% - 0.25rem);
    height: 300px;
  }

  .large-graph {
    height: 500px;
  }

  .small-graphs-row {
    flex-direction: column;
    height: auto;
    overflow-x: visible;
  }

  .small-graph {
    height: 300px;
    min-width: 100%;
    width: 100%;
    flex: 0 0 auto;
  }

  .medium-graphs-row {
    flex-direction: column;
    height: auto;
  }

  .medium-graph {
    height: 300px;
  }
}

@media (max-width: 700px) {
  .left-side-graph-container-nucs-dashboard:nth-child(-n+6),
  .left-side-graph-container-nucs-dashboard:nth-child(n+7) {
    flex: 0 0 100%;
    height: 250px;
  }

  .small-graphs-row,
  .medium-graphs-row {
    flex-direction: column;
  }

  .small-graph {
    height: 250px;
    min-width: 100%;
    width: 100%;
  }

  .medium-graph {
    height: 250px;
  }
}

/* Tables section - stretch full width */
.tables-section-nucs-dashboard {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 0.5rem;
}

/* Table Styles */
.nucs-fundamentals-table {
    margin: 5px 0;
    padding: 20px;
    width: 100%;
    background: rgba(22, 27, 34, 0.8);
    border-radius: 8px;
    border: 1px solid #30363d;
    box-sizing: border-box;
}

.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-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

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

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

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

.nucs-fundamentals-table th:first-child {
    text-align: left;
}

.nucs-fundamentals-table tbody {
    background: transparent;
}

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

.power-hour-cell {
    text-align: left !important;
}

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

.green-cell {
    background: linear-gradient(120deg, rgb(25, 40, 25), rgb(47, 72, 44));
    color: #ffffff;
}

.last-3-cols {
    background: linear-gradient(120deg, rgba(66, 19, 21, 0.72), rgba(105, 31, 39, 0.72));
    color: #ffffff;
}

.table-error {
    color: #f85149;
    text-align: center;
    padding: 20px;
    font-style: italic;
}