/* ================================================
   Universal Popup Close Button Style
   ================================================ */
.popup-close-btn,
.closePopupX,
.closePopup,
.health-dashboard-close {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: #fff !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 16px !important;
    background-image: none !important;
}

.popup-close-btn:hover,
.closePopupX:hover,
.closePopup:hover,
.health-dashboard-close:hover {
    background: rgba(244, 67, 54, 0.3) !important;
    transform: rotate(90deg) !important;
}

.popup-close-btn:focus,
.closePopupX:focus,
.closePopup:focus,
.health-dashboard-close:focus {
    outline: none;
}

/* Ensure icon is visible */
.popup-close-btn i,
.closePopupX i,
.closePopup i,
.health-dashboard-close i {
    font-size: 16px;
    line-height: 1;
}

/* For buttons without icons, add an X via content */
.closePopupX:empty::after,
.closePopup:empty::after {
    content: "\f00d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 16px;
}

/* ================================================ */

#backToStart {
    position: absolute;
    top: 9px;
    left: 10px;
    z-index: 100;
    width: 150px;
    display: none;
}
#mainContainer {
    position: absolute;
    /*display:none;*/
    z-index: 121;
    top: 60px;
    left: 0;
    right:0;
    bottom: 0;
}
.mainPart {
    position: relative;
    height: 100%;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
}

.mainPartcollapsed {
    position: relative;
    height: calc(100% - 500px);
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.5s ease-in-out;
}
.bottomPart {
    position: relative;
    padding: 0px 0px 5px 0px;
    margin-bottom: 5px;
    transition: all 0.5s ease-in-out;
    height: 495px;
}
.bottomPartCollapsed {
    position: relative;
    padding: 0px 0px 5px 0px;
    margin-bottom: 5px;
    transition: all 0.5s ease-in-out;
    height: 60px;
}
.chatArrow {
    border: solid var(--text-color);
    border-width: 0 4px 4px 0;
    display: inline-block;
    padding: 5px;
    transition: transform 0.4s, top 0.4s;
    position: absolute;
    right: 15px;
    top: 20px;
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
}
.selected > * > .chatArrow {
    border-color: var(--selected-text-color);
}
.bottomPart > * > .chatArrow {
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    top: 14px;
}

.chatWindow {
    opacity: 1;
    transition: all 0.5s ease-in-out;
    margin: 5px;
    height: 400px;
}
.chatWindowcollapsed{
    opacity: 0;
    transition: all 0.5s ease-in-out;
    margin: 5px;
    height: 0px;
}
.chat {
    flex-grow: 1;
    text-align: center;
    height: 50px;
    margin: 5px;
}
.chat.selected {
    background: var(--medium-light-color);
    color: var(--selected-text-color);
}

.tab {
    flex-grow: 1;
    text-align: center;
    height: 50px;
    margin: 5px;
}
.tab.selected {
    background: var(--medium-light-color);
    color: var(--selected-text-color);
}
.topPart  {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: var(--gradient-dark);
}
.topTabs, .bottomTabs {
    display: flex;
    align-items: center;
}
#refreshDataIcon {
    flex-grow: 0;
    line-height: 50px;
    margin: 5px;
}
#refreshDataIcon img {
    width: 32px;
    transition: transform 0.4s;
}
#refreshDataIcon:hover img {
    transform: rotate(45deg);
}

#uiContainer {
    position: relative;
    background: var(--gradient-dark);
    overflow: visible;
    z-index: 10001;
    max-width: 80px;
    flex: 0 0 80px;
}
#unityViewContainer {
    padding: 0px;
    position: relative;
    height: calc(100% - 100px) !important;
    flex: 1;
    max-width: calc(100% - 80px);
}
#unityContainer {
    height: calc(100vh - 100px);
    background-color: transparent !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
#unityContainer #webContainer {
    border: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overflow-y: visible;
}
#unityContainer.hovering canvas {
    cursor: pointer !important;
}
#webContainer {
    width: 100%;
    height: 100%;
}

#sideBar {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: var(--popup-gradient);
}
#sideBar .applicationTitle {
    padding: 20px 20px 0;
}

.lowerTab {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.5s linear;
    padding: 20px;
    font-size: 14px;
    overflow: auto;
}
.internalContent {
    width: 100%;
    height: 100%;
}
.lowerTab.selected {
    visibility: visible;
    opacity: 1;
}

.subsystem.selected > .dataTitle {
    background-color: var(--dark-color);
    color: var(--selected-text-color);
}
.subsystem.disabled {
    pointer-events: none;
    background-color: var(--disabled-color);
}
.sliderHidden {
    padding-left: 30px;
    display: none;
    padding-top: 5px;
    margin-bottom: 30px;
}

.sliderHidden > .dataLabel:first-child {
    border-top-left-radius: 5px;
    border-top-right-radius: 0;
}
.sliderHidden > .dataLabel:last-child {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 5px;
}

.dataValue {
    color: white;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.dataLabel {
    text-align: left;
    font-weight: normal;
    text-transform: capitalize;
    padding: 8px 10px;
    color: var(--text-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    overflow: hidden;
}
.sliderHidden > div:first-child .dataTitle {
    margin-top: 0;
}

.dataTitle {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    margin-top: 5px;
    line-height: 17px;
    min-height: 50px;
    padding: 8px 35px 8px 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-weight: 500;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.03);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.dataTitle.status {
    border-left: 4px solid var(--text-color);
    color: var(--text-color) !important;
}
.dataTitle:hover {  
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--selected-text-color);
    background-color: rgba(255, 255, 255, 0.2);
}
.dataArrow {
    border: solid var(--text-color);
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 4px;
    transition: transform 0.4s, top 0.4s;
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -5px;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
}
.selected > * > .dataArrow {
    border-color: var(--selected-text-color);
}
.overallDataLabel {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.overallDataValue {
    color: var(--color-green);
    white-space: nowrap;
}
.dataHolder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 5px;
    padding: 6px 10px;
}
.dataElement {
    font-size: 11px;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 2px;
    padding: 3px 6px;
    flex-wrap: wrap;
}
.sliderOpen > * > .dataArrow {
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
    margin-top: -2px;
}
.singleUnitPopup {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.elementStatsTab {
    position: relative;
}

#viewContainerHeader {
    height: 100px;
    min-height: 100px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

#elementOperationStatus {
    position: absolute;
    bottom: 0;
    right: 0;

    font-size: 18px;
    line-height: 30px;
}
#subsystemDescriptionContainer {
    text-align: center;
    font-size: 14px;
    flex-grow: 1;
    justify-content: start;
    margin: 10px 200px;
    height: 80px;
    max-height: 80px;
    padding: 0;
}

#subsystemDescriptionContainer > div {
    margin: auto;
    overflow: auto;
    padding: 10px 20px;
}



#elementInfo {
    position: absolute;
    font-size: 14px;
    text-align: right;
    left: 0;
    bottom: 60px;
}

#elementInfo > div {
    font-weight: bold;
    height: 32px;
}
#elementInfo > div > span {
    font-weight: normal;
}
#elementInfo img {
    height: 32px;
    width: 32px;
    margin-left: 10px;
}

.status::after {
    font: var(--fa-font-solid);
    margin-left: 5px;
}
.status {
    font-weight: bold !important;
}
.status[data-status="green"] {
    color: var(--color-green);
    border-left-color: var(--color-green);    
}

.status[data-status="green"]::after {
    content: '\f058';
}

.status[data-status="yellow"] {
    color: var(--color-yellow);
    border-left-color: var(--color-yellow);
}
.status[data-status="yellow"]::after {
    content: '\f056';
}
.status[data-status="red"] {
    color: var(--color-red);
    border-left-color: var(--color-red);
}
.status[data-status="red"]::after {
    content: '\f057';
}

.issues::after, .warnings::before {
    position: absolute;
    top: 5px;
    height: 24px;
    width: 24px;
    line-height: 24px;
    text-align: center;
    color: var(--dark-color);
    font-weight: bold;
    font-size: 12px;
    border-radius: 4px;
}

.issues::after {
    content: attr(data-issueCount);
    right: 35px;
    background: var(--color-red);
}
.warnings::before {
    content: attr(data-warningCount);
    right: 63px;
    background: var(--color-yellow);
    z-index: 2;
}
.slider.issues,
.slider.warnings {
    position: relative;
}
/* Make room for warning/issue badges in title */
.slider.warnings > .dataTitle,
.slider.issues > .dataTitle {
    padding-right: 95px;
}


.docLine::after {
    content:'\f15b';
}
.procedureLine::after {
    content:'\f144';
}
.webLine::after {
    content:'\f0ac';
}

.tabLine {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 0 10px 0 35px;
    background: var(--light-shadow);
    cursor: pointer;
    line-height: 15px;
    height: 50px;
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 5px;
    color: var(--text-color);
}
.tabLine:hover {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--selected-text-color);
    background-color: rgba(255, 255, 255, 0.2);
}

a.tabLine {
    text-decoration: none;
}
.tabLine::after {
    font: var(--fa-font-solid);
    position: absolute;
    left: 0;
    width: 35px;
    text-align: center;
}


#cameraNavigationButtons {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
}

#objectHover {
    position: fixed;
    z-index: 150;
    padding: 5px 10px;
    display: none;
    margin-top: -50px;
    pointer-events: none;
    font-size: 20px;
    font-weight: normal !important;
    text-transform: none;
}

#objectHover span {
    font-size: 16px;
    font-weight: bold;
}

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

.operationalParameter {
    font-weight: bold;
    flex-grow: 0;
}

.operationalValueDiv {
    flex-grow: 1;
    text-align: right;
}

#configurationTab .dataLabel {
    text-indent: -5px;
    padding: 10px 0 10px 10px;
}
.configInput {
    margin-right: 10px;
}
.configLabel {
    position: relative;
    width: calc(100% - 50px);
}
.configSpan {
    min-width: 100%;
    position: relative;
    display: flex;
    height: 20px;
    line-height: 20px;
}

.configSpan .dataArrow{
    top: -3px;
}
.sliderOpen > .configSpan > .dataArrow{
    top: 7px;
}

.historyIcon {
    position: absolute;
    right: 10px;
    top: 13px;
    cursor: pointer;
}
#popupHistory {
    z-index: 999;
}

#popupHistory .popupInner  {
    position: relative;
    padding: 25px;
    min-width: 450px;
}

/* History popup close button uses universal style from top of file */
#popupHistory .closePopupX {
    top: 15px;
    right: 15px;
    z-index: 20; /* Ensure above header content */
}
#historicalValueName {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

#historicalValues {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom scrollbar for history values */
#historicalValues::-webkit-scrollbar {
    width: 6px;
}

#historicalValues::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

#historicalValues::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

#historicalValues::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* History Popup Tabs */
.history-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.history-tab {
    flex: 1;
    padding: 8px 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.history-tab:hover {
    background: rgba(255,255,255,0.1);
}

.history-tab.active {
    background: var(--medium-light-color);
    color: var(--selected-text-color);
    border-color: var(--medium-light-color);
}

.history-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.history-tab.disabled:hover {
    background: rgba(255,255,255,0.05);
}

.history-tab-content {
    display: none;
}

.history-tab-content.active {
    display: block;
}

#historyGraphCanvas {
    width: 100%;
    height: 280px;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
}

/* History Popup Header */
.history-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-right: 50px; /* Leave space for close button */
}

/* Inventory Badge */
.inventory-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.inventory-badge.in-stock {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
    color: #4CAF50;
}

.inventory-badge.low-stock {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #FF9800;
    color: #FF9800;
}

.inventory-badge.out-of-stock {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #F44336;
    color: #F44336;
}

.badge-icon {
    font-size: 16px;
}

.badge-qty {
    opacity: 0.8;
    font-size: 11px;
}

/* Prediction Tab Styles */
#predictionContent {
    padding: 10px 0;
}

.prediction-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.prediction-health {
    flex-shrink: 0;
}

.health-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        #4CAF50 0deg,
        #4CAF50 var(--health-angle, 270deg),
        rgba(255,255,255,0.1) var(--health-angle, 270deg)
        );
    position: relative;
}

.health-circle::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-dark);
}

.health-value {
    position: relative;
    z-index: 1;
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
}

.health-label {
    position: relative;
    z-index: 1;
    font-size: 10px;
    color: #aaa;
}

.prediction-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prediction-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.prediction-label {
    color: #888;
    font-size: 13px;
}

.prediction-value {
    font-weight: bold;
    font-size: 13px;
}

.prediction-value.warning {
    color: #FF9800;
}

.prediction-value.critical {
    color: #F44336;
}

.prediction-recommendation {
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #FF9800;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 0 5px 5px 0;
}

.prediction-recommendation h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #FF9800;
}

.prediction-recommendation p {
    margin: 0;
    font-size: 13px;
    color: #ccc;
}

.prediction-inventory {
    background: rgba(0,0,0,0.2);
    padding: 12px 15px;
    border-radius: 5px;
}

.prediction-inventory h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #aaa;
}

/* Correlation Tab Styles */
#correlationContent {
    padding: 10px 0;
}

.correlation-header {
    margin-bottom: 15px;
}

.correlation-header h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #fff;
}

.correlation-subtitle {
    margin: 0;
    font-size: 12px;
    color: #888;
}

#correlationCanvas {
    width: 100%;
    height: 180px;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
    margin-bottom: 15px;
}

.correlation-insight {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.insight-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
}

.insight-icon {
    font-size: 20px;
}

.insight-text {
    font-size: 12px;
    line-height: 1.4;
}

.insight-text strong {
    display: block;
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
}

.comparison-table {
    margin-top: 15px;
}

.comparison-table h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #aaa;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.comparison-table th,
.comparison-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.comparison-table th {
    color: #888;
    font-weight: normal;
    text-transform: uppercase;
    font-size: 10px;
}

.comparison-table td {
    color: #ccc;
}

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

.variance-positive {
    color: #4CAF50;
}

.variance-negative {
    color: #F44336;
}

/* ===== SYSTEM REPORT STYLES ===== */

/* System Report Button - matches "Back to Overview" style */
.btn-system-report {
    display: none;
    line-height: 20px;
    border-radius: 5px 0 5px 0;
    background-color: var(--medium-dark-color-alpha);
    background-image: url(../images/pattern.png);
    background-position: center center;
    background-size: 80px;
    color: var(--text-color);
    text-transform: uppercase;
    font-weight: bold;
    position: relative;
    padding: 10px;
    cursor: pointer;
    font-family: "Big Shoulders", sans-serif;
    font-size: 18px;
    border: none;
    margin-left: 10px;
    margin-top: 9px;
    transition: all 0.3s ease;
}

.btn-system-report:before, .btn-system-report:after {
    content: "";
    position: absolute;
    width: 30%;
    height: 30%;
    border: 2px solid var(--text-color);
    border-radius: 2px;
    pointer-events: none;
}

.btn-system-report:before {
    bottom: -2px;
    left: -2px;
    border-top: none;
    border-right: none;
}

.btn-system-report:after {
    top: -2px;
    right: -2px;
    border-bottom: none;
    border-left: none;
}

.btn-system-report:hover {
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--selected-text-color);
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-system-report.visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Health Dashboard Button - matches "Back to Overview" style */
.btn-health-dashboard {
    display: none;
    line-height: 20px;
    border-radius: 5px 0 5px 0;
    background-color: var(--medium-dark-color-alpha);
    background-image: url(../images/pattern.png);
    background-position: center center;
    background-size: 80px;
    color: var(--text-color);
    text-transform: uppercase;
    font-weight: bold;
    position: relative;
    padding: 10px;
    cursor: pointer;
    font-family: "Big Shoulders", sans-serif;
    font-size: 18px;
    border: none;
    margin-left: 10px;
    margin-top: 9px;
    transition: all 0.3s ease;
}

.btn-health-dashboard:before, .btn-health-dashboard:after {
    content: "";
    position: absolute;
    width: 30%;
    height: 30%;
    border: 2px solid var(--text-color);
    border-radius: 2px;
    pointer-events: none;
}

.btn-health-dashboard:before {
    bottom: -2px;
    left: -2px;
    border-top: none;
    border-right: none;
}

.btn-health-dashboard:after {
    top: -2px;
    right: -2px;
    border-bottom: none;
    border-left: none;
}

.btn-health-dashboard:hover {
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--selected-text-color);
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-health-dashboard.visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Health-based button colors - green to red based on health percentage */
.btn-health-dashboard.healthy {
    background-color: rgba(76, 175, 80, 0.4) !important;
    background-image: linear-gradient(135deg, rgba(76, 175, 80, 0.5) 0%, rgba(46, 125, 50, 0.4) 100%), url(../images/pattern.png) !important;
    border-color: rgba(76, 175, 80, 0.5);
}

.btn-health-dashboard.healthy:hover {
    background-color: rgba(76, 175, 80, 0.6) !important;
}

.btn-health-dashboard.warning {
    background-color: rgba(255, 152, 0, 0.4) !important;
    background-image: linear-gradient(135deg, rgba(255, 152, 0, 0.5) 0%, rgba(230, 126, 0, 0.4) 100%), url(../images/pattern.png) !important;
    border-color: rgba(255, 152, 0, 0.5);
}

.btn-health-dashboard.warning:hover {
    background-color: rgba(255, 152, 0, 0.6) !important;
}

.btn-health-dashboard.critical {
    background-color: rgba(244, 67, 54, 0.4) !important;
    background-image: linear-gradient(135deg, rgba(244, 67, 54, 0.5) 0%, rgba(200, 40, 30, 0.4) 100%), url(../images/pattern.png) !important;
    border-color: rgba(244, 67, 54, 0.5);
    animation: criticalPulse 1.5s infinite;
}

.btn-health-dashboard.critical:hover {
    background-color: rgba(244, 67, 54, 0.6) !important;
}

@keyframes criticalPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 10px 2px rgba(244, 67, 54, 0.3);
    }
}

.btn-health-dashboard i {
    font-size: 16px;
}

/* Health Dashboard Popup */
.health-dashboard-popup {
    display: none;
    position: fixed;
    top: 70px;
    right: 20px;
    width: 320px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9000;
    overflow: hidden;
}

.health-dashboard-popup.open {
    display: block;
    animation: slideInHealth 0.3s ease;
}

@keyframes slideInHealth {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.health-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(46, 125, 50, 0.2));
    border-bottom: 1px solid rgba(76, 175, 80, 0.3);
}

.health-dashboard-header h4 {
    margin: 0;
    color: #81C784;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Health dashboard close button uses universal style from top of file */
/* Position adjustment for health dashboard header */
.health-dashboard-header .health-dashboard-close {
    position: relative;
    top: auto;
    right: auto;
    margin-left: auto;
}

.health-dashboard-content {
    padding: 16px;
}

.overall-health {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.health-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.health-ring svg {
    transform: rotate(-90deg);
}

.health-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.health-ring-progress {
    fill: none;
    stroke: #4CAF50;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
}

.health-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.overall-health-label {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.component-health-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.health-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #888;
}

.component-health-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.component-health-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.component-health-item.healthy {
    border-left: 3px solid #4CAF50;
}

.component-health-item.warning {
    border-left: 3px solid #FF9800;
}

.component-health-item.critical {
    border-left: 3px solid #F44336;
    animation: itemCriticalPulse 1.5s infinite;
}

@keyframes itemCriticalPulse {
    0%, 100% {
        background: rgba(244, 67, 54, 0.05);
    }
    50% {
        background: rgba(244, 67, 54, 0.15);
    }
}

.comp-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #aaa;
    font-size: 12px;
}

.component-health-item.healthy .comp-icon {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

.component-health-item.warning .comp-icon {
    color: #FF9800;
    background: rgba(255, 152, 0, 0.15);
}

.component-health-item.critical .comp-icon {
    color: #F44336;
    background: rgba(244, 67, 54, 0.15);
}

.comp-name {
    flex: 1;
    font-size: 13px;
    color: #e0e0e0;
}

.comp-health {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    min-width: 40px;
    text-align: right;
}

.comp-trend {
    width: 20px;
    text-align: center;
    font-size: 10px;
    color: #888;
}

.comp-trend.trend-up {
    color: #4CAF50;
}

.comp-trend.trend-down {
    color: #F44336;
}

/* Maintenance History Button - matches "Back to Overview" style */
.btn-maintenance-history {
    display: none;
    line-height: 20px;
    border-radius: 5px 0 5px 0;
    background-color: var(--medium-dark-color-alpha);
    background-image: url(../images/pattern.png);
    background-position: center center;
    background-size: 80px;
    color: var(--text-color);
    text-transform: uppercase;
    font-weight: bold;
    position: relative;
    padding: 10px;
    cursor: pointer;
    font-family: "Big Shoulders", sans-serif;
    font-size: 18px;
    border: none;
    margin-left: 10px;
    margin-top: 9px;
    transition: all 0.3s ease;
}

.btn-maintenance-history:before, .btn-maintenance-history:after {
    content: "";
    position: absolute;
    width: 30%;
    height: 30%;
    border: 2px solid var(--text-color);
    border-radius: 2px;
    pointer-events: none;
}

.btn-maintenance-history:before {
    bottom: -2px;
    left: -2px;
    border-top: none;
    border-right: none;
}

.btn-maintenance-history:after {
    top: -2px;
    right: -2px;
    border-bottom: none;
    border-left: none;
}

.btn-maintenance-history:hover {
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--selected-text-color);
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-maintenance-history.visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Maintenance History Popup */
.maintenance-history-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.maintenance-history-popup.show {
    display: flex;
}

.maintenance-history-popup .popupBackgroundX {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.maintenance-history-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.maintenance-history-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(121, 85, 72, 0.3), rgba(93, 64, 55, 0.3));
    border-bottom: 1px solid rgba(121, 85, 72, 0.4);
}

.maintenance-history-header h3 {
    margin: 0;
    color: #A1887F;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.maintenance-summary {
    display: flex;
    gap: 24px;
    margin-left: auto;
    margin-right: 20px;
}

/* Maintenance history close button uses universal style from top of file */
/* Position adjustment for maintenance header */
.maintenance-history-header .closePopupX {
    position: relative;
    top: auto;
    right: auto;
}

.maint-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.maint-summary-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

.maint-summary-value {
    font-size: 16px;
    font-weight: 600;
    color: #A1887F;
}

.maintenance-history-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.maintenance-loading,
.maintenance-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #888;
    font-size: 14px;
}

.maintenance-empty i {
    font-size: 24px;
    color: #4CAF50;
}

/* Timeline Styles */
.timeline-wrapper {
    position: relative;
    padding-left: 30px;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #795548, #5D4037);
}

.timeline-item {
    position: relative;
    padding: 12px 12px 12px 16px;
    margin-bottom: 10px;
    margin-left: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.timeline-item:hover {
    background: rgba(121, 85, 72, 0.1);
    border-color: rgba(121, 85, 72, 0.3);
    border-left-color: rgba(121, 85, 72, 0.6);
}

.timeline-item.recent {
    border-color: rgba(76, 175, 80, 0.3);
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 12px;
    width: 20px;
    height: 20px;
    background: #795548;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.timeline-item.recent .timeline-marker {
    background: #4CAF50;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-date {
    font-size: 11px;
    color: #888;
}

.timeline-equipment {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.timeline-sensor {
    font-size: 11px;
    color: #aaa;
}

.timeline-mtbf {
    font-size: 11px;
    color: #A1887F;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Manual maintenance record styles */
.timeline-item.manual-record .timeline-marker {
    background: #1976D2;
}

.timeline-description {
    font-size: 12px;
    color: #bbb;
    margin-top: 4px;
    line-height: 1.5;
    padding: 6px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-technician,
.timeline-workorder,
.timeline-parts {
    font-size: 11px;
    color: #90A4AE;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.timeline-technician i,
.timeline-workorder i,
.timeline-parts i {
    color: #78909C;
    font-size: 10px;
}

.timeline-detected {
    font-size: 10px;
    color: #7E57C2;
    font-style: italic;
}

.timeline-detected i {
    margin-right: 3px;
}

/* Event Type Badges */
.timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.timeline-type-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-type-badge.type-replacement {
    background: rgba(244, 67, 54, 0.2);
    color: #EF5350;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.timeline-type-badge.type-repair {
    background: rgba(255, 152, 0, 0.2);
    color: #FFB74D;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.timeline-type-badge.type-inspection {
    background: rgba(33, 150, 243, 0.2);
    color: #64B5F6;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.timeline-type-badge.type-calibration {
    background: rgba(156, 39, 176, 0.2);
    color: #BA68C8;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.timeline-type-badge.type-upgrade {
    background: rgba(76, 175, 80, 0.2);
    color: #81C784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.timeline-type-badge.type-incident {
    background: rgba(255, 87, 34, 0.2);
    color: #FF8A65;
    border: 1px solid rgba(255, 87, 34, 0.3);
}

.timeline-type-badge.type-maintenance {
    background: rgba(121, 85, 72, 0.2);
    color: #A1887F;
    border: 1px solid rgba(121, 85, 72, 0.3);
}

/* Event type marker colors */
.timeline-item.event-type-replacement .timeline-marker {
    background: #F44336;
}

.timeline-item.event-type-repair .timeline-marker {
    background: #FF9800;
}

.timeline-item.event-type-inspection .timeline-marker {
    background: #2196F3;
}

.timeline-item.event-type-calibration .timeline-marker {
    background: #9C27B0;
}

.timeline-item.event-type-upgrade .timeline-marker {
    background: #4CAF50;
}

.timeline-item.event-type-incident .timeline-marker {
    background: #FF5722;
}

/* Timeline details row */
.timeline-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
}

.timeline-detail {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #90A4AE;
}

.timeline-detail i {
    color: #78909C;
    font-size: 11px;
}

/* Alert Acknowledgment Confirmation */
.alert-ack-confirmation {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    border: 1px solid rgba(76, 175, 80, 0.5);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(76, 175, 80, 0.3);
    z-index: 11000;
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

.alert-ack-confirmation.visible {
    transform: translateX(0);
}

.ack-icon {
    font-size: 32px;
    color: #81C784;
    animation: ackPulse 1s ease-in-out;
}

@keyframes ackPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.ack-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ack-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.ack-details {
    font-size: 12px;
    color: #A5D6A7;
}

.ack-response-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #81C784;
    margin-top: 4px;
}

.ack-response-time i {
    font-size: 12px;
}

/* Alert Container Styles */
#alertContainer {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 9500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-notification {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-left: 4px solid;
    animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-notification.alert-critical {
    border-left-color: #F44336;
    background: linear-gradient(180deg, #2a1a1a 0%, #1e1216 100%);
    animation: alertSlideIn 0.3s ease, alertCriticalPulse 2s ease-in-out infinite;
}

@keyframes alertCriticalPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(244, 67, 54, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 8px rgba(244, 67, 54, 0);
    }
}

.alert-notification.alert-warning {
    border-left-color: #FF9800;
}

.alert-notification.alert-info {
    border-left-color: #2196F3;
}

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

.alert-severity {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.alert-critical .alert-severity {
    color: #F44336;
    background: rgba(244, 67, 54, 0.2);
}

.alert-warning .alert-severity {
    color: #FF9800;
    background: rgba(255, 152, 0, 0.2);
}

.alert-info .alert-severity {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.2);
}

.alert-time {
    font-size: 11px;
    color: #888;
}

.alert-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.alert-message {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 8px;
    line-height: 1.4;
}

.alert-equipment {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
}

.alert-readings {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    font-family: monospace;
}

.alert-inventory {
    font-size: 11px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
}

.alert-inventory.inventory-in-stock {
    color: #4CAF50;
    border-left: 2px solid #4CAF50;
}

.alert-inventory.inventory-low-stock {
    color: #FF9800;
    border-left: 2px solid #FF9800;
}

.alert-inventory.inventory-out-of-stock {
    color: #F44336;
    border-left: 2px solid #F44336;
}

.alert-action {
    font-size: 12px;
    color: #81D4FA;
    padding: 8px 10px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
    margin-bottom: 10px;
}

.alert-acknowledge {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-acknowledge:hover {
    background: linear-gradient(135deg, #66BB6A, #4CAF50);
    transform: translateY(-1px);
}

.alert-acknowledge:active {
    transform: translateY(0);
}

/* System Report Popup */
.system-report-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.system-report-popup.show {
    display: flex;
}

.system-report-popup .popupBackgroundX {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.system-report-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* System Report Header */
.system-report-header {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(25, 118, 210, 0.1));
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.system-report-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-report-header h3 i {
    color: #2196F3;
}

/* System report close button uses universal style from top of file */
/* Position adjustment for system report header */
.system-report-header .closePopupX {
    position: relative;
    top: auto;
    right: auto;
    margin-left: auto;
}

/* Summary Stats */
.system-report-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.summary-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 18px;
    border-radius: 8px;
    text-align: center;
    min-width: 100px;
}

.summary-item .summary-label {
    display: block;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item .summary-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    margin-top: 4px;
}

.summary-item.status-ok .summary-value {
    color: #4CAF50;
}

.summary-item.status-warning .summary-value {
    color: #FF9800;
}

.summary-item.status-critical .summary-value {
    color: #F44336;
}

/* Filters */
.system-report-filters {
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.report-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9em;
}

.report-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.report-search:focus {
    outline: none;
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.report-filter {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9em;
    cursor: pointer;
}

.report-filter option {
    background: #1a1a2e;
    color: #fff;
}

/* Table Wrapper */
.system-report-table-wrapper {
    flex: 1;
    overflow: auto;
    padding: 0 25px;
}

/* System Report Table */
.system-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.system-report-table thead {
    position: sticky;
    top: 0;
    background: #1a1a2e;
    z-index: 10;
}

.system-report-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.system-report-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.system-report-table th.sortable:hover {
    color: #2196F3;
}

.system-report-table th.sortable i {
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.5;
}

.system-report-table th.sortable.sort-asc i::before,
.system-report-table th.sortable.sort-desc i::before {
    opacity: 1;
}

.system-report-table th.sortable.sort-asc i::before {
    content: "\f0de";
}

.system-report-table th.sortable.sort-desc i::before {
    content: "\f0dd";
}

.system-report-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.system-report-table tbody tr {
    transition: background 0.2s ease;
}

.system-report-table tbody tr:hover {
    background: rgba(33, 150, 243, 0.1);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.operational {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-badge.warning {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.status-badge.critical {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.status-badge.degraded {
    background: rgba(255, 152, 0, 0.2);
    color: #FFC107;
}

.status-badge.offline {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* Health Bar */
.health-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}

.health-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.health-bar-fill.health-good {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

.health-bar-fill.health-warning {
    background: linear-gradient(90deg, #FF9800, #FFC107);
}

.health-bar-fill.health-critical {
    background: linear-gradient(90deg, #F44336, #FF5722);
}

.health-value {
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* Replacement Date */
.replacement-date {
    display: flex;
    flex-direction: column;
}

.replacement-date .date {
    font-weight: 500;
}

.replacement-date .timeframe {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

.replacement-date.urgent .date {
    color: #F44336;
    font-weight: 600;
}

.replacement-date.soon .date {
    color: #FF9800;
}

.replacement-date.ok .date {
    color: #4CAF50;
}

/* Inventory Status */
.inventory-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inventory-status .qty {
    font-weight: 600;
}

.inventory-status.in-stock .qty {
    color: #4CAF50;
}

.inventory-status.low-stock .qty {
    color: #FF9800;
}

.inventory-status.out-of-stock .qty {
    color: #F44336;
}

.inventory-status .label {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== HIERARCHICAL TABLE STRUCTURE ===== */

/* Column widths for hierarchical table */
.hierarchical-table .col-name {
    width: 30%;
    min-width: 250px;
}

.hierarchical-table .col-status {
    width: 10%;
    min-width: 100px;
}

.hierarchical-table .col-health {
    width: 12%;
    min-width: 120px;
}

.hierarchical-table .col-ai-prediction {
    width: 18%;
    min-width: 160px;
}

.hierarchical-table .col-replacement {
    width: 12%;
    min-width: 110px;
}

.hierarchical-table .col-inventory {
    width: 10%;
    min-width: 100px;
}

.hierarchical-table .col-actions {
    width: 8%;
    min-width: 70px;
}

/* Group Header Row - Main Antenna, Container Building */
.group-header-row {
    background: linear-gradient(90deg, rgba(33, 150, 243, 0.15) 0%, rgba(33, 150, 243, 0.05) 100%);
    border-left: 4px solid #2196F3;
}

.group-header-row td {
    padding: 14px 15px !important;
    border-bottom: 2px solid rgba(33, 150, 243, 0.3) !important;
}

.group-header-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-header-cell i {
    color: #2196F3;
    font-size: 1.1em;
}

.group-header-cell .group-name {
    font-weight: 700;
    font-size: 1.05em;
    color: #fff;
    letter-spacing: 0.3px;
}

.group-header-cell .group-count {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Unit Row - ACU, Drive System, Modem, etc. */
.unit-row {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid transparent;
}

.unit-row:hover {
    background: rgba(33, 150, 243, 0.08) !important;
    border-left-color: #4CAF50;
}

.unit-row td:first-child {
    padding-left: 25px !important;
}

.unit-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-name-cell .unit-icon {
    color: #4CAF50;
    font-size: 1em;
    opacity: 0.8;
}

.unit-name-cell .unit-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.unit-name-cell .component-count {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    margin-left: 6px;
}

/* Component Row - sub-items under units */
.component-row {
    background: transparent;
    border-left: 4px solid transparent;
}

.component-row:hover {
    background: rgba(255, 152, 0, 0.06) !important;
    border-left-color: #FF9800;
}

.component-row td:first-child {
    padding-left: 45px !important;
}

.component-indent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.component-indent .component-icon {
    color: #FF9800;
    font-size: 0.85em;
    opacity: 0.7;
}

.component-indent .component-name {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

/* Subcomponent Row - nested even deeper */
.subcomponent-row {
    background: rgba(0, 0, 0, 0.1);
}

.subcomponent-row:hover {
    background: rgba(156, 39, 176, 0.08) !important;
    border-left-color: #9C27B0;
}

.subcomponent-row td:first-child {
    padding-left: 65px !important;
}

.subcomponent-indent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 40px;
    border-left: 2px dashed rgba(255, 255, 255, 0.08);
}

.subcomponent-indent .component-icon {
    color: #9C27B0;
    font-size: 0.8em;
    opacity: 0.6;
}

.subcomponent-indent .component-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

/* Filtered view - flat list with parent info */
.filtered-row {
    background: rgba(255, 255, 255, 0.02);
}

.filtered-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filtered-name-cell .parent-path {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.4);
}

.filtered-name-cell .comp-name {
    font-weight: 500;
}

/* ===== END HIERARCHICAL TABLE STRUCTURE ===== */

/* Action Buttons */
.action-btn {
    background: rgba(33, 150, 243, 0.2);
    border: none;
    color: #2196F3;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(33, 150, 243, 0.4);
}

/* Footer */
.system-report-footer {
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.report-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.report-actions {
    display: flex;
    gap: 10px;
}

.btn-export, .btn-refresh {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-export {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.btn-export:hover {
    background: rgba(76, 175, 80, 0.4);
}

.btn-refresh {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.btn-refresh:hover {
    background: rgba(33, 150, 243, 0.4);
}

/* Empty State */
.report-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.report-empty-state i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.3;
}

.report-empty-state p {
    font-size: 1.1em;
}

/* ===== AI ANALYSIS STYLES ===== */

/* AI Analysis Button */
.btn-ai-analysis {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.3), rgba(103, 58, 183, 0.3));
    color: #BA68C8;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.btn-ai-analysis:hover {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.5), rgba(103, 58, 183, 0.5));
    transform: translateY(-1px);
}

.btn-ai-analysis.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-ai-analysis i {
    font-size: 1.1em;
}

/* AI Analysis Container */
.ai-analysis-container {
    margin: 15px 25px;
    display: none;
}

.ai-analysis-container.show {
    display: block;
}

/* AI Analysis Loading */
.ai-analysis-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    background: rgba(156, 39, 176, 0.1);
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: 8px;
    color: #BA68C8;
    font-size: 1em;
}

.ai-analysis-loading i {
    font-size: 1.5em;
}

/* AI Analysis Error */
.ai-analysis-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    color: #f44336;
}

.ai-retry-btn {
    padding: 6px 14px;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 4px;
    color: #f44336;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-retry-btn:hover {
    background: rgba(244, 67, 54, 0.4);
}

/* AI Analysis Results */
.ai-analysis-results {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(103, 58, 183, 0.2));
    border-bottom: 1px solid rgba(156, 39, 176, 0.3);
}

.ai-analysis-header i {
    font-size: 1.5em;
    color: #BA68C8;
}

.ai-analysis-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: #fff;
    flex: 1;
}

.ai-timestamp {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

.ai-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 5px;
    font-size: 1em;
    transition: color 0.3s ease;
}

.ai-close-btn:hover {
    color: #fff;
}

/* AI Assessment Section */
.ai-assessment-section {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.ai-risk-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    border-radius: 8px;
    min-width: 100px;
}

.ai-risk-badge .risk-level {
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
}

.ai-risk-badge .risk-label {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 4px;
}

.ai-risk-badge.risk-critical {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #f44336;
}

.ai-risk-badge.risk-high {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.5);
    color: #FF9800;
}

.ai-risk-badge.risk-medium {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    color: #FFC107;
}

.ai-risk-badge.risk-low {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #4CAF50;
}

.ai-risk-badge.risk-unknown {
    background: rgba(158, 158, 158, 0.2);
    border: 1px solid rgba(158, 158, 158, 0.5);
    color: #9E9E9E;
}

.ai-overall-assessment {
    flex: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 0.95em;
}

/* AI Issues Sections */
.ai-issues-section {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-issues-section.critical {
    background: rgba(244, 67, 54, 0.05);
}

.ai-issues-section.warning {
    background: rgba(255, 152, 0, 0.05);
}

.ai-issues-section h5 {
    margin: 0 0 10px 0;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-issues-section.critical h5 {
    color: #f44336;
}

.ai-issues-section.warning h5 {
    color: #FF9800;
}

.ai-issues-section ul {
    margin: 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.ai-issues-section li {
    margin: 6px 0;
    line-height: 1.4;
}

/* AI Recommendations */
.ai-recommendations-section {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(33, 150, 243, 0.05);
}

.ai-recommendations-section h5 {
    margin: 0 0 10px 0;
    font-size: 0.95em;
    color: #2196F3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-recommendations-section ol {
    margin: 0;
    padding-left: 25px;
    color: rgba(255, 255, 255, 0.8);
}

.ai-recommendations-section li {
    margin: 8px 0;
    line-height: 1.4;
}

/* AI Maintenance Section */
.ai-maintenance-section {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-maintenance-section h5 {
    margin: 0 0 12px 0;
    font-size: 0.95em;
    color: #9E9E9E;
    display: flex;
    align-items: center;
    gap: 8px;
}

.maintenance-timeline {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.maintenance-period {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.maintenance-period.immediate {
    border-left: 3px solid #f44336;
}

.maintenance-period.short-term {
    border-left: 3px solid #FF9800;
}

.maintenance-period.scheduled {
    border-left: 3px solid #2196F3;
}

.period-label {
    display: block;
    font-size: 0.8em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.maintenance-period ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.maintenance-period li {
    margin: 4px 0;
}

/* AI Inventory Section */
.ai-inventory-section {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(156, 39, 176, 0.05);
}

.ai-inventory-section h5 {
    margin: 0 0 10px 0;
    font-size: 0.95em;
    color: #BA68C8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-inventory-section ul {
    margin: 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.ai-inventory-section li {
    margin: 6px 0;
}

/* AI Analysis Footer */
.ai-analysis-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== AI PREDICTION STATS ===== */

.prediction-stats-container {
    margin: 15px 25px;
}

.prediction-stats {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.prediction-stats-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.2), rgba(0, 150, 136, 0.2));
    border-bottom: 1px solid rgba(0, 188, 212, 0.3);
}

.prediction-stats-header i {
    font-size: 1.3em;
    color: #00BCD4;
}

.prediction-stats-header span {
    font-size: 0.95em;
    font-weight: 600;
    color: #fff;
}

.prediction-loading {
    margin-left: 12px;
    font-size: 0.85em !important;
    color: rgba(255, 255, 255, 0.6) !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prediction-stats-content {
    display: flex;
    padding: 15px 20px;
    gap: 30px;
    flex-wrap: wrap;
}

.prediction-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.prediction-stat .stat-value {
    font-size: 1.6em;
    font-weight: bold;
    color: #fff;
}

.prediction-stat .stat-label {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    text-align: center;
}

.prediction-stat.stat-critical .stat-value {
    color: #f44336;
}

.prediction-stat.stat-warning .stat-value {
    color: #FF9800;
}

.prediction-stat.stat-ok .stat-value {
    color: #4CAF50;
}

.prediction-stat .stat-value.urgent {
    color: #f44336;
}

.prediction-stat .stat-value.soon {
    color: #FF9800;
}

.prediction-stat .stat-value.scheduled {
    color: #4CAF50;
}

/* ===== AI PREDICTION CELL IN TABLE ===== */

.ai-prediction-cell {
    min-width: 120px;
}

.ai-prediction-cell.no-prediction {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-size: 0.85em;
}

.ai-prediction-cell .no-data {
    display: block;
    text-align: center;
}

.ai-prediction-cell .pred-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.ai-prediction-cell .pred-days {
    font-weight: bold;
    font-size: 1em;
}

.ai-prediction-cell.urgent .pred-header {
    color: #f44336;
}

.ai-prediction-cell.soon .pred-header {
    color: #FF9800;
}

.ai-prediction-cell.warning .pred-header {
    color: #FFC107;
}

.ai-prediction-cell.ok .pred-header {
    color: #4CAF50;
}

.ai-prediction-cell .pred-date {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.ai-prediction-cell .pred-confidence {
    position: relative;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.ai-prediction-cell .confidence-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 188, 212, 0.5), rgba(0, 150, 136, 0.5));
    border-radius: 3px;
}

.ai-prediction-cell .confidence-value {
    position: relative;
    z-index: 1;
    font-size: 0.7em;
    color: #fff;
    display: block;
    text-align: center;
    line-height: 14px;
}

/* Trend indicators */
.trend-bad {
    color: #f44336 !important;
    font-size: 0.8em;
}

.trend-good {
    color: #4CAF50 !important;
    font-size: 0.8em;
}

.trend-stable {
    color: #9E9E9E !important;
    font-size: 0.8em;
}

/* Health source indicator */
.health-bar-container .health-value small {
    font-size: 0.7em;
    opacity: 0.7;
}

/* ========================================
   AI Prediction Enhancements
   ======================================== */

/* AI Prediction cell base (ensure relative positioning) */
.ai-prediction-cell {
    position: relative;
}

/* Loading spinner in AI prediction cell */
.ai-prediction-cell.loading {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(33, 150, 243, 0.15));
    animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% {
        background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(33, 150, 243, 0.15));
    }
    50% {
        background: linear-gradient(135deg, rgba(156, 39, 176, 0.25), rgba(33, 150, 243, 0.25));
    }
}

.ai-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
}

.ai-loading-spinner i {
    font-size: 1.4em;
    background: linear-gradient(135deg, #9C27B0, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(156, 39, 176, 0.5));
}

.ai-loading-spinner span {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Analyze button */
.ai-prediction-cell .analyze-btn {
    background: linear-gradient(135deg, #9C27B0, #673AB7);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    margin-top: 4px;
    transition: all 0.2s ease;
}

.ai-prediction-cell .analyze-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.5);
}

.ai-prediction-cell .analyze-btn.retry {
    background: linear-gradient(135deg, #FF5722, #F44336);
}

/* Info button */
.ai-prediction-cell .info-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.ai-prediction-cell:hover .info-btn {
    opacity: 1;
}

.ai-prediction-cell .info-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* AI badge */
.ai-prediction-cell .ai-badge {
    font-size: 0.7em;
    color: #9C27B0;
    margin-left: 4px;
}

/* No failure state */
.ai-prediction-cell.no-failure {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(139, 195, 74, 0.3));
}

.ai-prediction-cell.no-failure .pred-header i {
    color: #4CAF50;
}

/* Inventory alerts in prediction cell */
.ai-prediction-cell .inventory-alert {
    font-size: 0.65em;
    padding: 2px 4px;
    margin-top: 4px;
    border-radius: 3px;
    background: rgba(255, 152, 0, 0.2);
    color: #FFB74D;
    text-align: center;
}

.ai-prediction-cell .inventory-alert.critical {
    background: rgba(244, 67, 54, 0.3);
    color: #FF5252;
    font-weight: bold;
}

.ai-prediction-cell .inventory-alert.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

/* ========================================
   AI Prediction Justification Popup
   ======================================== */

.prediction-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
}

.prediction-popup {
    position: fixed;
    z-index: 10001;
    width: 600px;
    max-width: 90vw;
    max-height: 85vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(156, 39, 176, 0.2);
    overflow: hidden;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.prediction-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #9C27B0, #673AB7);
}

.prediction-popup .popup-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prediction-popup .popup-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.prediction-popup .popup-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.prediction-popup .popup-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
}

.prediction-popup .section {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(156, 39, 176, 0.5);
}

.prediction-popup .section h4 {
    margin: 0 0 12px 0;
    font-size: 0.9em;
    color: #9C27B0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prediction-popup .section p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    font-size: 0.9em;
}

.prediction-popup .section ul {
    margin: 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.prediction-popup .section ul li {
    margin-bottom: 6px;
    font-size: 0.9em;
}

/* Component info section */
.prediction-popup .component-info {
    text-align: center;
    border-left-color: #2196F3;
}

.prediction-popup .component-info h4 {
    font-size: 1.2em;
    color: white;
}

.prediction-popup .component-info .category {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

/* Prediction summary section */
.prediction-popup .prediction-summary {
    text-align: center;
    border-left-color: #FF9800;
}

.prediction-popup .risk-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.prediction-popup .risk-badge.low {
    background: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.prediction-popup .risk-badge.medium {
    background: rgba(255, 193, 7, 0.3);
    color: #FFC107;
}

.prediction-popup .risk-badge.high {
    background: rgba(255, 152, 0, 0.3);
    color: #FF9800;
}

.prediction-popup .risk-badge.critical {
    background: rgba(244, 67, 54, 0.3);
    color: #F44336;
}

.prediction-popup .failure-prediction {
    margin: 16px 0;
}

.prediction-popup .failure-prediction .days {
    display: block;
    font-size: 3em;
    font-weight: bold;
    color: #FF5722;
    line-height: 1;
}

.prediction-popup .failure-prediction .label {
    display: block;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.prediction-popup .failure-prediction.ok {
    color: #4CAF50;
}

.prediction-popup .failure-prediction.ok i {
    font-size: 2em;
    margin-bottom: 8px;
}

.prediction-popup .confidence-meter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.prediction-popup .confidence-meter .label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
}

.prediction-popup .confidence-meter .meter {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.prediction-popup .confidence-meter .fill {
    height: 100%;
    background: linear-gradient(90deg, #00BCD4, #009688);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.prediction-popup .confidence-meter .value {
    color: #00BCD4;
    font-weight: bold;
    font-size: 0.9em;
}

/* Justification section */
.prediction-popup .justification {
    border-left-color: #4CAF50;
}

/* Lead indicators section */
.prediction-popup .lead-indicators {
    border-left-color: #2196F3;
}

.prediction-popup .lead-indicators ul {
    list-style-type: none;
    padding-left: 0;
}

.prediction-popup .lead-indicators li {
    padding: 8px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Failure mode section */
.prediction-popup .failure-mode {
    border-left-color: #F44336;
}

/* Recommended action section */
.prediction-popup .recommended-action {
    border-left-color: #FF9800;
}

.prediction-popup .maintenance-window {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    color: #FF9800;
    font-size: 0.85em;
}

/* Inventory section */
.prediction-popup .inventory-section {
    border-left-color: #FF9800;
}

.prediction-popup .inventory-section.critical {
    border-left-color: #F44336;
    background: rgba(244, 67, 54, 0.1);
}

.prediction-popup .inventory-section.warning {
    background: rgba(255, 193, 7, 0.1);
}

.prediction-popup .inventory-details {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.prediction-popup .inventory-details span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.prediction-popup .action-required {
    color: #F44336 !important;
    font-weight: bold;
    margin-top: 12px !important;
}

/* Dependency risk section */
.prediction-popup .dependency-risk {
    border-left-color: #9C27B0;
}

/* Metadata section */
.prediction-popup .metadata {
    background: transparent;
    border-left: none;
    padding: 8px 0;
    text-align: center;
}

.prediction-popup .generated-at {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
}

.prediction-popup .generated-at i {
    margin-right: 6px;
}

/* Batch loading indicator */
.prediction-stats-header .batch-loading {
    margin-left: 12px;
    font-size: 0.85em;
    color: #9C27B0;
}

/* Run AI Analysis button */
.prediction-stats-header .run-ai-analysis-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #9C27B0, #673AB7);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.prediction-stats-header .run-ai-analysis-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
}

.prediction-stats-header .run-ai-analysis-btn:active {
    transform: scale(0.98);
}

.prediction-stats-header .run-ai-analysis-btn i {
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 768px) {
    .system-report-container {
        width: 95%;
        max-height: 90vh;
    }

    .system-report-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .system-report-summary {
        width: 100%;
        justify-content: space-between;
    }

    .summary-item {
        flex: 1;
        min-width: 70px;
    }

    .system-report-filters {
        flex-direction: column;
    }

    .report-search, .report-filter {
        width: 100%;
    }

    .system-report-table {
        font-size: 0.8em;
    }

    .system-report-table th,
    .system-report-table td {
        padding: 8px 6px;
    }
}

/* ===========================================================================
   SPEC SHEET POPUP STYLES
   =========================================================================== */

/* Spec Sheet Button in System Report Table */
.btn-spec-sheet {
    background: transparent;
    border: 1px solid #4a90a4;
    color: #4a90a4;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

.btn-spec-sheet:hover {
    background: #4a90a4;
    color: #fff;
}

.btn-spec-sheet:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 164, 0.3);
}

.no-spec {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* Spec Sheet Popup Container */
.spec-sheet-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.spec-sheet-popup.show {
    display: flex;
}

.spec-sheet-popup .popupBackgroundX {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.spec-sheet-container {
    position: relative;
    background: linear-gradient(180deg, #1a2a3a 0%, #0d1520 100%);
    border: 1px solid rgba(74, 144, 164, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spec-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.spec-sheet-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #4a90a4;
    font-weight: 500;
}

/* Spec Sheet Tabs */
.spec-sheet-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.spec-sheet-tabs .tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

.spec-sheet-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.spec-sheet-tabs .tab-btn.active {
    background: #4a90a4;
    border-color: #4a90a4;
    color: #fff;
}

/* Spec Sheet Body */
.spec-sheet-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Overview Tab Styles */
.spec-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.spec-header-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    background: rgba(74, 144, 164, 0.1);
    border: 1px solid rgba(74, 144, 164, 0.2);
    border-radius: 8px;
}

.spec-main-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.2em;
    color: #fff;
}

.spec-location {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

.spec-location i {
    margin-right: 6px;
    color: #4a90a4;
}

.spec-status-badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.badge-warranty.active {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-warranty.expiring {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.badge-warranty.expired {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.badge-warranty.unknown {
    background: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.badge-health.good {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-health.fair {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-health.warning {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.badge-health.critical {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Spec Grid */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.spec-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.spec-card h4 {
    margin: 0 0 12px 0;
    color: #4a90a4;
    font-size: 0.95em;
    font-weight: 500;
}

.spec-card h4 i {
    margin-right: 8px;
}

.spec-table {
    width: 100%;
}

.spec-table td {
    padding: 4px 8px 4px 0;
    font-size: 0.9em;
    vertical-align: top;
}

.spec-table td:first-child {
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    width: 40%;
}

.spec-table td:last-child {
    color: #fff;
}

/* Warning Card */
.warning-card {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

.warning-card h4 {
    color: #FF9800;
}

.warranty-eligible {
    color: #4CAF50;
    font-weight: 600;
    font-size: 0.95em;
    margin-top: 8px;
}

.warranty-eligible i {
    margin-right: 6px;
}

.warranty-expired {
    color: #F44336;
    font-weight: 500;
    font-size: 0.95em;
    margin-top: 8px;
}

.warranty-expired i {
    margin-right: 6px;
}

/* Inventory Status in Spec Sheet */
.spec-card .inventory-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
}

.spec-card .inventory-status.in-stock {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.spec-card .inventory-status.low-stock {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.spec-card .inventory-status.out-of-stock {
    background: rgba(244, 67, 54, 0.15);
    color: #F44336;
}

.spec-card .inventory-status.unknown {
    background: rgba(158, 158, 158, 0.15);
    color: #9E9E9E;
}

/* Technical Specs Tab */
.spec-technical {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.spec-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.spec-section h4 {
    margin: 0 0 12px 0;
    color: #4a90a4;
    font-size: 0.95em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.spec-section h4 i {
    margin-right: 8px;
}

.spec-table-detailed {
    width: 100%;
}

.spec-table-detailed td {
    padding: 6px 12px 6px 0;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-table-detailed tr:last-child td {
    border-bottom: none;
}

.spec-table-detailed td:first-child {
    color: rgba(255, 255, 255, 0.5);
    width: 35%;
}

.spec-table-detailed td:last-child {
    color: #fff;
}

/* Documents Section */
.spec-documents {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.spec-documents h4 {
    margin: 0 0 12px 0;
    color: #4a90a4;
    font-size: 0.95em;
}

.spec-documents h4 i {
    margin-right: 8px;
}

.doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(74, 144, 164, 0.1);
    border: 1px solid rgba(74, 144, 164, 0.3);
    border-radius: 6px;
    color: #4a90a4;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s;
}

.doc-link:hover {
    background: rgba(74, 144, 164, 0.2);
    color: #fff;
}

/* Service History Tab */
.spec-history {
    padding: 0;
}

.no-data {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
    font-style: italic;
}

.history-timeline {
    position: relative;
    padding-left: 50px;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: rgba(255, 255, 255, 0.15);
}

.history-entry {
    position: relative;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.history-date {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.history-icon {
    position: absolute;
    left: -50px;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.history-icon.install {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}
.history-icon.inspection {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}
.history-icon.cleaning {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}
.history-icon.calibration {
    background: linear-gradient(135deg, #00BCD4, #0097A7);
}
.history-icon.repair {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}
.history-icon.replace {
    background: linear-gradient(135deg, #F44336, #D32F2F);
}
.history-icon.lubrication {
    background: linear-gradient(135deg, #795548, #5D4037);
}
.history-icon.firmware {
    background: linear-gradient(135deg, #607D8B, #455A64);
}
.history-icon.default {
    background: linear-gradient(135deg, #9E9E9E, #757575);
}

.history-content h5 {
    margin: 0 0 6px 0;
    font-size: 1em;
    color: #fff;
    font-weight: 500;
}

.history-content p {
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    line-height: 1.5;
}

.history-part-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.history-part-info span {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.history-results {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.result-item {
    background: rgba(74, 144, 164, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #4a90a4;
}

.history-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.history-meta span {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
}

.history-meta i {
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.3);
}

/* Readings Tab */
.spec-readings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.readings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.readings-header h4 {
    margin: 0;
    color: #fff;
}

.last-updated {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
}

.readings-info {
    background: rgba(74, 144, 164, 0.1);
    border: 1px solid rgba(74, 144, 164, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.readings-info p {
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    line-height: 1.5;
}

.readings-info p:last-child {
    margin-bottom: 0;
}

.readings-info i {
    color: #4a90a4;
    margin-right: 6px;
}

.associated-sensors {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.associated-sensors h5 {
    margin: 0 0 12px 0;
    color: #4a90a4;
    font-size: 0.95em;
}

.sensor-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sensor-list li {
    background: rgba(74, 144, 164, 0.1);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.sensor-list li i {
    margin-right: 6px;
    color: #4a90a4;
}

/* Alternate Parts Tab */
.spec-vendors h4 {
    margin: 0 0 8px 0;
    color: #fff;
}

.vendor-note, .no-alternates {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    margin-bottom: 16px;
}

.vendor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.vendor-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.vendor-card.current {
    border-color: #4a90a4;
    background: rgba(74, 144, 164, 0.1);
}

.vendor-badge {
    background: #4a90a4;
    color: #fff;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vendor-card h5 {
    margin: 0 0 4px 0;
    color: #fff;
    font-size: 1em;
}

.vendor-model {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    margin: 0 0 12px 0;
}

.vendor-specs {
    width: 100%;
    font-size: 0.9em;
}

.vendor-specs td {
    padding: 4px 8px 4px 0;
}

.vendor-specs td:first-child {
    color: rgba(255, 255, 255, 0.5);
}

.vendor-specs td:last-child {
    color: #fff;
}

.vendor-notes {
    margin: 12px 0 0 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Responsive Spec Sheet */
@media (max-width: 768px) {
    .spec-sheet-container {
        max-height: 90vh;
        border-radius: 8px;
    }

    .spec-header-card {
        flex-direction: column;
        gap: 12px;
    }

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

    .vendor-cards {
        grid-template-columns: 1fr;
    }

    .spec-sheet-tabs {
        gap: 4px;
    }

    .spec-sheet-tabs .tab-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .history-timeline {
        padding-left: 40px;
    }

    .history-icon {
        left: -40px;
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Readings Tab - Sensor Cards */
.readings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.reading-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.3s ease;
}

.reading-card.status-green {
    border-color: rgba(76, 175, 80, 0.4);
}

.reading-card.status-yellow {
    border-color: rgba(255, 152, 0, 0.4);
}

.reading-card.status-red {
    border-color: rgba(244, 67, 54, 0.4);
}

.reading-label {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-weight: 500;
}

.reading-value {
    font-size: 1.4em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.reading-card.status-green .reading-value {
    color: #4CAF50;
}

.reading-card.status-yellow .reading-value {
    color: #FF9800;
}

.reading-card.status-red .reading-value {
    color: #F44336;
}

.reading-range {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.reading-trend {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

.reading-trend i {
    margin-right: 4px;
}

.reading-trend .fa-arrow-up {
    color: #FF9800;
}

.reading-trend .fa-arrow-down {
    color: #2196F3;
}

.reading-trend .fa-equals {
    color: #4CAF50;
}

/* ============================================
   Event Log Window (Live Mode)
   ============================================ */

.event-log-window {
    position: absolute;
    top: 70px;
    right: 15px;
    width: 320px;
    max-height: 350px;
    background: linear-gradient(180deg, rgba(26, 42, 58, 0.95) 0%, rgba(13, 21, 32, 0.95) 100%);
    border: 1px solid rgba(74, 144, 164, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.event-log-window.visible {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.event-log-window.fading-out {
    opacity: 0;
    transform: translateX(20px);
}

.event-log-window.collapsed {
    max-height: none;
}

.event-log-window.collapsed .event-log-content {
    display: none;
}

.event-log-window.collapsed .event-log-header {
    border-radius: 8px;
}

/* Event Log Header */
.event-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    cursor: default;
}

.event-log-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a90a4;
    font-size: 13px;
    font-weight: 600;
}

.event-log-title i {
    font-size: 14px;
}

.event-log-count {
    background: rgba(74, 144, 164, 0.3);
    color: #81D4FA;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.event-log-controls {
    display: flex;
    gap: 6px;
}

.event-log-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-log-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.event-log-btn:active {
    transform: scale(0.95);
}

#eventLogClear:hover {
    background: rgba(244, 67, 54, 0.3);
    color: #F44336;
}

/* Event Log Content */
.event-log-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
}

.event-log-content::-webkit-scrollbar {
    width: 6px;
}

.event-log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.event-log-content::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 164, 0.4);
    border-radius: 3px;
}

.event-log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 164, 0.6);
}

.event-log-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.4);
    gap: 8px;
}

.event-log-empty i {
    font-size: 24px;
    color: rgba(76, 175, 80, 0.4);
}

.event-log-empty span {
    font-size: 12px;
}

/* Event Log Entry */
.event-log-entry {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px 12px;
    border-left: 3px solid;
    animation: logEntrySlideIn 0.3s ease;
}

@keyframes logEntrySlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-log-entry.severity-critical {
    border-left-color: #F44336;
    background: rgba(244, 67, 54, 0.1);
}

.event-log-entry.severity-warning {
    border-left-color: #FF9800;
    background: rgba(255, 152, 0, 0.1);
}

.event-log-entry.severity-info {
    border-left-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.event-log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.event-log-entry-severity {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.severity-critical .event-log-entry-severity {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.severity-warning .event-log-entry-severity {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.severity-info .event-log-entry-severity {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.event-log-entry-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.event-log-entry-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    line-height: 1.3;
}

.event-log-entry-message {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.event-log-entry-equipment {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.event-log-entry-equipment i {
    margin-right: 4px;
    color: #4a90a4;
}

/* New entry highlight */
.event-log-entry.new-entry {
    animation: logEntrySlideIn 0.3s ease, logEntryHighlight 2s ease;
}

@keyframes logEntryHighlight {
    0% {
        box-shadow: 0 0 0 2px rgba(74, 144, 164, 0.5);
    }
    100% {
        box-shadow: none;
    }
}

.maintenanceTitle {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 12px;
    line-height: 1.5;
    color: #888;
    cursor: pointer;
}
.maintenanceTitle > div {
    flex: 1;
    min-width: 120px;
}
.maintenanceTitle > div > div:first-child {
    font-weight: 600;
    font-size: 15px;
    color: #ddd;
}
.maintenanceTitle span {
    color: #35b1cd;
    font-weight: 600;
}
#reportTableTitle {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    color: var(--text-color);
    font-size: 20px;
    font-family: 'Big Shoulders';
    text-transform: uppercase;
}
.tableTitle {
    flex-grow: 1;
}
#smallReportTableBody {
    color: var(--text-color);
}