/* =========================================================
   BASE STYLES
   ========================================================= */
/* #region BASE STYLES ALL */
body {
  font-family: articulat-cf, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 60px;
  height: 100vh;
  background: #000000;
  margin: 0;
}

label {
  color: white
}

h1 {
  color: white;
  margin-bottom: 25px;
  font-weight: 400;
  font-size: 28px;
  text-align: flex-start;
}

h2 {
  color: white;
  margin-bottom: 25px;
  font-weight: 400;
  font-size: 24px;
  text-align: flex-start;
}

h3 {
  color: white;
  margin-top: 5px
}

h4{
  color: white;
  font-weight: 300;
  margin-top: 5px
}

a {
  text-decoration: none;
  color: #ffffff;
}

a:hover {
  text-decoration: none;
  color: #29e490;
}

li{
  color: white
}

.hidden {
    display: none;
}
/* #endregion */

@media (max-width: 1150px) {
  /* Headers */
  h1 {
    font-size: 21px;
  }
  
  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 16px
  }
}

@media (max-width: 768px) {
  p{
    font-size: 12px;
  }
  body {
    padding-top: 80px;
  }
}



/* =========================================================
   FORM ELEMENT STYLES
   ========================================================= */
/* #region FORM STYLES ALL */
input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  color: white;
  border: none;
  border-bottom: 1px solid #9e9e9e;
  background-color: rgb(43, 43, 43);
  font-size: 16px;
  transition: all 0.3s ease-in-out;
  outline: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: rgb(213, 213, 213) !important;
  background-color: rgb(43, 43, 43) !important;
  transition: background-color 5000s ease-in-out 0s;
}

input:focus {
  border-color: #e1e1e1;
}

/* ------- Input box ---------- */
.input-box{
  background-color: #2b2b2b;
  border-radius: 7px;
  padding: 10px;
  color: rgb(196, 196, 196);
  border: 1px solid #989898;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.input-box--large {
  font-size: 15px;
}

.input-box:focus {
  outline: none;
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 2px rgba(70, 182, 131, 0.3);
}

/* ------- Dropdown ---------- */
.dropdown-select{
  background-color: #252525;
  border-radius: 7px;
  padding: 10px;
  color: rgb(196, 196, 196);
  border: 1px solid #989898;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.dropdown-select--large {
  font-size: 15px;
}

.dropdown-select--wide {
  background-color: #252525;
  border-radius: 7px;
  padding: 5px;
  color: rgb(196, 196, 196);
  border: 1px solid #989898;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  width: 34.5vw
}

.dropdown-select--narrow {
  background-color: #252525;
  border-radius: 7px;
  padding: 5px;
  color: rgb(196, 196, 196);
  border: 1px solid #989898;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  width: 14.5vw
}

.dropdown-select:hover {
  background-color: #3d3d3d;
}

.dropdown-select:focus {
  outline: none;
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 2px rgba(70, 182, 131, 0.3);
}

/* ---------- Placeholder Text Boxes --------- */
.placeholder-text-box {
  width: 98%;
  background: var(--surface-light);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.95rem;
  resize: none;
  transition: var(--transition);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  margin-bottom: 10px;
}

.placeholder-text-box:focus {
  outline: none;
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 2px rgba(70, 182, 131, 0.3);
}

/* ---------- Flatpickr calendar ---------- */
/* Flatpickr calendar background */
.flatpickr-calendar {
    background-color: #505050 !important;
    border: 1px solid #333;
}

/* Weekday labels */
.flatpickr-weekday {
    color: #fff !important;
}

/* Days */
.flatpickr-day {
    color: #fff !important;
}

/* Selected day / today */
.flatpickr-day.selected,
.flatpickr-day.today {
    background-color: #26bf7a !important;
    color: #fff !important;
}

/* Hover state */
.flatpickr-day:hover {
    background-color: #666 !important;
    color: #fff !important;
}

/* Month and navigation arrows */
.flatpickr-month,
.flatpickr-prev-month,
.flatpickr-next-month {
    color: #fff !important;
}

/* Time picker (if enabled) */
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator {
    color: #fff !important;
    background-color: #a0a0a0 !important;
}

/* ---------- YTD Filters ---------- */
.performance-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #646464;
    border-radius: 8px;
    background-color: #2a2a2a;
    justify-content: flex-start;
}

/* Each filter block */
.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1f1f1f;
    padding: 0px 8px;
    border-radius: 6px;
    min-width: 160px;
    flex: 1 1 auto; 
    transition: all 0.2s ease;
}

/* Label styling */
.filter-item label {
    color: #E3E3E3;
    font-weight: 500;
    min-width: 90px;
    font-size: 13px;
}


/* Inputs and select */
.filter-item select {
    background-color: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    padding-top: 4px; 
    padding-bottom: 4px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    min-width: 120px;
}
.filter-item input {
    background-color: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    padding-top: 4px; 
    padding-bottom: 4px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    min-width: 120px;
}

.filter-item input,
.filter-item select {
  width: 100%;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #489FE1;
}

.filter-item:hover {
    background-color: #252525;
}

/* ---------- Events Management Filters ---------- */
.dropdown-select,
#filter-start,
#filter-end,
#eventTypeDropdown,
#eventStatusDropdown {
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid #666;
  background-color: #222;
  color: white;
  width: 8vw;
}
#columns-dropdown-toggle {
  max-width: 6vw;
}

.columns-dropdown-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  background-color: #858585;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 8px 0;
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 400px;

  scrollbar-width: thin;
  scrollbar-color: rgb(91, 91, 91) grey;
}

.columns-dropdown-menu.show {
    display: block;
}

.columns-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.columns-dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 12px;
}

.columns-dropdown-menu::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2); 
  border-radius: 12px;
}

.columns-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.columns-dropdown-menu label {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #1c1c1e;
  white-space: nowrap;
  overflow: hidden;
}

.columns-dropdown-menu label:hover {
  background-color: #989898;
  border-radius: 8px;
}

.columns-dropdown-menu input[type="checkbox"] {
  margin-right: 8px;
  accent-color: white;
  width: 100px
}

/* ----------- Mobile filters toggle ------------ */
.mobile-filters-toggle {
    display: none; /* Desktop hidden */
    width: 100%;
    padding: 14px 18px;
    background: #767676;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    margin: 10px 0;
    cursor: pointer;
}

/* ---------- Event Management Manual Event Form -------- */
/* Smooth open */
#manual-event-form-container {
    transition: all 0.25s ease;
}
.manual-event-form {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background-color: #2b2b2b;
    border-radius: 7px;
    color: #ccc;
}

.manual-event-form h4 {
    color: #fff;
    margin-bottom: 12px;
}

.manual-event-form label {
    color: #ccc;
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.manual-event-form input,
.manual-event-form textarea,
.manual-event-form select {
    width: 100%;
    margin-bottom: 14px;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #333;
}

.manual-event-form textarea {
    width: 99%;
}

#end-time-container {
  transition: all 0.3s ease;
}
/* #endregion */

@media (max-width: 1150px) {
  /* Events Mgt */
  .events-filter-container label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: #ccc;
  }

  .events-filter-container input,
  .events-filter-container select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #666;
    background-color: #2b2b2b;
    color: #eee;
    font-size: 14px;
  }

  .columns-dropdown-container{
    display: none !important
  }

  .dropdown-select,
  #filter-start,
  #filter-end,
  #eventTypeDropdown,
  #eventStatusDropdown {
    width: 50vw;
    font-size: 12px
  }
}

@media (max-width: 768px) {
  .control-group label {
    font-size: 12px;
  }
  .control-group input[type="datetime-local"],
  .control-group select {
      font-size: 12px;
  }
  .performance-filters {
      justify-content: center;
      gap: 12px;
      padding: 8px;
  }
  .filter-item {
      min-width: 130px;
  }
  .filter-item label {
      font-size: 12px;
      min-width: 80px;
  }
  .filter-item input,
  .filter-item select {
      font-size: 12px;
      min-width: 100px;
  }

  #breakdown-filter-item{
    height: 41px
  }

  label{
    font-size: 12px
  }

  input{
    font-size: 13px;
  }
  
  /* Mobile filters toggle */
  .mobile-filters-toggle {
      display: block;  /* Mobile visible */
  }

  /* Hide filter container by default */
  #events-filter-container {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.35s ease;
      width: 93%;

      /* Remove padding + margin when collapsed */
      padding-top: 0 !important;
      padding-bottom: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      border: none !important;
  }

  /* When expanded */
  #events-filter-container.expanded {
      max-height: 800px; /* enough to show all filters */
      margin-top: 5px !important;
      margin-bottom: 15px !important;
      padding: 9px 14px !important;
      width: 93%;
  }
}



/* =========================================================
   TABLE STYLES
   ========================================================= */
/* #region TABLE STYLES ALL */
/* Horizontal Table */
.horizontal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; 
    font-size: 14px;
}

.horizontal-table th, .horizontal-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #555;;
    text-align: left;
    color: #bfbfbf;
}

.horizontal-table th {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    color: #c1c1c1;
}

.horizontal-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Vertical table */
.vertical-table th,
.vertical-table td {
  padding: 6px 12px;
  font-size: 14px;
  text-align: left;
  border-top: 1px solid #444;
  vertical-align: middle;
}

.vertical-table th {
  background-color: #444;
  color: #fff;
  border-top: none;
}

.vertical-table th:first-child {
  border-top-left-radius: 7px;
}

.vertical-table th:last-child {
  border-top-right-radius: 7px;
}

/* ------------ Dashboard Table ------------ */
#dashboard-table {
  width: 100%;
  margin-top: 20px;
  border-spacing: 0;
}

#dashboard-table th, #dashboard-table td {
  border-top: 1px solid #ddd;
  padding: 8px;
  font-size: 14px;
  text-align: left;
  color: rgb(164, 164, 164);
}

#dashboard-table th {
  background-color: #9b9b9b;
  color: rgb(75, 75, 75);
  border-top: 0px ;
}

#dashboard-table th:first-child {
  border-top-left-radius: 7px;
}

#dashboard-table th:last-child {
  border-top-right-radius: 7px;
}

.top-chart-row, .bottom-chart-row {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.top-chart-row .timeseries-chart,
.bottom-chart-row .timeseries-chart {
  flex: 1;
}

/* ------------ Alerts Table Styles ------------ */
#alertsContainer{
  background:#222222;
  padding:15px;
  border-radius: 7px;
  min-height: 74px;
}

#alerts-h3{
  margin-top: 3px
}
#alerts-p{
  color: white
}
#alerts-loading{
  color: white
}
.alerts-table-container {
  max-height: 300px;
  overflow-y: auto;
  border-radius: 7px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}
.alerts-table {
  width: 100%;
  border-collapse: collapse;
  background:#333;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  table-layout: auto;
  word-wrap: break-word;
  padding: 15px;
  max-height: 380px;
  cursor: pointer
}


.alerts-table th, .alerts-table td {
  padding: 10px;
  color: rgb(206, 206, 206);
  text-align: left;
  font-size: 14px
}

.alerts-table th {
  padding: 10px;
  font-weight: bold;
  border-bottom: 1px solid #9e9e9e;
  color: white;
}

.alerts-table tbody tr:hover {
  background-color: #3a3a3a;
}

.alerts-table tr:hover {
  background-color: #333;
}

.alerts-table td:first-child, 
.alerts-table th:first-child {
  max-width: 300px;
}

.alerts-table td:last-child, 
.alerts-table th:last-child {
  max-width: 120px;
  min-width: 120px;
}

.alerts-table td:nth-last-child(2),
.alerts-table th:nth-last-child(2) {
  max-width: 230px; 
  min-width: 230px;
}

/* ------------ Performance Coverage Table ------------ */
.col-metric {
  width: 20%;
}

.col-coverage {
  width: 45%;  /* Wider for progress bars */
}

.col-value,
.col-expected,
.col-date {
  width: 15%;
}

.coverage-table-wrapper {
  overflow: auto;
  border: 1px solid #4c4c4c;
  border-radius: 10px;
  margin-top: 18px;
  margin-bottom: 5px
}

.coverage-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #313131;
  color: rgb(227, 227, 227);
  font-size: 14px
}

.coverage-header {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #3b3b3b;
  font-weight: 600;
  background-color: #444444;
}

.coverage-header.text-right {
  text-align: right;
}

.coverage-cell {
  padding: 10px 12px;
  border-bottom: 1px solid #363636;
}


/* ------------ Performance YTD Table ------------ */
.ytd-tables {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.ytd-table-container {
    flex: 1 1 48%; 
    min-width: 300px; 
}

/* Headings */
.ytd-table-container h4 {
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 18px;
}

.ytd-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    overflow: hidden;
}

/* ------------ Performance Details Table ------------ */
.detail-tables {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two equal columns */
  gap: 20px;
  margin-top: 20px;
}

.detail-table-container {
  background-color: #2b2b2b;
  border-radius: 7px;
  padding: 16px;
}

.detail-table-container th {
  background-color: #444; 
  color: #fff;
  border-top: 0;
}

.detail-table-container h4 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: bold;
}


/* ---------- Events Management Table ---------- */
#events-table th {
  background-color: #444;
  color: #fff;
  border-top: none;
}

#events-table td {
  cursor: pointer
}

/* Set the 4th column to 250px */
#events-table th:nth-child(4),
#events-table td:nth-child(4) {
  width: 250px;
  max-width: 250px;
  min-width: 250px;
  word-wrap: break-word;       /* content wraps if too long */
  overflow-wrap: break-word;
}

/* Set the last column to 100px */
#events-table th:nth-child(10),
#events-table td:nth-child(10) {
  width: 100px;
  max-width: 100px;
  min-width: 100px;
}

/* ---------- Event Detail Event Info Table -------- */
#event-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  table-layout: fixed;
  color: rgb(175, 175, 175);
  background: var(--surface-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

/* Column width ratios (2:2:1) */
#event-detail-table .col-label {
  width: 43%;
}

#event-detail-table .col-value {
  width: 43%;
}

#event-detail-table .col-actions {
  width: 14%;
  text-align: left;
}

/* ---------- Event Detail Comments Table -------- */
.comments-table-wrapper {
    max-height: 300px;
    overflow-y: auto;
}

#comments-table th:last-child,
#comments-table td:last-child {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

#comments-table th:nth-child(2),
#comments-table td:nth-child(2) {
  width: 250px;
  max-width: 250px;
  min-width: 250px;
  word-wrap: break-word;       /* content wraps if too long */
  overflow-wrap: break-word;
}

/* ---------- Event Detail Attachments Table -------- */
#attachments-table th:last-child,
#attachments-table td:last-child {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}
#attachments-table th:nth-child(2),
#attachments-table td:nth-child(2) {
  width: 250px;
  max-width: 250px;
  min-width: 250px;
  word-wrap: break-word;       /* content wraps if too long */
  overflow-wrap: break-word;
}
/* #endregion */

@media (max-width: 1400px) {
  #dashboard-table th, #dashboard-table td {
    padding: 4px;
    font-size: 12px;
  }

}

@media (max-width: 1150px) {
  /* Dashboard Table */
  #dashboard-table th, #dashboard-table td {
    padding: 4px;
    font-size: 12px;
  }
  .alerts-table th, .alerts-table td {
    font-size: 12px;
  }
  .alerts-table td {
    font-size: 12px;
    padding: 5px 10px;
  }

  /* Event Detail tables */
  .detail-table-container th,
  .detail-table-container td {
    font-size: 12px;
  }

  /* Event Detail Comments */
  #comments-table th:last-child,
  #comments-table td:last-child {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
  }
  #events-dashboard table,
  #events-dashboard thead,
  #events-dashboard tbody,
  #events-dashboard th,
  #events-dashboard td,
  #events-dashboard tr {
    display: block;
  }

  #events-dashboard th {
    display: none;
  }

  #events-dashboard td::before {
    position: absolute;
    left: 10px;
    width: 45%;
    white-space: nowrap;
    font-weight: 600;
    color: #ccc;
    text-align: left;
  }

  /* Add a 1pt border between rows */
  #events-dashboard tbody tr {
    border-bottom: 1pt solid #8b8b8b;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  #events-dashboard tbody tr:last-child {
    border-bottom: none; /* no border after last row */
  }

  /* Horizontal table mobile view */
  .horizontal-table,
  .horizontal-table thead,
  .horizontal-table tbody,
  .horizontal-table th,
  .horizontal-table td,
  .horizontal-table tr {
    display: block;
    width: 100%;
    font-size: 13px
  }

  /* Hide desktop header */
  .horizontal-table thead {
    display: none;
  }

  .horizontal-table tr {
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px 0;
  }

  .horizontal-table td {
    position: relative; /* required for ::before */
    padding: 14px 16px 14px 140px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .horizontal-table td:last-child {
    border-bottom: none;
  }

  /* Data labels for mobile */
  .horizontal-table td::before {
    content: attr(data-label); /* get label from JS */
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    opacity: 0.75;
    width: 120px;
    white-space: normal;
    pointer-events: none;
  }
}

@media (max-width: 1020px) {
  .alerts-table td:nth-last-child(2),
  .alerts-table th:nth-last-child(2) {
    max-width: initial;
    min-width: initial;
    width: auto;
  }
}

@media (max-width: 958px) {
  /* Stack tables vertically on smaller screens */
  .detail-tables {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 96.2%
  }

  .detail-table-container {
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Performance Coverage */
  .coverage-table {
    font-size: 13px
  }
}

@media (max-width: 700px) {
  /* Event Detail */
  /* Column width ratios (2:2:1) */
  #event-detail-table .col-label {
    width: 38%;
  }

  #event-detail-table .col-value {
    width: 40%;
  }

  #event-detail-table .col-actions {
    width: 18%;
    text-align: left;
  }

  /* Vertical table mobile view */
  .vertical-table tr,
  .vertical-table td {
    font-size: 13px;
    word-wrap: break-word;       /* Old but still widely supported */
    overflow-wrap: break-word;   /* Modern standard */
    word-break: break-word; 
  }

  #event-detail-table th:first-child,
  #event-detail-table td:first-child {
    width: 100px;
    min-width: 50px;
    max-width: 50px;
  }
}

@media (max-width: 560px) {
  .detail-table-container {
    width: 96%;
    overflow-x: auto;
  }
  #kpi-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
  }
  .coverage-table {
    font-size: 12px
  }
  .coverage-table-wrapper {
    overflow-x: auto;   /* horizontal scroll */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; 
  }
  .coverage-table {
    border-collapse: separate;
    border-spacing: 0;
  }
}

@media (max-width: 504px) {
  .resolved-view-active .alerts-table td:last-child,
  .resolved-view-active .alerts-table th:last-child {
    max-width: 70px;
    min-width: 70px;
  }
}

@media (max-width: 478px) {
  .alerts-table {
    max-width: 84vw;
  }
  .resolved-view-active .alerts-table td:last-child,
  .resolved-view-active .alerts-table th:last-child {
    max-width: 55px;
    min-width: 55px;
  }
  .resolved-view-active .alerts-table td,
  .resolved-view-active .alerts-table th {
    padding: 7px
  }
  .alerts-table td:last-child,
  .alerts-table th:last-child {
    max-width: 100px;
    min-width: 100px;
    padding: 5px
  }
  .alerts-table td,
  .alerts-table th {
    padding: 8px
  }
}



/* =========================================================
   BUTTON STYLES
   ========================================================= */
/* #region BUTTON STYLES ALL */
button {
  width: 100%;
  padding: 12px;
  background: #26bf7a;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease-in-out, transform 0.1s ease-in-out;
}

button:hover {
  background: #1e9d64;
}

button:active {
  transform: scale(0.98);
}

.delete-btn{
  font-size: 12px;
  background-color: rgb(200, 61, 49);
  width: 110px;
  padding: 5px;
  color: white
}

.delete-btn:hover{
  background-color: rgb(176, 54, 43);
}

.delete-btn-medium{
  font-size: 12px;
  background-color: rgb(200, 61, 49);
  color: white
}

.delete-btn-medium:hover{
  background-color: rgb(176, 54, 43);
}

.add-wide-action {
  margin-top: 8px;
  background-color: #1fb572;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(70, 182, 131, 0.3);
  padding: 8px;
}

.submit-btn{
  color: white;
  padding: 5px;
  height: auto
}

.secondary-btn-medium {
  background: rgb(99, 99, 99);
  border: 1px solid #555;
  color: #ffffff;
  padding: 10px
}

.secondary-btn-medium:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}

.secondary-btn-small {
  background: rgb(49, 49, 49);
  border: 1px solid #555;
  color: #ffffff;
  padding: 4px;
  margin-top: 4px;
  width: 120px
}

.secondary-btn-small:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}

.comment-btn:hover {
  background-color: #3da174;
  transform: translateY(-1px);
}

.comment-btn:active {
  transform: translateY(0);
}

.action-btn-small{
  padding: 5px;
  color: white;
  width: 120px
}

.charts-btn {
  background-color: #3b3b3b;
  color: #ccc;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
  width: 150px
}

.charts-btn:hover,
.charts-btn.active {
  background-color: #c1c1c1;
  color: #393939;
}

/* -------------- Download csv -------------- */
.download-controls button {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 15px;
    border: none;
    border-radius: 8px;
    background-color: #29e490;
    color: rgb(92, 92, 92);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.download-controls button:hover {
    background-color: #3ea074;
}

/* -------------- Energy History -------------- */
.update-button{
  width: 80px;
  padding: 4px 6px;
  background-color: #b8b8b8;
  margin-left: 5px;
  margin-right: 20px
}

.update-button:hover{
  background-color: #919191;
}

.range-btn {
  background-color: #515151;
  color: #ccc;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
  width: 80px;
}

.range-btn:hover,
.range-btn.active {
  background-color: #29e490;
  color: #393939;
}

/* -------------- Alerts -------------- */
.alerts-button {
  padding: 6px 12px;
  width: 95%;
  background-color: #6a6a6a;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px
}

.alerts-button:hover {
  background-color: #8a8a8a;
}

.resolve-button {
  margin-top: 5px;
  margin-bottom: 5px;
}

/* -------------- Modal -------------- */
.close-popup-button {
  float: right;
  background: #6a6a6a;
  border: none;
  color: white;
  padding: 5px 10px;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500

}
.close-popup-button:hover {
  background: #868686;
}

/* -------------- Resolve/Acknowledge pop up -------------- */
.Resolve-button{
  background: #29e490;
  padding: 6px 12px;
  color: rgb(45, 45, 45);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px
}
.Acknowledge-button{
  background: #29e490;
  padding: 6px 12px;
  color: rgb(45, 45, 45);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px
}

/* -------------- String Current Buttons -------------- */
.string-btn {
  background-color: #3b3b3b;
  color: #ccc;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
  width: 150px
}

.string-btn:hover,
.string-btn.active {
  background-color: #c1c1c1;
  color: #393939;
}
.string-btn-trends {
  background-color: #3b3b3b;
  color: #ccc;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
  width: 150px
}

.string-btn-trends:hover{
  background-color: #c1c1c1;
  color: #393939;
}

.close-button {
  position: absolute;
  top: 68px;
  right: 67px;
  width: 30px;
  background: #444;
  color: white;
  border: none;
  font-size: 18px;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 10;
}

/* -------------- Tracker Buttons -------------- */
#apply-tracker-filter {
    margin-top: 0px;
    margin-bottom: 0px;
    padding: 8px 16px;
    background-color: #bbb;
    border: 1px solid #999;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    align-self: flex-end; 
}

#apply-tracker-filter:hover {
    background-color: #999;
}

/* ---------- Events Management Btn ---------- */
#event-mgt-filters-btn,
#event-mgt-filters-clear-btn {
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  color: white;
  width: 80px
}

/* Arrow buttons */
.arrow-btn {
  background-color: #444;
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arrow-btn:hover:not(:disabled) {
  background-color: #1fb572;
  transform: translateY(-1px);
}

.arrow-btn:disabled {
  background-color: #333;
  color: #777;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
    color: #fff;
    padding: 8px;
    margin-top: 10px
}

/* Manual event form */
.manual-event-form button {
    margin-right: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

/* ---------- Event Detail Attachments Button -------- */
#add-manual-event-btn{
  font-size: 15px
}
/* #endregion */
@media (max-width: 1150px) {
  .range-btn {
    font-size: 14px;
    font-weight: 400;
  }
  #event-mgt-filters-btn {
    width: 50vw;
    margin-top: 10px
  }
  #event-mgt-filters-clear-btn {
    margin-bottom: 10px;
    width: 50vw;
  }
  .delete-btn{
    width: 50px;
  }
  .action-btn-small{
    width: 60px;
    padding: 3px
  }
  .secondary-btn-small {
    width: 60px;
    padding: 3px;
  }
  #download-view-btn,
  #download-all-btn {
    width: 100px;
    padding: 3px;
  }
}

@media (max-width: 900px) {
  .secondary-btn-small {
    font-size: 11px
  }
  .action-btn-small{
    font-size: 11px
  }
}

@media (max-width: 768px) {
  button {
    font-size: 11px
  }
  .action-btn-small{
    font-size: 11px;
  }
  .range-btn {
    font-size: 11px;
  }
  .alerts-button {
    font-size: 11px;
    font-weight: 400
  }
  .close-button {
    font-size: 13px;
    top: 110px;
    right: 20px;
  }
  .string-btn{
    font-size: 11px;
    padding: 7px 0px;
    width: 80px
  }
  .string-btn-trends {
    font-size: 11px;
    padding: 7px 0px;
    width: 80px
  }
  .charts-btn{
    width: 100px
  }
  .btn-primary{
    font-size: 12px !important
  }
  #farm-dropdown{
    font-size: 16px !important
  }
}

@media (max-width: 478px) {
  #download-view-btn,
  #download-all-btn {
    width: 150px;
    padding: 3px;
  }
}



/* =========================================================
   ERRORS & OTHER TEXT STYLES
   ========================================================= */
/* #region TEXT STYLES ALL */
.input-error {
    border: 2px solid #d9534f !important;
    background: #ffeaea;
    animation: shake 0.2s ease-in-out;
}

/* Shake animation */
@keyframes shake {
    0% { transform: translateX(0px); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0px); }
}

/* Inline error message */
.form-error-message {
    color: #ff4d4f;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.error-message {
  color: #d93025;
  font-size: 0.85em;
  margin-top: 5px;
  text-align: left;
}

/* Smooth highlight with fade out if you want */
.highlight-event {
    background-color: #585858 !important; 
    transition: background-color 1s ease;
}

/* Optional: fade back to normal after 2s */
.highlight-event.fade-out {
    background-color: transparent;
}

.missing-category {
    background-color: #fff3cd !important; 
    position: relative;
    animation: pulseHighlight 1.4s ease-out 2;
    border-left: 4px solid #f0ad4e;
}

.missing-category-hint {
    font-size: 0.8rem;
    color: #856404;
    margin-top: 4px;
}

@keyframes pulseHighlight {
    0% { box-shadow: 0 0 0 0 rgba(240,173,78,0.5); }
    70% { box-shadow: 0 0 0 10px rgba(240,173,78,0); }
    100% { box-shadow: 0 0 0 0 rgba(240,173,78,0); }
}

.severity-high {
  color: #dc3545 !important;
}

.severity-medium {
  color: #ff6e33 !important;
}

.severity-low {
  color: #268b5d !important;
}

.severity-normal {
  color: #ffffff !important;
}

.resolution-comment{
  width: 97%;
  color: white;
  background: rgb(45, 45, 45);
  margin-bottom: 15px;
  border-radius: 7px;
  border: 1px solid rgb(78, 78, 78);
  padding: 5px;
  font-size: 14px;
  font-family: articulat-cf, sans-serif;
}

.text-right {
  text-align: right;
}

.dashboard-footer{
  width: 98.5%;
  background-color: #2b2b2b;
  color: #ffffff;
  text-align: center;
  padding: 20px 0;
  margin-top: 20px;
  border-top: 1px solid #444;
  font-size: 16px;
  border-radius: 7px;
  padding: 10px;
  color: red;
  font-weight: bold;
  display: none
}
/* #endregion */

@media (max-width: 1150px) {
  .tile-header{
    font-size: 16px
  }
  #formatted-latest-date{
    font-size: 14px
  }
  #gen-en-header{
    font-size: 16px;
    font-weight: 600;
  }

  /* History controls */
  .energy-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .dashboard-footer{
    width: 97.5%;
  }
}

@media (max-width: 560px) {
  .dashboard-footer{
    width: 95.7%;
  }
}

@media (max-width: 504px) {
  .farm-tile-highlighted{
    font-size: 10px;
    padding: 2px
  }
  .tile-header{
    font-size: 15px;
    margin-bottom: 4px;
    margin-top: 0px
  }
}



/* =========================================================
   DASHBOARD PAGES & COMPONENTS
   ========================================================= */
/* #region DASHBOARD STYLES ALL */
/* ---------------- Login ---------------- */
.signup-link {
  color: rgb(203, 203, 203)
}

.login-container {
  background: rgb(43, 43, 43);
  padding: 24px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  width: 380px;
  text-align: center;
  margin-top: 60px
}

.login-container,
.dashboard-container {
  animation: fadeIn 0.4s ease-in-out;
}

/* Request PW reset */
#opening-line{
  color: white
}

.reset-message{
  padding-top: 10px;
  margin-top: 50px;
  color:#29e490
}

/* ---------------- Dashboard Tiles Styling ---------------- */
.dashboard-container {
  min-width: 89vw;
  max-width: 89vw;
}

.dashboard-section {
  padding-top: 10px;
  padding-bottom: 20px;
  border-top: 1px solid rgb(160, 160, 160);
  border-bottom: 1px solid rgb(160, 160, 160);
}

.farm-tiles {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding-bottom: 20px;
}

.farm-tile {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-width: 120px;
  min-height: 100px;
}

.tile-header{
  margin-bottom: 16px;
  margin-top: 4px;
  font-weight: bold;
  font-size: 19px
}

.farm-tile.green {
  background-color: #29e490;
  color: #2c5e3d;
}

.farm-tile.amber {
  background-color: #ff6e33;
  color: #ffe7de;
}

.farm-tile.darker-green {
  background: linear-gradient(135deg, #29e490, #ff6e33);
  color: #deede4;
}

.farm-tile.red {
  background-color: #dc3545;
  color: rgb(255, 221, 221);
}

.farm-tile.grey {
  background-color: #7b7b7b;
  color: #c6c6c6;
}

.farm-tile-p {
  font-weight: 400;
  font-size: 13px;
  margin: 0
}

.farm-tile-highlighted{
  font-size: 13px;
  margin: 0;
  padding: 5px;
  font-weight: bold;
}

/* ---------------- Dashboard Window ---------------- */
#dashboard {
  margin-top: 20px;
  padding: 15px;
  background: #222222;
  border: 1px solid #ddd;
  border: none;
  border-radius: 7px;
  display: none;
}

.dashboard-flex {
  display: flex;
  gap: 20px;
}

#dashboard-title{
  margin-top: 10px
}

.dashboard-table-container {
  flex: 2;
  min-width: 300px;
  background: #2b2b2b;
  padding: 12px;
  border-radius: 7px;
}

.dashboard-chart-container {
  flex: 5;
  flex-direction: column;
  min-width: 600px;
  padding:0;
}

/* ---------------- Download CSV area ---------------- */
.download-controls {
    border-radius: 7px;
    padding: 20px;
    margin-top: 20px;
    background-color: #2b2b2b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.download-controls h3 {
    margin-top: 0;
    color: #e3e3e3;
}

.download-controls label {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    color: #d6d6d6;
}

.download-controls select,
.download-controls input[type="date"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
}

/* ---------------- Alerts Section ---------------- */
.alerts-toggle {
  margin-bottom: 16px;
}

.alerts-toggle-btn {
  background-color: #3b3b3b;
  color: #ccc;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
  width: 150px
}

.alerts-toggle-btn:hover,
.alerts-toggle-btn.active {
  background-color: #c1c1c1;
  color: #393939;
}

#alerts-p{
  font-style: italic
}


/* ---------------- Power Section with dial ---------------- */
.power-section{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  border-radius: 7px;
  border: 2px solid #444;
  padding-top: 20px;
  padding-bottom: 0px
}

.power-header{
  margin: 0;
  font-size: 14px
}


/* ---------------- Charts selector ---------------- */
.selector-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px; 
  padding: 10px;
  background-color: #333; 
  border-radius: 7px;
  border: 1px solid #444;
  margin-bottom: 15px
}

.charts-selector {
  display: flex;
  gap: 8px;
}


/* ---------------- Dashboard chart controls ---------------- */
.dashboard-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px; 
  padding: 10px;
  background-color: #333; 
  border-radius: 7px;
  border: 1px solid #444;
  margin-bottom: 15px
}

.dashboard-controls label {
  font-size: 14px;
  color: #ccc; 
  margin-right: 8px; 
}

.dashboard-controls select {
  padding: 5px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #444;
  background-color: #222;
  color: #fff;
  transition: background-color 0.3s ease;
}

.dashboard-controls select:focus {
  background-color: #555;
  outline: none;
}

.dashboard-controls button {
  color: rgb(58, 58, 58);
  font-size: 14px;
  border: none;
}

/* ---------------- Tile Key ---------------- */
#key{
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 15px;
  padding-bottom: 15px;
  border-top: 1px solid rgb(51, 51, 51);
  border-bottom: 1px solid rgb(51, 51, 51);
}

#key ul {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 0;
  gap: 28px;
}

#key li {
  display: flex;
  align-items: center;
  gap: 8px; 
  color: white;
  font-size: 16px;
}

.key-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.key-amber {
  background-color: #ff6e33;
}

.key-grey {
  background-color: #7b7b7b;
}

.key-green {
  background-color: #29e490;
}

.key-red {
  background-color: #dc3545;
}

/* ---------------- Performance ---------------- */
.farm-header {
  display: flex;
  align-items: center; 
  justify-content: space-between; 
  border-top: 1px solid rgb(160, 160, 160);
  border-bottom: 1px solid rgb(160, 160, 160);
}

#farm-dropdown{
  padding: 5px 20px;
  font-size: 19px;
  border-radius: 5px;
  border: 1px solid #444;
  background-color: #8d8d8d;
  color: #fff;
  transition: background-color 0.3s ease;
}

#category-removal-dropdown-wrapper{
  padding: 10px;
  display: flex; 
  align-items: center; 
  gap: 10px;
}

.dropdown-row{
  display:flex;
  gap: 20px
}

#pvsyst-status-message{
  padding-top: 15px
}

.dashboard-container {
    padding: 20px;
    font-family: Arial, sans-serif;
}

.farm-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

/* ---- Spinner */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #26bf7a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-text {
  color: #26bf7a;
}

.dropdown-status {
    align-items: center;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
}

.dropdown-status.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.dropdown-status.hidden {
    display: none;
}


/* ---- Performance Coverage Progress Bar  */
.coverage-progress-cell {
  min-width: 240px;
}

.coverage-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coverage-progress-bar {
  flex: 1;
  height: 8px;
  background: #f2f2f2;
  border-radius: 999px;
  overflow: hidden;
}

.coverage-progress-fill {
  height: 100%;
  background: #29e490;
}

.coverage-progress-label {
  font-variant-numeric: tabular-nums;
}

/* ---------- Events Management ---------- */
#events-dashboard {
  background-color: #2b2b2b;
  padding: 16px;
  color: rgb(226, 226, 226);
  height: 44vh;
  overflow-x:hidden;
}

.data-download-container{
  background-color: #2b2b2b;
  padding: 16px;
  color: rgb(226, 226, 226);
  height: 30px;

  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
}

/* Pagination */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2b2b2b;
  padding: 10px 14px;
  border-top: 1px solid #444;
  border-radius: 0 0 7px 7px;
}

.pagination-info {
  color: #aaa;
  font-size: 13px;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* Events filter Container */
.events-filter-container {
  background-color: #333;
  border-radius: 7px;
  border: 1px solid #444;
  margin-top: 5px;
  margin-bottom: 15px;
  padding: 2px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

/* Labels and Inputs */
.events-filter-container label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
}

.columns-dropdown-container {
  position: relative;
  display: flex;
  flex-direction: row;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  gap: 5px
}

/* Data download section */
.data-download-container {
  display: flex;
  align-items: center; 
  padding-bottom: 10px;
  gap: 8px;
}

/* Push buttons to the right */
.data-download-container .spacer {
  flex-grow: 1; 
}


/* ----------- Event Details ------------ */
.event-detail-container {
  min-width: 89vw;
  max-width: 89vw;
  --primary-teal: #26bf7a;
  --surface-dark: #2b2b2b;
  --surface-light: #2b2b2b;;
  --border-light: #555;
  --text-primary: #f5f5f7;
  --radius-lg: 14px;
  --radius-md: 8px;
  --transition: 0.25s ease;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.25);

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  color: var(--text-primary);
  background-color: transparent; 
  line-height: 1.5;
}

#events-detail-wrapper {
  background-color: #2b2b2b;
  border-radius: 7px;
  padding: 16px;
  color: rgb(226, 226, 226);
  height: 300px;
  overflow-y: auto;
}

.section-wrapper{
  background-color: #2b2b2b;
  border-radius: 7px;
  padding: 20px;
  padding-top: 12px;
  margin-top: 18px
}


/* ---------- Event Detail Comments Section ---------- */
.event-comments-wrapper {
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #2b2b2b;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.comments-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.comment-actions .comment-btn {
    padding: 4px 8px;
    font-size: 0.3rem;
}


/* Add Comment Section */
.add-comment-section {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 15px;
  background-color: rgb(58, 58, 58);
}

.add-comment-section.hidden {
  display: none;
}

.comment-type-wrapper{
  margin-top: 5px;
  margin-bottom: 15px;
}

/* Button */
.add-comment-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
/* #endregion */

@media (max-width: 1500px) {
  .dashboard-container{
    width: 90vw
  }
}

@media (max-width: 1450px) {
  .dashboard-container{
    width: 92vw
  }
}

@media (max-width: 1400px) {
  .dashboard-container{
    width: 94vw
  }
}

@media (max-width: 1350px) {
  .dashboard-container{
    width: 96vw
  }
}

@media (max-width: 1300px) {
  .dashboard-container{
    width: 98vw
  }
}

@media (max-width: 1150px) {
  .dashboard-container{
    width: 96%;
    padding: 20px
  }

  /* Login Container */
  .login-container {
    width: 80vw;
  }

  /* Dashboards charts container */
  .dashboard-flex {
    flex-direction: column;
  }
  .dashboard-table-container,
  .dashboard-chart-container {
    max-width: 90vw;
    align-items: center;
    min-width: 200px;
  }

  /* Controls */
  .dashboard-controls{
    flex-direction: column;
  }

  /* Farm Tiles */
  .farm-tile {
    min-height: 100px;
    max-height: 100px;
    min-width: 100px;
    max-width: 100px;
    padding: 15px
  }

  .farm-tiles {
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  .farm-tile-p {
    font-size: 12px;
  }
  .farm-tile-highlighted{
    font-size: 12px;
  }

  /* Key */
  #key li {
    font-size: 13px;
    padding-left: 10px;
    padding-right: 10px
  }

  /* Events Mgt */
  .events-filter-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center; 
    width: 98.4%;
    padding: 8px;
  }
}

@media (max-width: 980px) and (min-width: 700px) {
    /* click to see mopre info on what the performance metrics are */
    #metrics-info-trigger .full-text {
        display: none;
    }
    #metrics-info-trigger .short-text {
        display: inline;
    }
}

@media (max-width: 768px) {
  .farm-tile {
    min-height: 80px;
    max-height: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 10px
  }
  .farm-tile-p {
    font-size: 11px;
    margin-top: 0px
  }
  .farm-tile-highlighted{
    font-size: 11px;
  }
  .tile-header{
    font-size: 14px;
    margin-bottom: 4px;
  }

  #active-farm-appear {                 
  top: 22%;
  }
  #select-device {
    margin-bottom: 40px
  }
  #show-all-lines{
    font-size: 11px;
    align-self: flex-start;
    width: 100px;
    margin-top: -40px
  }
}

@media (max-width: 700px) {
  .dashboard-container {
    width: 92%
  }

  .grid-container {
    flex-direction: column;
    height: auto !important
  }
}

@media (max-width: 560px) {
  .dashboard-container{
    width: 92%
  }
}

@media (max-width: 478px) {
  .dashboard-container {
    max-width: 84vw;
  }
  #key{
    gap: 5px;
  }

  #key li {
    font-size: 11px;
    padding-left: 5px;
    padding-right: 5px
  }
}



/* =========================================================
   CHART STYLES
   ========================================================= */
/* #region CHART STYLES ALL */
/* ---------------- Timeseries Charts ---------------- */
.timeseries-chart {
  width: 100%;
  height: 350px;
  margin-bottom: 20px;
  border-radius: 7px
}

#string-current-chart {
  height: 500px;
  border-radius: 7px;
  background-color: rgb(43,43,43);
  margin-bottom: 20px;
}
.chart-empty {
  height: auto !important;
  min-height: 70px;
}

#voltage-chart {
  margin-bottom: 0px;
}

#difference-chart{
  margin-bottom: 20px;
  border-radius: 8px;
}


/* ---------------- Historic Charts ---------------- */
.energy-section {
  background: rgb(43, 43, 43);
  padding: 19px;
  padding-top: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  max-width: 100%;
  margin-top: 15px;
  display: none;
  border-radius: 7px;
}

#gen-en-header{
  font-size: 20px;
  font-weight: bold;
}

.energy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.range-selector {
  display: flex;
  gap: 8px;
}

.history-chart {
  height: 280px;
  width: 100%;
}

/* ---------------- String Current Charts ---------------- */
#string-current-title{
  padding-left: 13px;
  padding-top: 25px
}
#string-current-chart-wrapper{
  background-color: rgb(43,43,43);
  border-radius: 7px;
}
.string-selector {
  display: none;
  gap: 8px;
  margin-left: 13px
}

#select-device {
  max-width: 300px;
  position: relative;
}

#show-all-lines{
  align-self: flex-end;
  justify-content: center;
  margin-bottom: 8px;
  margin-right: 18px;
  top: 100;
  right: 200;
  background-color: #444;
  width: 120px;
  overflow-y: auto;
  color: rgb(201, 201, 201);
  position: absolute;
  z-index: 9;
  padding: 7px
}

#string-detail-chart-wrapper {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

#string-detail-chart {
  flex-grow: 1;
  width: 100%;
  height: 100%;
}

#device-list {
  position: absolute;
  top: 60px; 
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  z-index: 1001;
  display: none; 
  list-style: none;
  padding: 0;
  margin: 0;
}

#device-list li:hover {
  background-color: #333;
}

/* ---------------- Tracker Charts ---------------- */
#tracker-chart-wrapper {
  background-color: #2b2b2b;
  padding: 20px;
  margin-top: 20px
}

#tracker-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #646464;
    border-radius: 8px;
    background-color: #2a2a2a;
    justify-content: flex-start;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: #1f1f1f;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 160px;
    flex: 1 1 auto;
    transition: all 0.2s ease;
}

.control-group label {
    color: #E3E3E3;
    font-weight: 500;
    font-size: 13px;
}

.control-group input[type="datetime-local"],
.control-group select {
    background-color: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 0px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    min-width: 120px;
}

.control-group input[type="datetime-local"]:focus,
.control-group select:focus {
    outline: none;
    border-color: #489FE1;
}

.control-group:hover {
    background-color: #252525;
}

/* ---------------- Performance Charts ---------------- */
/* Top Daily Charts */
.time-period-selector-floating {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
}

.time-period-selector-floating select {
    margin-left: 5px;
}

.grid-wrapper {
    position: relative;
    width: 100%;
}

.grid-container {
    display: flex;
    gap: 15px;
    height: 70vh;
    width: 100%;
    margin-top: 20px
}

/* Left column */
#gauge-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1; 
    min-width: 0;
    background-color: #2b2b2b;
    border-radius: 7px;
}

.gauge-card {
    background-color: #2b2b2b;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    flex: 1; 
    min-height: 0;
}

.gauge-info-text{
  color: white;
  padding: 5px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 13px;
  text-align: center;
  margin-top: -25px;
}

/* Right column */
.grid-right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 2; 
    min-width: 0; 
    background-color: #2b2b2b;
    border-radius: 8px;
    overflow: hidden;
    padding: 15px;
}

.chart-background {
    background-color: #2b2b2b;
    width: 100%;
    flex: 1;        
    min-height: 0;
}

/* Performance YTD Charts */
.ytd-chart{
  height: 350px;
  padding: 15px;
  background-color: #313131; 
  border-radius: 7px
}

#ytd-availability-chart{
  height: 250px
}
/* #endregion */

@media (max-width: 1150px) {
  .timeseries-chart {
    height: 320px;
    align-items: center;
  }
  .tracker-chart {
    height: 320px;
    align-items: center;
  }
  .history-chart {
    height: 220px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .history-chart {
    height: 200px;
  }
  #string-detail-chart-wrapper {
    overflow-x: auto;
    width: 100%;
  }
  #string-detail-chart {
    height: auto !important;
    height: 665%;
  }
  #string-current-chart {
    height: 450px;
  }
  #tracker-chart{
    height: 280px
  }

  /* Performance */
  #gauge-left {
      flex: 0.4;
  }
  .grid-right-column {
      flex: 0.6;  
  }
  .ytd-chart{
    height: 250px;
  }
  #ytd-availability-chart{
    height: 200px
  }
}

@media (max-width: 700px) {
  #gauge-left {
    flex: none; 
    width: 100%;
  }

  .grid-right-column {
    flex: none; 
    width: 95%;
  }

  #gauge-left {
    flex-direction: row;   
    flex-wrap: wrap;
    gap: 10px;
  }

  .gauge-card {
    flex: 1 1 48%; 
    min-height: 150px; 
    padding: 10px;
  }

  .gauge-info-text{
    width: 100%;
    padding-top: 20px;
    padding-bottom: 15px;
    font-size: 12px
  }

  .grid-right-column {
    padding: 10px;
  }

  .chart-background {
    min-height: 250px;  
    margin-bottom: 15px;
  }

  .ytd-perc-change-chart{
    height: 250px
  }
  .ytd-availability-chart{
    height: 200px
  }
  .time-period-selector-floating {
    top: 445px;
    font-size: 10px
  }
}



/* =========================================================
   NAVIGATION STYLES
   ========================================================= */
/* #region NAVIGATION STYLES ALL */
.navbar {
  position: fixed;
  display: flex;
  justify-content: flex-end;
  top: 0;
  left: 0;
  width: 95vw;
  background: #222222;
  border: 1px solid rgb(78, 78, 78);
  border-radius: 5px;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin: 10px 30px 30px 10px;
  margin-right: 30px;
  margin-left:2.1vw;
  height: 52px;
  align-items: center;
}

#active-farm-appear {
  position: absolute; 
  left: 16px;                        
  top: 16%;
  transform: translateY(-50%);       
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 280px);
}

.navbar-menu {
  margin-right: 70px;
  padding-bottom: 2px;
}

.navbar-end {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 0;
}

.navbar-start {
  display: flex;
  align-items: center;
}

.navbar-end > li {
  position: relative;
  padding: 10px 15px;
}

.navbar-item {
  text-decoration: none;
  color: #ffffff;
  font-size: 1rem;
  display: block;
  font-weight: 500;
  text-decoration: none;
}

.navbar-item a:hover,
.navbar-item.active a {
  color: #29e490; /* same as hover */
}
/* #endregion */

@media (max-width: 1400px) {
  .navbar {
    height: 60px;
  }

  .navbar-item {
    font-size: 0.9rem;
    padding: 10px 15px;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: auto;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    justify-content: center;
    padding-left: 15px;
    width: 92vw
  }

  .navbar-menu {
    margin-right: 25px;
    display: flex;
    gap: 10px;
  }

  .navbar-item {
    font-size: 0.8rem;
    margin-right: 5px;
  }
}

@media (max-width: 700px) {
  /* Navbar */
  .navbar {
    height: auto;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    padding-left: 15px;
    width: 92vw;

    display: flex;
    justify-content: center; 
    align-items: center;   
  }

  .navbar-menu {
      display: flex;
      gap: 5px;
  }

  .navbar-item {
      font-size: 0.8rem;
      margin-right: 0;
  }
}



/* =========================================================
   MODALS & POP-UP STYLES
   ========================================================= */
/* #region MODAL STYLES ALL */
/* ----------- Alerts pop up ----------- */
.dashboard-std-popup {
  position: fixed;
  top: 50px;
  left: 50%;
  width: 40%;
  height: 60%;
  transform: translateX(-50%);
  background: #222222;
  color: white;
  border: 1px solid rgb(78, 78, 78);
  border-radius: 7px;
  font-size:14px;
  padding: 20px;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  max-width: 600px;
  overflow-y: auto;
}

.popup-table {
  width: 100%;
  border-collapse: collapse;
}

.popup-table td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
  background: #2b2b2b;
  padding: 20px;
  width: 90%;
  height: 80%;
  display: flex;
  flex-direction: column;
}


/* ----------- Performance Pop out info modal ----------- */
#metrics-info-trigger {
    position: absolute;
    top: 5px; 
    right: 5px;
    cursor: pointer; 
    color: #cacaca; 
    display: flex;
    align-items: center;
    font-size: 12px;
    font-style: italic;
    z-index: 999;
    background: rgba(0,0,0,0.2); 
    padding: 2px 5px;
    border-radius: 3px;
}

#metrics-info-trigger .short-text {
    display: none;
}

#metrics-info-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999;
}

#metrics-info-modal .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    max-width: 500px;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

#metrics-info-modal .modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}
#metrics-info-modal ul {
    list-style-type: disc;
    padding-left: 20px;
}
#metrics-info-modal li {
    margin-bottom: 12px;
}


/* ----------- Performance Info scrollover pop up ----------- */
.info-icon {
    position: relative;
    cursor: pointer;
    font-size: 18px;
}

.tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 8px;
    border-radius: 5px;
    position: absolute;
    z-index: 1000;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
}

.info-icon:hover .tooltip-text {
    visibility: visible;
}
/* #endregion */

@media (max-width: 768px) {
  .dashboard-std-popup {
    max-width: 80vw;
    min-width: 80vw;
  }
  #string-detail-modal {
    flex-direction: column;
    padding: 10px;
    width: 95%;
    height: 90%;
    overflow-y: auto;
  }
  #modal-div {
    height: 70%;
  }
  .modal-content {
    width: 95%;
    padding: 10px;
  }
}

@media (max-width: 700px) {
  #metrics-info-modal .modal-content {
      width: 320px;
      font-size: 14px;
  }
}


