/* =========================================================
   SUNFLOWERCAST
   Panel użytkownika – UI v2
   ========================================================= */


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
  --panel-navy: #062452;
  --panel-blue: #0d5cff;
  --panel-yellow: #ffbf00;

  --panel-bg: #f6f8fc;
  --panel-border: #dfe5ef;

  --panel-text: #09245a;
  --panel-muted: #65738f;

  --panel-green: #14a84a;

  --panel-radius: 14px;
}


/* =========================================================
   BASE
   ========================================================= */

* {
  box-sizing: border-box;
}

.panelV2 {
  margin: 0;

  background: var(--panel-bg);
  color: var(--panel-text);

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.panelSidebar {
  position: fixed;
  inset: 0 auto 0 0;

  z-index: 30;

  display: flex;
  flex-direction: column;

  width: 220px;

  padding: 24px 16px;

  background:
    linear-gradient(
      180deg,
      #071f48,
      #052b62
    );
}


/* =========================================================
   LOGO
   ========================================================= */

.panelBrand {
  display: block;

  padding: 2px 5px 22px;
}

.panelBrand img {
  display: block;

  width: 175px;
  max-width: 100%;
  height: auto;

  opacity: 1;
  filter: none;
}


/* =========================================================
   INSTALLATION SELECTOR
   ========================================================= */

.installationSelector {
  padding: 14px 0 12px;

  border-top:
    1px solid rgba(255, 255, 255, 0.1);
}

.installationSelector__label {
  margin: 0 8px 8px;

  color: #fff;

  font-size: 12px;
  font-weight: 700;
}


/* =========================================================
   FARM TABS
   ========================================================= */

.farm-tabs {
  display: flex !important;
  flex-direction: column;

  gap: 5px;
}

.farm-tab {
  padding: 8px 10px;

  border-radius: 9px;

  background:
    rgba(255, 255, 255, 0.04);

  color: #fff;

  font-size: 13px;

  cursor: pointer;
}

.farm-tab:hover {
  background:
    rgba(255, 255, 255, 0.08);
}

.farm-tab.active {
  background:
    rgba(255, 191, 0, 0.16);

  box-shadow:
    inset 3px 0 var(--panel-yellow);
}


/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */

.sideNav {
  display: flex;
  flex: 1;
  flex-direction: column;

  gap: 8px;
}

.sideNav__item {
  display: flex;
  align-items: center;

  width: 100%;

  gap: 13px;

  padding: 13px 15px;

  border: 0;
  border-radius: 10px;

  background: transparent;

  color: #fff;

  font: inherit;
  font-weight: 600;
  text-decoration: none;

  cursor: pointer;
}

.sideNav__item svg {
  width: 21px;
  height: 21px;

  flex: 0 0 auto;
}

.sideNav__item:hover {
  background:
    rgba(255, 255, 255, 0.08);
}

.sideNav__item.is-active {
  background: var(--panel-yellow);
  color: #082452;
}

.sideNav__divider {
  height: 1px;

  margin: 8px 0 12px;

  background:
    rgba(255, 255, 255, 0.12);
}

.sideNav__logout {
  margin-top: auto;
}


/* =========================================================
   MAIN
   ========================================================= */

.panelMain {
  min-height: 100vh;

  margin-left: 220px;

  padding: 0 28px 36px;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.panelTopbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 88px;
}

.panelTopbar__actions {
  display: flex;
  align-items: center;

  gap: 18px;
}


/* =========================================================
   TOPBAR BUTTONS
   ========================================================= */

.iconButton,
.userAvatar {
  position: relative;

  border: 0;

  background: transparent;
  color: var(--panel-text);

  cursor: pointer;
}

.iconButton svg {
  width: 25px;
  height: 25px;
}

.notificationBadge {
  position: absolute;
  top: -9px;
  right: -7px;

  display: grid;
  place-items: center;

  min-width: 21px;
  height: 21px;

  border-radius: 50%;

  background: var(--panel-yellow);

  font-size: 11px;
  font-weight: 800;
}

.userAvatar {
  width: 48px;
  height: 48px;

  border-radius: 50%;

  background: #e9edf5;

  font-weight: 800;
}


/* =========================================================
   DASHBOARD GRID
   ========================================================= */

.dashboardGrid {
  display: grid;

  grid-template-columns:
    1.15fr
    1.15fr
    0.8fr;

  gap: 16px;

  max-width: 1500px;

  margin: auto;
}


/* =========================================================
   CARDS
   ========================================================= */

.dashboardCard {
  padding: 20px;

  border:
    1px solid var(--panel-border);

  border-radius:
    var(--panel-radius);

  background: #fff;

  box-shadow:
    0 4px 18px rgba(16, 39, 80, 0.035);
}

.dashboardCard h2 {
  margin: 0 0 10px;

  color: var(--panel-text);

  font-size: 16px;
}

.dashboardCard p {
  margin: 5px 0;

  color: var(--panel-muted);

  font-size: 13px;
}


/* =========================================================
   ACCOUNT CARD
   ========================================================= */

.accountCard {
  grid-column: 1 / 2;

  display: flex;
  align-items: flex-start;

  gap: 15px;
}

.accountCard .textButton {
  margin-left: auto;
}

.cardIcon {
  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;

  flex: 0 0 auto;
}

.statusGood {
  color: var(--panel-green);

  font-weight: 600;
}


/* =========================================================
   TEXT / LINK BUTTONS
   ========================================================= */

.textButton,
.linkButton {
  border: 0;

  background: none;

  color: var(--panel-blue);

  font-weight: 700;

  cursor: pointer;
}


/* =========================================================
   KPI
   ========================================================= */

.kpiCard {
  display: flex;
  align-items: center;

  gap: 18px;
}

.kpiIcon {
  display: grid;
  place-items: center;

  width: 72px;
  height: 72px;

  flex: 0 0 auto;

  border-radius: 50%;
}

.kpiIcon img {
  width: 42px;
  height: 42px;
}

.kpiIcon svg {
  width: 38px;
  height: 38px;
}

.kpiIcon--blue {
  background: #edf5ff;
  color: #1265ff;
}

.kpiIcon--violet {
  background: #f1eaff;
  color: #7228ff;
}

.kpiValue {
  font-size: 32px;
  font-weight: 700;

  line-height: 1.1;
}

.kpiValue small {
  font-size: 15px;
  font-weight: 600;
}

.kpiTrend {
  color: var(--panel-green) !important;
}


/* =========================================================
   AUTOMATIC PLAN GENERATION
   ========================================================= */

.autoCard {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.autoControls {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
}

.checkLine {
  display: flex;
  align-items: center;

  gap: 9px;

  font-size: 13px;
}

.checkLine input[type="checkbox"] {
  width: 17px;
  height: 17px;

  accent-color:
    var(--panel-yellow);

  cursor: pointer;
}

.timePill {
  min-width: 88px;

  padding: 9px 12px;

  border:
    1px solid var(--panel-border);

  border-radius: 9px;

  background: #fff;
  color: var(--panel-text);

  font-family: inherit;
  font-size: 13px;
  font-weight: 700;

  cursor: pointer;
}

.timePill:focus {
  outline: none;

  border-color:
    var(--panel-blue);

  box-shadow:
    0 0 0 3px rgba(13, 92, 255, 0.08);
}

.timePill:disabled {
  opacity: 0.45;

  background: #f3f5f9;

  cursor: not-allowed;
}

#autogenSaveInfo {
  color: var(--panel-muted);

  font-size: 11px;
}


/* =========================================================
   CHART CARD
   ========================================================= */

.chartCard {
  grid-column: 1 / 3;

  min-height: 310px;
}


/* =========================================================
   FORECAST MODULE WITH TABS
   ========================================================= */

.chartCard.forecastModule {
  grid-column: 1 / 3;

  min-height: 310px;

  padding: 20px;
}

.forecastModule__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 12px;
}

.forecastModule__header > div:first-child {
  min-width: 0;
}

.forecastModule__header h2 {
  margin: 0;

  color: var(--panel-text);

  font-size: 16px;
}

.forecastModule__header p {
  margin: 4px 0 0;

  color: var(--panel-muted);

  font-size: 11px;
}


/* =========================================================
   FORECAST TABS
   ========================================================= */

.forecastTabs {
  display: flex;
  align-items: center;

  gap: 4px;

  padding: 3px;

  border:
    1px solid var(--panel-border);

  border-radius: 9px;

  background: #f7f9fc;
}

.forecastTab {
  min-height: 32px;

  padding: 0 11px;

  border: 0;
  border-radius: 7px;

  background: transparent;
  color: var(--panel-muted);

  font: inherit;
  font-size: 12px;
  font-weight: 700;

  white-space: nowrap;

  cursor: pointer;
}

.forecastTab:hover {
  background: #fff;
  color: var(--panel-text);
}

.forecastTab.is-active {
  background: #fff;
  color: var(--panel-text);

  box-shadow:
    0 1px 4px rgba(16, 39, 80, 0.12);
}


/* =========================================================
   FORECAST VIEW
   ========================================================= */

.forecastView {
  width: 100%;
}

.forecastView__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 6px;
}

.forecastView__heading strong {
  color: var(--panel-text);

  font-size: 14px;
}

.forecastMainChart {
  width: 100%;
  height: 245px;
  min-height: 245px;
}

.forecastMainChart .chartPlaceholder {
  display: grid;
  place-items: center;

  width: 100%;
  height: 100%;

  color: #98a3b7;

  font-size: 13px;
}


/* =========================================================
   CHART LEGEND
   ========================================================= */

.cardHeading {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;
}

.chartLegend {
  color: var(--panel-muted);

  font-size: 12px;
}

.chartLegend i {
  display: inline-block;

  width: 20px;

  margin-right: 7px;

  border-top:
    3px solid var(--panel-yellow);

  vertical-align: middle;
}

.forecastModule .chartLegend {
  color: var(--panel-muted);

  font-size: 12px;
}


/* =========================================================
   OLD TOMORROW CHART COMPATIBILITY
   ========================================================= */

.tomorrowChart {
  display: grid;
  place-items: center;

  height: 245px;
}

.chartPlaceholder {
  color: #98a3b7;

  font-size: 13px;
}


/* =========================================================
   FORECAST MODULE INTERNAL TABLE / FOOTER
   ========================================================= */

/*
  Tabela 9-dniowa zostaje niżej,
  w energyForecastCard.
*/

.forecastModule .forecastTableWrap {
  display: none;
}

/*
  Odświeżanie / pobieranie zostaje
  w szybkich akcjach.
*/

.forecastModule__footer {
  display: none;
}


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.quickActions {
  grid-column: 3;
  grid-row: 2 / 4;
}

.quickActions h2 {
  margin-bottom: 14px;
}

.quickAction {
  display: flex;
  align-items: center;

  width: 100%;
  min-height: 50px;

  gap: 13px;

  margin: 0 0 10px;

  padding: 0 18px;

  border:
    1px solid var(--panel-border);

  border-radius: 9px;

  background: #fff;
  color: var(--panel-text);

  font-weight: 700;

  cursor: pointer;
}

.quickAction:hover {
  border-color: #c8d1df;

  background: #fafbfe;
}

.quickAction svg {
  width: 19px;
  height: 19px;
}

.quickAction span {
  margin-left: auto;
}

.quickAction--primary {
  border-color:
    var(--panel-yellow);

  background:
    var(--panel-yellow);
}

.quickAction--primary:hover {
  background: #f2b600;
}


/* =========================================================
   INSTALLATION INFORMATION
   ========================================================= */

.installationCard {
  grid-column: 1 / 3;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.installationSummary {
  display: flex;
  align-items: flex-start;

  gap: 18px;
}

.pvCompact .pv-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(180px, 1fr));

  gap: 5px 28px;

  color: var(--panel-muted);

  font-size: 13px;
}

.pvCompact .pv-grid > div:nth-child(n + 7) {
  display: none;
}


/* =========================================================
   OUTLINE BUTTON
   ========================================================= */

.outlineButton {
  padding: 10px 17px;

  border:
    1px solid var(--panel-border);

  border-radius: 9px;

  background: #fff;
  color: var(--panel-text);

  font-weight: 700;
  text-decoration: none;

  cursor: pointer;
}

.outlineButton:hover {
  background: #f8faff;
}


/* =========================================================
   RDN
   ========================================================= */

.rdnCard {
  grid-column: 1;
}

.rdnSummary {
  display: grid;

  gap: 12px;

  margin: 18px 0;
}

.rdnSummary > div {
  display: flex;
  justify-content: space-between;

  gap: 15px;

  font-size: 13px;
}

.rdnSummary span {
  color: var(--panel-muted);
}

.rdnSettingsCompact {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 10px;

  margin-top: 15px;
}

.rdnSettingsCompact label {
  display: grid;

  gap: 5px;

  color: var(--panel-muted);

  font-size: 11px;
}

.rdnSettingsCompact input,
.rdnSettingsCompact select {
  width: 100%;

  padding: 8px;

  border:
    1px solid var(--panel-border);

  border-radius: 8px;

  background: #fff;
}

.rdnActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 10px;

  margin-top: 14px;
}


/* =========================================================
   9-DAY FORECAST / PLAN DATA
   ========================================================= */

.energyForecastCard {
  grid-column: 2;
}

.forecastTable__head,
.forecastTable__row {
  display: grid;

  grid-template-columns:
    1fr
    1fr
    70px;

  align-items: center;

  gap: 10px;
}

.forecastTable__head {
  padding: 8px 0;

  border-bottom:
    1px solid var(--panel-border);

  color: var(--panel-muted);

  font-size: 11px;
}

.forecastTable__row {
  padding: 7px 0;

  border-bottom:
    1px solid #edf0f5;

  font-size: 12px;
}

.forecastTable__row:last-child {
  border-bottom: 0;
}

.weatherCell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.weatherCell img {
  width: 26px;
  height: 26px;
}

.forecastEmpty {
  padding: 25px 0;

  color: var(--panel-muted);

  font-size: 12px;
}

.energyForecastCard .linkButton {
  display: flex;
  align-items: center;

  gap: 8px;

  margin:
    12px 0 0 auto;
}


/* =========================================================
   INVERTER
   ========================================================= */

.inverterCard {
  grid-column: 3;

  text-align: center;
}

.inverterIcon {
  display: grid;
  place-items: center;

  width: 92px;
  height: 92px;

  margin: 15px auto;

  border-radius: 50%;

  background: #eef1f8;
}

.inverterIcon svg {
  width: 54px;
  height: 54px;
}

.inverterCard h3 {
  margin: 8px 0 3px;
}


/* =========================================================
   HIDDEN FORECAST AREA
   ========================================================= */

.hiddenForecastArea {
  position: absolute;

  width: 1px;
  height: 1px;

  overflow: hidden;

  clip: rect(0 0 0 0);
}


/* =========================================================
   SCREEN READER ONLY
   ========================================================= */

.srOnly {
  position: absolute !important;

  width: 1px !important;
  height: 1px !important;

  padding: 0 !important;
  margin: -1px !important;

  overflow: hidden !important;

  clip:
    rect(0, 0, 0, 0) !important;

  white-space: nowrap !important;

  border: 0 !important;
}
/* =========================================================
   INVERTER STATUS
   ========================================================= */

.inverterStatusLine {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  margin: 8px 0 4px;

  font-size: 15px;
  font-weight: 700;
}

.inverterStatusDot {
  width: 10px;
  height: 10px;

  flex: 0 0 10px;

  border-radius: 50%;

  background: #98a2b3;
}

.inverterStatusDot.is-online {
  background: var(--panel-green);
}

.inverterStatusDot.is-error {
  background: #ef4444;
}

.inverterStatusMeta {
  margin: 4px 0 14px !important;

  color: var(--panel-muted);

  font-size: 12px !important;
  text-align: center;
}


/* =========================================================
   TODAY FORECAST / ACTUAL SUMMARY
   ========================================================= */

/* =========================================================
   PRODUCTION CARD
   ========================================================= */

.productionCard {
  grid-column: 2;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.productionCard__heading {
  display: flex;
  align-items: center;

  gap: 18px;

  margin-bottom: 14px;
}

.productionCard__heading .kpiIcon {
  width: 58px;
  height: 58px;
}

.productionCard__heading .kpiIcon svg {
  width: 30px;
  height: 30px;
}

.productionCard__heading h2 {
  margin: 0;
}

.productionCard__heading p {
  margin: 3px 0 0;

  color: var(--panel-muted);

  font-size: 12px;
}


/* =========================================================
   TODAY FORECAST / ACTUAL SUMMARY
   ========================================================= */

/* =========================================================
   PRODUCTION CARD
   ========================================================= */

.productionCard {
  grid-column: 2;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.productionCard__heading {
  display: flex;
  align-items: center;

  gap: 18px;

  margin-bottom: 14px;
}

.productionCard__heading .kpiIcon {
  width: 58px;
  height: 58px;
}

.productionCard__heading .kpiIcon svg {
  width: 30px;
  height: 30px;
}

.productionCard__heading h2 {
  margin: 0;
}

.productionCard__heading p {
  margin: 3px 0 0;

  color: var(--panel-muted);

  font-size: 12px;
}


/* =========================================================
   TODAY FORECAST / ACTUAL SUMMARY
   ========================================================= */

.forecastTodaySummary {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 9px;

  margin: 0;
}

.forecastTodaySummary__item {
  padding: 10px 12px;

  border:
    1px solid var(--panel-border);

  border-radius: 10px;

  background: #f8faff;
}

.forecastTodaySummary__item span {
  display: block;

  margin-bottom: 4px;

  color: var(--panel-muted);

  font-size: 11px;
}

.forecastTodaySummary__item strong {
  color: var(--panel-text);

  font-size: 16px;
}


/* =========================================================
   TODAY CHART LEGEND
   ========================================================= */

.todayChartLegend {
  display: flex;
  align-items: center;

  gap: 18px;

  color: var(--panel-muted);

  font-size: 12px;
}

.todayChartLegend__item {
  display: inline-flex;
  align-items: center;

  gap: 7px;
}

.todayChartLegend__line {
  display: inline-block;

  width: 20px;
  height: 3px;

  border-radius: 4px;
}

.todayChartLegend__line--forecast {
  background: var(--panel-yellow);
}

.todayChartLegend__line--actual {
  background: var(--panel-text);
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

  .panelSidebar {
    width: 190px;
  }

  .panelMain {
    margin-left: 190px;

    padding: 0 18px 30px;
  }

  .dashboardGrid {
    grid-template-columns:
      1fr 1fr;
  }

  .quickActions,
  .inverterCard {
    grid-column: auto;
    grid-row: auto;
  }

  .chartCard,
  .installationCard,
  .chartCard.forecastModule {
    grid-column: 1 / 3;
  }

.rdnCard,
.energyForecastCard,
.productionCard {
  grid-column: auto;
}

  .forecastModule__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .forecastTabs {
    width: 100%;
  }

  .forecastTab {
    flex: 1;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {

  .panelSidebar {
    position: relative;

    width: 100%;
    min-height: auto;

    padding: 15px;
  }

  .panelBrand img {
    width: 150px;
  }

  .installationSelector {
    border-top: 0;
  }

  .sideNav {
    display: grid;

    grid-template-columns:
      1fr 1fr;
  }

  .sideNav__divider {
    display: none;
  }

  .sideNav__logout {
    margin-top: 0;
  }


  /* MAIN */

  .panelMain {
    margin-left: 0;

    padding: 0 12px 24px;
  }

  .panelTopbar {
    height: 70px;
  }


  /* GRID */

  .dashboardGrid {
    grid-template-columns: 1fr;
  }

.dashboardCard,
.chartCard,
.chartCard.forecastModule,
.installationCard,
.quickActions,
.rdnCard,
.energyForecastCard,
.inverterCard,
.productionCard {
  grid-column: 1;
}


  /* ACCOUNT */

  .accountCard {
    flex-wrap: wrap;
  }


  /* INSTALLATION */

  .installationCard {
    align-items: flex-start;
    flex-direction: column;

    gap: 15px;
  }

  .pvCompact .pv-grid {
    grid-template-columns: 1fr;
  }


  /* RDN */

  .rdnSettingsCompact {
    grid-template-columns: 1fr;
  }


  /* AUTOGEN */

  .autoControls {
    align-items: flex-start;
    flex-direction: column;
  }

  .timePill {
    width: 100%;
  }


  /* FORECAST TABS */

  .forecastModule__header {
    align-items: stretch;
    flex-direction: column;
  }

  .forecastTabs {
    display: grid;

    grid-template-columns:
      1fr 1fr;

    width: 100%;
  }

  .forecastTab {
    width: 100%;
  }

  .forecastView__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .forecastMainChart {
    height: 230px;
    min-height: 230px;
  }


  /* FORECAST TABLE */

  .forecastTable__head,
  .forecastTable__row {
    grid-template-columns:
      minmax(90px, 1fr)
      minmax(100px, 1fr)
      48px;
  }



.todayChartLegend {
  flex-wrap: wrap;
}
  /* KPI */

  .kpiValue {
    font-size: 28px;
  }
}