:root {
    --color-primary: #0066cc;
    --color-primary-dark: #0052a3;
    --color-accent: #00a8ff;
    --color-metallic-gray: #4a5568;
    --color-dark-bg: #1a1f2e;
    --color-surface: #252d3d;
    --color-surface-light: #2f3a4d;
    --color-text: #e0e6ed;
    --color-text-secondary: #a0afc0;
    --color-success: #00d084;
    --color-warning: #ffa500;
    --color-error: #ff4444;
    --color-border: #3a4a5f;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--color-dark-bg) 0%, #0f1419 100%);
    color: var(--color-text);
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    gap: 0;
}

/* Container dos Logos no Header */
.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Espaço entre as imagens */
}

/* Estilo das imagens */
.header-logos img {
    height: 40px; /* Altura fixa para caber na barra sem esticar */
    width: auto;  /* Mantém a proporção correta */
    object-fit: contain;
    transition: transform 0.2s ease;
}

.header-logos img:hover {
    transform: scale(1.05); /* Efeito suave ao passar o mouse */
}

/* (Opcional) Separador vertical entre os logos */
.logo-separator {
    color: var(--color-border);
    font-size: 20px;
    margin: 0 5px;
    opacity: 0.5;
}

/* Responsividade: Esconder logos em telas muito pequenas para não quebrar o layout */
@media (max-width: 768px) {
    .header-logos {
        display: none;
    }
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--color-surface) 0%, #1f2836 100%);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-accent);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo::before {
    content: "☀️";
    font-size: 24px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
    color: var(--color-text-secondary);
    background: transparent;
}

.nav-item:hover {
    background: rgba(0, 168, 255, 0.1);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.nav-item.active {
    background: rgba(0, 168, 255, 0.2);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    font-weight: 600;
}

.separator {
    height: 1px;
    background: var(--color-border);
    margin: 15px 0;
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(90deg, var(--color-surface) 0%, #2f3a4d 100%);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-accent);
}

.header-info {
    display: flex;
    gap: 30px;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 208, 132, 0.1);
    border: 1px solid var(--color-success);
    border-radius: 4px;
    font-size: 11px;
}

.status-badge.offline {
    background: rgba(255, 68, 68, 0.1);
    border-color: var(--color-error);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--color-error);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.alarm-global-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(
    120deg,
    rgba(255, 68, 68, 0.08),
    rgba(0, 208, 132, 0.05)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.alarm-global-icon {
  font-size: 26px;
}

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

.alarm-global-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alarm-global-status {
  font-weight: 600;
  font-size: 15px;
}

.alarm-global-counter {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: var(--color-metallic-gray);
}

/* SCREENS */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* LOGIN SCREEN */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--color-dark-bg) 0%, #0f1419 100%);
}

.login-box {
    background: var(--color-surface);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--color-border);
}

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-dark-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 102, 204, 0.3);
}

/* DASHBOARD GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* DASHBOARD LAYOUT */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-left {
    grid-column: 1;
}

.dashboard-center {
    grid-column: 2;
}

.dashboard-right {
    grid-column: 3;
}

/* HEATMAP STYLES */
.heatmap-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.heatmap-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 9 colunas x 10 linhas = 90 sensores */
.heatmap-grid-90 {
    display: grid;
    grid-template-columns: repeat(9, 1fr); /* 9 colunas fixas */
    gap: 3px;
    flex: 1;
}

.heatmap-cell-90 {
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    max-width: 36px;
    max-height: 36px;
}

.heatmap-cell-90:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    z-index: 9;
}

.heliostato-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px; 
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 38px; 
    height: 38px; 
}

.heliostato-cell:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    z-index: 9;
}
.heatmap-wrapper {
    display: grid;
    grid-template-columns: 1fr 50px;
    gap: 12px;
    align-items: start;
}

.heatmap-scale {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 50px;
    justify-content: space-between;
    height: 100%;
}

.scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    color: var(--color-text-secondary);
}

.scale-color {
    width: 24px;
    height: 32px;
    border-radius: 2px;
    border: 1px solid var(--color-border);
}


/* COMMAND BUTTONS SECTION */
.command-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.command-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.command-buttons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.command-btn-main {
    padding: 14px 16px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    text-align: center;
    line-height: 1.2;
}

.command-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.3);
}

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

/* MODAL STYLES */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

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

.modal-content {
    background: var(--color-surface);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 16px;
    text-align: center;
}

.modal-message {
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-btn-confirm {
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    color: white;
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.3);
}

.modal-btn-cancel {
    background: var(--color-border);
    color: var(--color-text);
}

.modal-btn-cancel:hover {
    background: var(--color-metallic-gray);
}

/* WEATHER CARDS RIGHT COLUMN */
.weather-cards-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.weather-card-small {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.weather-card-small:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(0, 168, 255, 0.15);
    transform: translateY(-2px);
}

.weather-card-title-small {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.weather-card-value-small {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-accent);
}

.weather-card-unit-small {
    font-size: 10px;
    color: var(--color-text-secondary);
    margin-top: 3px;
}

/* CLP STATUS CARD */
.clp-status-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    transition: all 0.3s ease;
}

.clp-status-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(0, 168, 255, 0.15);
}

.clp-status-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.clp-status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.clp-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.clp-status-dot.online {
    background: var(--color-success);
}

.clp-status-dot.offline {
    background: var(--color-error);
    animation: none;
}

.clp-status-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-success);
    text-transform: uppercase;
}

.clp-status-dot.offline ~ .clp-status-text {
    color: var(--color-error);
}

.clp-status-info {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-align: center;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(0, 168, 255, 0.15);
    transform: translateY(-2px);
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--color-accent);
    margin-bottom: 8px;
}

.card-unit {
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* WEATHER DATA SECTION */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.weather-item {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.1), rgba(0, 102, 204, 0.05));
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 168, 255, 0.2);
}

.weather-label {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.weather-value {
    font-size: 22px;
    font-weight: bold;
    color: var(--color-accent);
}

/* TABLE STYLES */
.table-container {
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: rgba(0, 168, 255, 0.1);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--color-accent);
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

tr:hover {
    background: rgba(0, 168, 255, 0.05);
}

/* FORM ELEMENTS */
.form-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

select {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-dark-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.1);
}

select option {
    background: var(--color-surface);
    color: var(--color-text);
}

/* BUTTONS */
.btn-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-metallic-gray);
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: #d63333;
}

.btn-success {
    background: var(--color-success);
    color: #000;
}

.btn-success:hover {
    background: #00c070;
}

/* ALARM SECTION */
.alarm-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.alarm-box {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid var(--color-warning);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: var(--color-warning);
    font-weight: 600;
    text-transform: uppercase;
}

.alarm-box.error {
    background: rgba(255, 68, 68, 0.1);
    border-color: var(--color-error);
    color: var(--color-error);
}

.alarm-box.success {
    background: rgba(0, 208, 132, 0.1);
    border-color: var(--color-success);
    color: var(--color-success);
}

/* ALARM BANNER */
.alarm-banner {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.alarm-banner.active {
    border-color: var(--color-error);
    background: rgba(255, 68, 68, 0.05);
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.2);
}

.alarm-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.alarm-banner-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.alarm-banner-dot.active {
    background: var(--color-error);
    animation: pulse 1.5s infinite;
}

.alarm-banner-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-success);
    flex: 1;
}

.alarm-banner.active .alarm-banner-text {
    color: var(--color-error);
}

.alarm-banner-btn {
    padding: 8px 16px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.alarm-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* ALARM HISTORY MODAL */
.alarm-history-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.alarm-history-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.alarm-history-content {
    background: var(--color-surface);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.alarm-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
}

.alarm-history-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-accent);
}

.alarm-history-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.alarm-history-close:hover {
    color: var(--color-accent);
}

.alarm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alarm-item {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--color-error);
    padding: 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.alarm-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(4px);
}

.alarm-item-datetime {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.alarm-item-text {
    font-size: 14px;
    color: var(--color-error);
    font-weight: 500;
}

/* COMMAND BUTTONS */
.command-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.command-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.command-btn.position {
    background: linear-gradient(90deg, var(--color-warning), #ff8c00);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 12px 16px;
        overflow-x: auto;
    }

    .nav-menu {
        flex-direction: row;
        gap: 4px;
        margin-left: auto;
    }

    .separator {
        display: none;
    }

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

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

/* Modal Overlay */
.alarm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 999;
}

.alarm-modal-overlay.show {
  display: block;
}

/* Modal */
.alarm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 1000;
}

.alarm-modal.show {
  display: flex;
}

.alarm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.alarm-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--color-text);
}

.alarm-modal-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.alarm-modal-close:hover {
  background: var(--color-secondary);
  color: var(--color-text);
}

.alarm-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.alarm-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.alarm-modal-table thead {
  background: var(--color-surface-light);
  position: sticky;
  top: 0;
}

.alarm-modal-table th {
  padding: 12px;
  text-align: left;
  color: var(--color-text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.alarm-modal-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.alarm-modal-table tr:hover {
  background: rgba(0, 168, 255, 0.05);
}

.alarm-status-active {
  color: #ff4444;
  font-weight: 600;
}

.alarm-status-resolved {
  color: #00d084;
  font-weight: 600;
}

.alarm-status-silenced {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.alarm-history-button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.alarm-history-button:hover {
  background: var(--color-accent);
  color: #0f1419;
}

/* --- ESTILOS DA PÁGINA SOBRE --- */

/* Wrapper para centralizar o card na tela */
.about-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.about-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    text-align: center;
    position: relative;
    animation: slideIn 0.4s ease;
}

/* Logos */
.about-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.brand-logo {
    height: 90px; 
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.divider-vertical {
    width: 1px;
    height: 60px;
    background: var(--color-border);
}

/* Tipografia */
.about-header h2 {
    color: var(--color-accent);
    font-size: 24px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.version-badge {
    background: rgba(0, 168, 255, 0.1);
    color: var(--color-accent);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.about-content {
    margin: 24px 0;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.6;
    text-align: justify; /* Aparência mais formal */
    text-align-last: center;
}

.about-separator {
    border: 0;
    height: 1px;
    background: var(--color-border);
    margin: 24px 0;
}

/* Grid de Especificações */
.about-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
    text-align: left;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 4px;
}

.spec-label {
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.spec-value {
    color: var(--color-text);
    font-size: 12px;
    font-family: monospace;
}

/* Footer */
.about-footer {
    font-size: 11px;
    color: var(--color-text-secondary);
    opacity: 0.6;
}



#modalAlarmHistory .modal-content {
    width: 80% !important;         
    max-width: 1000px !important;  
    
    height: auto !important;        
    min-height: 200px !important;  
    max-height: 85vh !important;    
}

#modalAlarmHistory .table-container {
    max-height: 60vh;
    overflow-y: auto;
}



#modalSensorChart .modal-content {
    width: 90% !important;          
    max-width: 1600px !important;    
    
    height: 80vh !important;        
    display: flex !important;
    flex-direction: column !important;
}


#sensorChartCanvas {
    width: 100% !important;
    height: 100% !important;
}

/* --- Replay Heatmap (18 colunas x 5 linhas) --- */
.heatmap-replay-container {
    display: grid;
    /* Define exatamente 18 colunas de tamanho igual */
    grid-template-columns: repeat(18, 1fr);
    gap: 3px;
    background: #151921;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    margin-bottom: 15px;
}

.replay-cell {
    aspect-ratio: 1;
    background-color: #333;
    border-radius: 2px;
    
    /* MUDANÇA: Exibir texto centralizado */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* Tipografia pequena para caber */
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8); /* Sombra preta para ler em qualquer cor */
    line-height: 1.1;
    
    cursor: default;
    transition: background-color 0.1s;
}

/* Controles do Slider */
.replay-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.03);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--color-border);
}

.replay-slider {
    flex: 1;
    cursor: pointer;
    accent-color: var(--color-accent); /* Cor do slider */
}

/* --- ESTILOS ESPECÍFICOS DO HELIOSTATO --- */

/* FORÇA A CENTRALIZAÇÃO DO MODAL ESPECÍFICO */
#modalHeliostato {
    align-items: center !important;     /* Centraliza Verticalmente */
    justify-content: center !important; /* Centraliza Horizontalmente */
}
/* Ajuste específico para o tamanho deste modal */
#modalHeliostato .modal-content {
    width: 450px !important;
    max-width: 95%;
    background: var(--color-surface); /* Usa sua cor padrão */
    padding: 0; /* Remove padding padrão para usar nosso header */
    overflow: hidden;
}

/* Header customizado para ficar igual ao seu design */
.helio-modal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.helio-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Grid dos 3 cartões (Alpha, Beta, Theta) */
.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.modal-info-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 10px;
    text-align: center;
}

.modal-info-label {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.modal-info-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--color-accent);
}

/* Status com borda lateral colorida */
.status-box {
    display: flex; 
    justify-content: space-between; 
    background: rgba(255,255,255,0.03); 
    padding: 12px; 
    border-radius: 4px; 
    border-left: 4px solid var(--color-text-secondary);
}

/* Arquivo: style.css - Adicionar ao final */

/* CORES DOS ESTADOS (Substitui as cores hardcoded no JS) */
.status-gray {
    background-color: #2a2a2a; /* Cor original de inativo */
    color: #555;
    border: 1px solid #444;
}

.status-red {
    background-color: var(--color-error); /* Vermelho */
    color: white;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.status-blue {
    background-color: #00a8ff; /* Azul */
    color: white;
    box-shadow: 0 0 5px rgba(0, 168, 255, 0.5);
}

.status-green {
    background-color: #00d084; /* Verde */
    color: white;
    box-shadow: 0 0 5px rgba(0, 208, 132, 0.5);
}

/* LEGENDA HELIOSTATOS */
.heliostat-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--color-border);
    font-size: 11px;
    color: var(--color-text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

/* Adicione no final do style.css se não houver */

/* Cinza: Não existe no BD */
.status-gray {
    background-color: #2a2a2a; 
    color: #555;
    border: 1px solid #444;
}

/* Vermelho: Offline */
.status-red {
    background-color: #ff4444; /* Vermelho vivo */
    color: white;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

/* Azul: Online (Ocioso/Movendo) */
.status-blue {
    background-color: #00a8ff; /* Azul vivo */
    color: white;
    box-shadow: 0 0 5px rgba(0, 168, 255, 0.5);
}

/* Verde: Ativo (Futuro) */
.status-green {
    background-color: #00d084;
    color: white;
    box-shadow: 0 0 5px rgba(0, 208, 132, 0.5);
}

/* Adicione no final do style.css */

.btn-logout-header {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 15px;
    transition: all 0.2s;
}

.btn-logout-header:hover {
    background: #ff4444;
    color: white;
}