/* Copiado de C:\Sata\modbusserver\static\dashboard\css\style.css (tema oscuro de ventanas,
   barra de tareas, ficha de batería, pestañas y celdas). No editar aquí: es el estilo original. */

/* --- ventanas y barra de tareas (líneas 1898-2086) --- */
.ui-dialog.custom-window {
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(6, 182, 212, 0.05) !important;
  background: rgba(13, 20, 35, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  overflow: hidden !important;
  font-family: var(--font-main) !important;
  z-index: 1000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Ventana Activa vs Inactiva */
.ui-dialog.custom-window.window-active {
  border-color: var(--border-accent) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(6, 182, 212, 0.12) !important;
}

.ui-dialog.custom-window:not(.window-active) {
  opacity: 0.85;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

/* Barra de Título */
.ui-dialog.custom-window .ui-dialog-titlebar {
  background: rgba(22, 32, 54, 0.75) !important;
  color: var(--text-main) !important;
  font-weight: 600 !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
  padding: 10px 16px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.ui-dialog.custom-window .ui-dialog-title {
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.3px;
  color: var(--text-main) !important;
}

.ui-dialog.custom-window:not(.window-active) .ui-dialog-title {
  color: var(--text-muted) !important;
}

/* Botones de Control */
.ui-dialog.custom-window .window-controls {
  display: flex !important;
  height: 40px !important;
  margin-top: -10px;
  margin-right: -16px;
}

.ui-dialog.custom-window .window-control-button {
  width: 46px !important;
  height: 40px !important;
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  font-size: 0.85rem !important;
}

.ui-dialog.custom-window .window-control-button:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main) !important;
}

.ui-dialog.custom-window .window-button-close:hover {
  background-color: var(--accent-red) !important;
  color: white !important;
}

.ui-dialog.custom-window .ui-dialog-titlebar-close {
  display: none !important; /* Ocultar el original */
}

/* Iconos de Control */
.ui-dialog.custom-window .window-button-close::before {
  content: "✕" !important;
  font-size: 0.85rem !important;
}

.ui-dialog.custom-window .window-button-maximize::before {
  content: "⛶" !important;
  font-size: 0.9rem !important;
}

.ui-dialog.custom-window.window-maximized .window-button-maximize::before {
  content: "⧉" !important;
}

.ui-dialog.custom-window .window-button-minimize::before {
  content: "🗕" !important;
  font-size: 0.75rem !important;
}

/* Contenido Interno */
.ui-dialog.custom-window .ui-dialog-content {
  padding: 20px !important;
  background: transparent !important;
  color: var(--text-main) !important;
  overflow-y: auto !important;
}

/* Ventana Maximizada */
.ui-dialog.custom-window.window-maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 44px) !important; /* Alto menos la barra de tareas */
  border-radius: 0 !important;
  border: none !important;
}

/* Ventana Minimizada */
.ui-dialog.custom-window.window-minimized {
  display: none !important;
}


/* BARRA DE TAREAS (ESTILO CYBERPUNK) */
#windows-taskbar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 44px !important;
  background-color: rgba(13, 18, 31, 0.85) !important;
  border-top: 1px solid var(--border-color) !important;
  backdrop-filter: blur(12px) !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 16px !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4) !important;
  z-index: 9999 !important;
  box-sizing: border-box !important;
}

.taskbar-item {
  height: 32px !important;
  min-width: 130px !important;
  max-width: 180px !important;
  background-color: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-muted) !important;
  margin-right: 8px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 12px !important;
  cursor: pointer !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  transition: all 0.2s !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
}

.taskbar-item:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.taskbar-item.taskbar-item-active {
  background: rgba(6, 182, 212, 0.1) !important;
  color: var(--accent-cyan) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15) !important;
}

.taskbar-item.taskbar-item-minimized {
  opacity: 0.55 !important;
  background-color: transparent !important;
}

/* --- ficha de batería (líneas 2093-2184) --- */
/* ==================== VISTA DETALLE DE BATERÍA (FLOTANTE) ==================== */
.win-battery-detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.win-grid-2col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.win-card-sub {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.win-card-sub h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  color: var(--accent-cyan);
}

.win-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.win-metric-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.win-metric-item span {
  color: var(--text-muted);
}

.win-metric-item strong {
  color: var(--text-main);
  font-weight: 600;
}

.win-cells-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.win-cell-pill {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.2s ease;
}

.win-cell-pill.v-ok { border-left: 3px solid var(--accent-green); }
.win-cell-pill.v-low { border-left: 3px solid var(--accent-amber); }
.win-cell-pill.v-crit { border-left: 3px solid var(--accent-red); }

.win-cell-num {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
}

.win-cell-v {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
}

.win-chart-wrapper {
  position: relative;
  height: 180px;
  width: 100%;
}


/* --- pestañas de la ficha (líneas 2385-2479) --- */
/* ==================== ESTILOS PESTAÑAS DETALLE DE BATERÍA FLOTANTE ==================== */
.win-tabs-nav {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.win-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.win-tab-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 4px 4px 0 0;
}

.win-tab-btn.active {
  color: var(--accent-cyan) !important;
  border-bottom-color: var(--accent-cyan) !important;
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.win-tab-content-container {
  position: relative;
  flex-grow: 1;
  min-height: 380px;
}

.win-tab-content {
  display: none;
  animation: tabFadeIn 0.3s ease forwards;
}

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

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.win-soc-display-circle {
  border: 2px solid rgba(6, 182, 212, 0.15);
  border-radius: 50%;
  width: 190px;
  height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, transparent 80%);
  box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.05), 0 0 25px rgba(6, 182, 212, 0.03);
  animation: circleGlowPulse 4s infinite alternate;
}

@keyframes circleGlowPulse {
  0% { box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.05), 0 0 15px rgba(6, 182, 212, 0.03); border-color: rgba(6, 182, 212, 0.15); }
  100% { box-shadow: inset 0 0 35px rgba(6, 182, 212, 0.15), 0 0 30px rgba(6, 182, 212, 0.08); border-color: rgba(6, 182, 212, 0.35); }
}

.glowing-soc-value {
  font-family: var(--font-mono);
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
  line-height: 1;
}

.win-soh-badge {
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.win-cell-t {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}


/* --- celdas: extremos e insignias (líneas 1190-1219) --- */
/* FLOATING WINDOW PILLS HIGHLIGHTS */

.win-cell-pill {
  position: relative; /* Para anclaje absoluto de las insignias */
}

.win-cell-pill.highest-v {
  border: 1px solid var(--accent-cyan) !important;
  border-left: 3px solid var(--accent-cyan) !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3), inset 0 0 6px rgba(6, 182, 212, 0.08) !important;
}

.win-cell-pill.lowest-v {
  border: 1px solid var(--accent-amber) !important;
  border-left: 3px solid var(--accent-amber) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3), inset 0 0 6px rgba(245, 158, 11, 0.08) !important;
}

.win-cell-pill.temp-hot {
  border: 1px solid var(--accent-red) !important;
  border-left: 3px solid var(--accent-red) !important;
  animation: pulse-glow-hot 1.5s infinite alternate !important;
}

.win-cell-pill.temp-cold {
  border: 1px solid #38bdf8 !important;
  border-left: 3px solid #38bdf8 !important;
  animation: pulse-glow-cold 1.5s infinite alternate !important;
}

