.device-geofence .col-xs-6:first-child {
    display: flex;
    align-items: center;
}

.device-geofence .col-xs-6:first-child span.ml-2 {
    margin-left: 5px;
}

#modalFormContainer .modal-body {
    max-height: calc(100vh - 200px); /* Adjust 200px to fit your header/footer sizes */
    overflow-y: auto;
}
#pivot_culture .modal-body {
    max-height: calc(100vh - 200px); /* Adjust 200px to fit your header/footer sizes */
    overflow-y: auto;
}
.panel-default {
   padding: 3px;
}

.device-sectors {
    padding: 0px;
}
.sector-actions {
    margin-top: 10px;
    margin-right: 2px;
}
.panel-group .panel {
    margin: 5px;
}

/* Basic container styling */
.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 250px; /* Adjust width as needed */
    font-family: Arial, sans-serif;
}

/* Selected value area */
.selected-value {
    padding: 8px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    user-select: none;

    /* Make the text + swatch line up on the same row */
    display: flex;
    align-items: center;
    /* If you want the swatch on the far right, uncomment: */
    /* justify-content: space-between; */
}

/* Dropdown list (initially hidden) */
.dropdown-list {
    margin: 0;
    padding: 0;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;  /* scroll if too many items */
    overflow-y: auto;
    border: 1px solid #ccc;
    background: #fff;
    display: none;
    z-index: 9999; /* bring above other elements */
}

/* Items in the dropdown list */
.dropdown-list li {
    padding: 8px;
    cursor: pointer;

    /* Make the text + swatch line up on the same row */
    display: flex;
    align-items: center;
}

.dropdown-list li:hover {
    background: #f0f0f0;
}

/* The color swatch */
.color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    margin-right: 5px; /* Spacing between text and swatch */
}
.program-row {
    margin-bottom: 5px;
}
.details-container {
    padding: 10px;
}
.add-detail-row {
    padding: 10px;
}

.program-row {
    border-top: 1px dotted gray;
    padding-top: 5px;
    padding-bottom: 5px;
}

.detail-row {
    padding: 1px;
}
    /*
         Contenedor que agrupa los contadores en el header.
         Utilizamos flex para ubicarlos uno al lado del otro fácilmente.
       */
.header-counters {
    display: flex;
    align-items: center;
    gap: 20px; /* espacio horizontal entre contadores */
    margin-right: 20px; /* separar del borde derecho */
    padding-top: 12px;
}

/* Bloques individuales de cada contador */
.counter-block {
    display: none; /* Por defecto oculto; se muestra si > 0 */
    position: relative;
}

/* Ícono de spinner y animaciones */
.glyphicon-refresh {
    font-size: 1.6em;
    color: #FFFFFF;
}
@keyframes spinClockwise {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes spinAntiClockwise {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}
.spin-clockwise {
    animation: spinClockwise 1s linear infinite;
}
.spin-anticlockwise {
    animation: spinAntiClockwise 1s linear infinite;

}

/* Texto que muestra el número de pendientes */
.counter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.0em;
    font-weight: bold;
    color: #FFFFFF; /* Texto negro sobre el ícono */
}

/* Texto que muestra el número de fallidas (en rojo) */
.fail-text {
    font-size: 1.2em;
    font-weight: bold;
    color: red;
}

.switch-label {
    color: #333;
}

.device-preferences .switch-label {
    color: black !important;

}
.device-preferences {
    background: transparent;
    color: black !important;
    padding:15px;
}

.navbar-inverse .navbar-nav > .open > a:focus {
    background-color: #0078d7;
}
.dropdown-menu {
    background: darkblue;
    width: 320px;
}

.switch-container-menu {
    padding-left: 17px;
    color: #D0D0D0;
    padding-top: 14px;
}

/* Track del switch */
.switch-container-menu .switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    touch-action: manipulation; /* mejor interacción táctil */
    float: right;
    margin-right: 10px;
}

.switch-container-menu .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-container-menu .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;                 /* top:0; right:0; bottom:0; left:0 */
    background-color: #ccc;
    transition: .3s;
    border-radius: 999px;     /* pista redondeada */
}

/* Botón (bolita) centrado verticalmente */
.switch-container-menu .slider:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;                /* margen interior */
    top: 50%;                 /* centrado vertical */
    transform: translate(0, -50%);
    background-color: #fff;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
}

/* Estado activo */
.switch-container-menu input:checked + .slider {
    background-color: #2196F3;
}
.switch-container-menu input:checked + .slider:before {
    transform: translate(20px, -50%); /* desplaza a la derecha manteniendo centrado */
}

/* Accesibilidad (opcional) */
.switch-container-menu .switch input:focus + .slider {
    box-shadow: 0 0 0 2px rgba(33,150,243,.25);
}



/* Basic styling for the images and slider controls */
#pivot_camera .modal-body {
    overflow: auto;
    scroll-behavior:auto ;
}

#pivot_camera .modal-content {
    overflow: auto;
    scroll-behavior:auto ;
}

#sliderImageTag {
    position: absolute;
    top: 90%;
    transform: translateY(-50%);
    color: white;
    font-size: 2em;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
}


#slider {
    display: none;
    width: 100%;
    height: 100%;
    background-color: black;
    position: fixed;
    top: 0;
    left: 0;
    justify-content: center;
    align-items: center;
}

#slider img {
    max-width: 90%;
    max-height: 90%;
}

.control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2em;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
}

#prev {
    left: 20px;
}

#next {
    right: 20px;
}

#close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2em;
    color: white;
    cursor: pointer;
}



select{
    margin-bottom: 5px;
    color: #23527c;
    background-color: #eee;
    border-radius: 4px;
    text-decoration: none;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid #007bff;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
    font-size: 12px;
    white-space: nowrap;
}

.table{
    margin-bottom: 0px;

}

#modal-content{
    color: #333;
}

.alert-danger {
    color: #333;
    background-color: #fff;
}
.btn {
    margin: 1px;
}

.assistance img {
    width: 25px;
}
.navbar-nav > li > a {
    margin-top: 8px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.navbar-brand {
    margin-top: 5px;
    padding: 5px;
}

.navbar {
    min-height: 35px;
    padding: 5px;
}

img {
  height: auto;
  max-width: 100%;
}

/* Legacy modal centering - now handled by new modal improvements below */
/* These styles are kept for reference but overridden by specific selectors */

/* Remove global overrides that break Bootstrap modals
.modal {
    padding-left: 0 !important;
}
.modal-dialog {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    margin: 0 !important;
}

.modal-content {
    margin: 0 auto;
    text-align: center;
    width: 330px;
    -webkit-transition:width 500ms ease-in-out, height 500ms ease-in-out;
    -moz-transition:width 500ms ease-in-out, height 500ms ease-in-out;
    -o-transition:width 500ms ease-in-out, height 500ms ease-in-out;
    transition:width 500ms ease-in-out, height 500ms ease-in-out;
    border-radius: 6px;
}
*/
.bootstrap-switch-label{
    padding-bottom:6px !important;
}

.footer { padding: 20px; }
.footer a:hover { color: #fff; text-decoration: underline; }

.uno_login-logo h1 { font-size: 80px; margin-bottom: 80px; }
.uno_login-block .form-horizontal { max-width: 450px; margin: 0 auto; }
.uno_login-block .form-horizontal .form-control { margin-bottom: 20px; border-radius: 10px; padding: 12px; }
.uno_login-block .form-horizontal .btn-primary { background: #0078D7; border: none; border-radius: 10px; padding: 12px; margin: 40px 0 80px;
    &:hover { background: #333333; }
}
.uno_login-block #error { color: #F00; border: none; padding: 12px; background-color:rgba(255, 255, 255, 0.5); border-radius: 10px }
.uno_login-block .checkbox #remember { border: none; width: 17px; height: 17px; margin-top: 4px; }
.uno_login-block .checkbox span { padding-left: 5px; font-size: 16px; }

#pivots-list { padding-left: 10px; padding-right: 10px; margin-top: 55px; }
@media only screen and (max-width: 767px) {
    #pivots-list {
        margin-top: 30px;
    }
}
@media only screen and (max-width: 324px) {
    #pivots-list {
        margin-top: 45px;
    }
}
.uno_pivot .pivot-row-info-start { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.uno_pivot .pivot-row-info-start .pivot-name { border-bottom: 1px solid; padding-left: 0; padding-top: 10px; }
.uno_pivot .pivot-row-info-start .pivot-name .date-infos { display: inline-block; }
.uno_pivot .pivot-row-info-start .uno_pivot-info { text-align: right; padding-top: 8px; padding-bottom: 8px; }
.uno_pivot .pivot-row-info-start.pivot-row-info-selected .pivot-name .date-infos, .uno_pivot .pivot-row-info-start.pivot-row-info-selected .pivot-name .date-infos.noResponse { color: #FFFFFF !important; }

.uno_text-left { text-align: left; }
.uno_text-right { text-align: right; }

.uno_pivot .pivot-row-info-end {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.uno_pivot .pivot-row-info-end .uno_pivot-icon {
    display: inline-block;
    vertical-align: middle;
}

.uno_pivot .pivot-row-info-end .uno_pivot-icon > div {
    margin: 0 5px;
}

.uno_pivot .pivot-row-info-end .uno_pivot-icon:first-child > div {
    margin-left: 0;
}

.uno_pivot .pivot-row-info-end .uno_pivot-icon:last-child > div {
    margin-right: 0;
}

.uno_pivot .pivot-row-action-end {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.uno_pivot .pivot-row-action-end .btn-primary {
    background: #0078D7;
    border: none;
    border-radius: 10px;

    &:hover {
        background: #000000;
    }
}

.uno_pivot .pivot-row-action-end .btn-secondary {
    background: #333333;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    width: 100%;
    &:hover {
        background: #000000;
    }

}
.uno_pivot .pivot-row-action-end .uno_action-stop .uno_pivot-icon { display: inline-block; vertical-align: middle; margin-right: 5px; }
.uno_pivot .pivot-row-action-end .uno_action-stop .uno_pivot-icon-text { display: inline-block; vertical-align: middle; font-weight: bold; font-size: 19px; }
.uno_action-stop { padding-left: 18px;  }

/* ========================================
   Pivot Action Toolbar - Compact Row Layout
   Optimizado para móvil: botones en una fila
   ======================================== */
.pivot-action-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: nowrap;
}

.pivot-action-left {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.pivot-action-left .uno_pivot-icon {
    display: inline-flex;
    align-items: center;
}

.pivot-action-left .uno_pivot-icon-text {
    font-weight: bold;
    font-size: 16px;
    margin-left: 3px;
}

.pivot-action-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: nowrap;
}

/* Botones compactos con solo iconos */
.pivot-action-right .btn {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    min-width: auto;
    white-space: nowrap;
}

.pivot-action-right .btn .glyphicon {
    font-size: 14px;
}

/* Botón Ordres destacado */
.pivot-action-right .btn-ordre {
    background: #0078d7;
    border-color: #0078d7;
    color: #fff;
    font-weight: 500;
}

.pivot-action-right .btn-ordre:hover {
    background: #005a9e;
    border-color: #005a9e;
}

/* Botón Données reçues */
.pivot-action-right .btn-recus {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.pivot-action-right .btn-recus:hover {
    background: #545b62;
    border-color: #545b62;
}

/* Responsive: en pantallas muy pequeñas */
@media (max-width: 360px) {
    .pivot-action-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pivot-action-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .pivot-action-right {
        width: 100%;
        justify-content: center;
    }
    
    .pivot-action-right .btn {
        padding: 5px 8px;
        font-size: 12px;
    }
}
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .signal-gsm-0 { background-image: url("/imgs/SignalGSM_0_blank.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .signal-gsm-1 { background-image: url("/imgs/SignalGSM_1_blank.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .signal-gsm-2 { background-image: url("/imgs/SignalGSM_2_blank.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .signal-gsm-3 { background-image: url("/imgs/SignalGSM_3_blank.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .signal-gsm-4 { background-image: url("/imgs/SignalGSM_4_blank.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .signal-gsm-5 { background-image: url("/imgs/SignalGSM_5_blank.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .fleche { background-image: url("/imgs/fleche_horizontale_blank.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .ticketIcon { background-image: url("/imgs/message_blanc.svg") !important; }
.uno_pivot .pivot-row-info-end.pivot-row-info-selected .resetIcon { background-image: url("/imgs/reset_blanc.svg") !important; }

.uno_filter { padding: 10px; }
.uno_filter .uno_filter-icon { background: #FFFFFF; border-radius: 5px; padding: 5px; display: inline-block; vertical-align: middle; border: none; }
.uno_filter .uno_filter-icon .icon { display: block; height: 30px; width: 30px; background-image: url("/imgs/ordre_alpha_noir.svg"); background-repeat: no-repeat; background-position: center center; }
.uno_filter .uno_filter-icon.blank { background: #333333; border-radius: 5px; padding: 5px; display: inline-block; vertical-align: middle; border: none; }
.uno_filter .uno_filter-icon.blank .icon { display: block; height: 30px; width: 30px; background-image: url("/imgs/ordre_alpha_blanc.svg"); background-repeat: no-repeat; background-position: center center; }

.uno_filter .uno_filter-icon.reverse { background: #FFFFFF; border-radius: 5px; padding: 5px; display: inline-block; vertical-align: middle; border: none; }
.uno_filter .uno_filter-icon.reverse .icon { display: block; height: 30px; width: 30px; background-image: url("/imgs/ordre_alpha_za_noir_bis.svg"); background-repeat: no-repeat; background-position: center center; }
.uno_filter .uno_filter-icon.reverse.blank { background: #333333; border-radius: 5px; padding: 5px; display: inline-block; vertical-align: middle; border: none; }
.uno_filter .uno_filter-icon.reverse.blank .icon { display: block; height: 30px; width: 30px; background-image: url("/imgs/ordre_alpha_za_blank_bis.svg"); background-repeat: no-repeat; background-position: center center; }

.modal-content.uno {
    width: 100% !important;
    height: auto;
}
.dropdown { margin-bottom: 20px; }
.dropdown .dropdown-menu { left: auto; right: 0; }

#loader {
    width:192px;
    margin:10px;
}
/* Fixe les modals sur le milieu de l'écran */
/** Mobile **/

@media screen and (max-device-width: 1000px) and (orientation: portrait) {
    #sidebar {
        width: 99%;
    }
}

@media (max-width: 767px) {
    .uno_80-width { width: 100%; }
    .uno_login-wrapper { position: relative; width: 80%; }
    .uno_login-wrapper .uno_login-logo_mobile { position: absolute; top: -100px; left: 0; right: 0;  }
    .img-responsive { max-height: 280px; }
    .uno_login-logo h1 { font-size: 60px; margin-bottom: 60px; }
    .uno_login-block .form-horizontal { max-width: 100%; }
    .uno_login-block .form-horizontal .btn-primary { margin-top: 20px; margin-bottom: 40px; }
}

@media (max-width: 767px) {
    .assistance-text {
        display: inline;
    }
}

@media (min-width: 768px) {
    .assistance-text {
        display: none;
    }
}
.navbar-top {
    position: fixed;
    top: 50px;
    left: 0;
    padding: 0;
    height: auto;
    background-color: transparent;
    border: none;
    box-shadow: none;
    z-index: 1000;
    overflow-x: auto;
    width: auto;
    max-width: 100%;
}

.navbar-top::-webkit-scrollbar {
    height: 3px;
    background-color: transparent;
}

.navbar-top::-webkit-scrollbar-thumb {
    background-color: rgba(0, 120, 215, 0.5);
    border-radius: 3px;
}

.navbar-top::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 120, 215, 0.8);
}

.navbar-top .navbar-nav {
    display: flex;
    flex-wrap: nowrap;
    list-style-type: none;
    padding: 0;
    margin: 0;
    gap: 6px;
}

.navbar-top .navbar-nav li {
    margin-right: 0;
    flex-shrink: 0;
}

.navbar-top .navbar-nav li a.site {
    display: inline-block;
    text-decoration: none;
    padding: 6px 14px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #0078d7;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    color: #0078d7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar-top .navbar-nav li a.site:hover {
    background-color: #e6f2ff;
    border-color: #005a9e;
    color: #005a9e;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 120, 215, 0.25);
}

.navbar-top .navbar-nav li a.site.selectedSite {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: #ffffff;
    border-color: #005a9e;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 120, 215, 0.4);
}

.navbar-top .navbar-nav li a.site.selectedSite:hover {
    background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
    color: #ffffff;
}

/* Sites container */
#sites {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin: 0;
}

#sites > li {
    list-style: none;
}

@media only screen and (max-width: 390px) {
    #battery-text {
        display: none;
    }
}

@media only screen and (max-width: 768px) {
    .navbar-top {
        width: 100%;
        top: 45px;
    }

    #sites {
        padding: 6px 8px;
        gap: 5px;
    }

    .navbar-top .navbar-nav li a.site {
        padding: 5px 12px;
        font-size: 11px;
        border-radius: 16px;
    }
}

 .notification-toast-container {
     position: fixed;
     top: 10px;
     right: 10px;
     z-index: 1050;
     max-width: 90vw;
 }

.notification-toast {
    background-color: #f5f5f5;
    border-left: 5px solid #337ab7;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
    animation: fadeSlideIn 0.3s ease-in-out;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   History Table Styles
   Color principal del sitio: #0078d7
   ======================================== */

/* ========================================
   UNIFIED MODAL STYLES - AIRvisu Design System
   Aplicado a: Todos los modales
   Estilo consistente tipo Dashboard
   ======================================== */

/* Base modal dialog - todos los modales grandes - solo cuando están activos (.in) */
#pivot_history.in .modal-dialog,
#pivot_recus.in .modal-dialog,
#history_export.in .modal-dialog,
#pivot_culture.in .modal-dialog,
#modalFormContainer.in .modal-dialog,
#pivot_camera.in .modal-dialog {
    width: 90vw !important;
    max-width: 800px !important;
    height: auto !important;
    max-height: 90vh !important;
    margin: 0 !important;
}

/* Centrado vertical para modales cuando están activos */
#pivot_history.modal.in,
#pivot_recus.modal.in,
#history_export.modal.in,
#pivot_culture.modal.in,
#modalFormContainer.modal.in,
#pivot_camera.modal.in {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px !important;
}

/* Modal content - estilo unificado con borde claro */
#pivot_history .modal-content,
#pivot_recus .modal-content,
#history_export .modal-content,
#pivot_culture .modal-content,
#modalFormContainer .modal-content,
#pivot_camera .modal-content,
#profileModale .modal-content {
    width: 100% !important;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

/* Header unificado - estilo dashboard azul */
#pivot_history .modal-header,
#pivot_recus .modal-header,
#history_export .modal-header,
#pivot_culture .modal-header,
#modalFormContainer .modal-header,
#pivot_camera .modal-header,
#profileModale .modal-header,
#ordres .modal-header,
#confirm-modal .modal-header,
#stopProg-modal .modal-header,
#notifModal .modal-header,
#modal-alert .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: white;
    padding: 15px 20px;
    border-bottom: none;
    flex-shrink: 0;
    border-radius: 10px 10px 0 0;
}

#pivot_history .modal-header .modal-title,
#pivot_recus .modal-header .modal-title,
#history_export .modal-header .modal-title,
#pivot_culture .modal-header .modal-title,
#modalFormContainer .modal-header .modal-title,
#pivot_camera .modal-header .modal-title,
#profileModale .modal-header .modal-title,
#ordres .modal-header .modal-title,
#confirm-modal .modal-header .modal-title,
#stopProg-modal .modal-header .modal-title,
#notifModal .modal-header .modal-title,
#modal-alert .modal-header .modal-title {
    color: white;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

#pivot_history .modal-header .close,
#pivot_recus .modal-header .close,
#history_export .modal-header .close,
#pivot_culture .modal-header .close,
#modalFormContainer .modal-header .close,
#pivot_camera .modal-header .close,
#profileModale .modal-header .close,
#ordres .modal-header .close,
#confirm-modal .modal-header .close,
#stopProg-modal .modal-header .close,
#notifModal .modal-header .close,
#modal-alert .modal-header .close {
    color: white;
    opacity: 0.9;
    text-shadow: none;
    font-size: 24px;
    font-weight: 300;
    margin-top: -2px;
}

#pivot_history .modal-header .close:hover,
#pivot_recus .modal-header .close:hover,
#history_export .modal-header .close:hover,
#pivot_culture .modal-header .close:hover,
#modalFormContainer .modal-header .close:hover,
#pivot_camera .modal-header .close:hover,
#profileModale .modal-header .close:hover,
#ordres .modal-header .close:hover,
#confirm-modal .modal-header .close:hover,
#stopProg-modal .modal-header .close:hover,
#notifModal .modal-header .close:hover,
#modal-alert .modal-header .close:hover {
    color: white;
    opacity: 1;
}

/* Body unificado - fondo gris claro */
#pivot_history .modal-body,
#pivot_recus .modal-body,
#history_export .modal-body,
#pivot_culture .modal-body,
#modalFormContainer .modal-body,
#pivot_camera .modal-body,
#profileModale .modal-body,
#confirm-modal .modal-body,
#stopProg-modal .modal-body,
#notifModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f8f9fa;
}

/* Footer unificado */
#history_export .modal-footer,
#ordres .modal-footer,
#confirm-modal .modal-footer,
#stopProg-modal .modal-footer,
#notifModal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 15px 20px;
    border-radius: 0 0 6px 6px;
}

/* Tablet */
@media (max-width: 992px) {
    #pivot_history .modal-dialog,
    #pivot_recus .modal-dialog,
    #history_export .modal-dialog,
    #pivot_culture .modal-dialog,
    #modalFormContainer .modal-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        margin: 5vh auto !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    #pivot_history .modal-dialog,
    #pivot_recus .modal-dialog,
    #history_export .modal-dialog,
    #pivot_culture .modal-dialog,
    #modalFormContainer .modal-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
    }
    
    #pivot_history .modal-content,
    #pivot_recus .modal-content,
    #history_export .modal-content,
    #pivot_culture .modal-content,
    #modalFormContainer .modal-content {
        border-radius: 0;
        max-height: 100vh;
    }
    
    #pivot_history .modal-header,
    #pivot_recus .modal-header,
    #history_export .modal-header,
    #pivot_culture .modal-header,
    #modalFormContainer .modal-header {
        border-radius: 0;
    }
    
    #pivot_history .modal-body,
    #pivot_recus .modal-body,
    #history_export .modal-body {
        padding: 15px;
    }
}

/* ========================================
   Unified Form Controls - AIRvisu Style
   Only apply to actual modals
   ======================================== */

/* Form groups en modales */
.modal .modal-body .form-group {
    margin-bottom: 15px;
}

.modal .modal-body .form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

/* Inputs unificados */
.modal .modal-body input[type="text"],
.modal .modal-body input[type="email"],
.modal .modal-body input[type="tel"],
.modal .modal-body input[type="date"],
.modal .modal-body input[type="number"],
.modal .modal-body select.form-control,
.modal .modal-body textarea.form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.modal .modal-body input[type="text"]:focus,
.modal .modal-body input[type="email"]:focus,
.modal .modal-body input[type="tel"]:focus,
.modal .modal-body input[type="date"]:focus,
.modal .modal-body input[type="number"]:focus,
.modal .modal-body select.form-control:focus,
.modal .modal-body textarea.form-control:focus {
    border-color: #0078d7;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.15);
    outline: none;
}

/* Radio buttons estilizados */
.modal .modal-body .radio-inline,
.modal .modal-body .checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 10px;
}

.modal .modal-body .radio-inline:hover,
.modal .modal-body .checkbox-inline:hover {
    border-color: #0078d7;
    background: #e6f2ff;
}

.modal .modal-body .radio-inline input[type="radio"]:checked + span,
.modal .modal-body .radio-inline:has(input[type="radio"]:checked) {
    background: #0078d7;
    color: white;
    border-color: #0078d7;
}

/* Contenedor blanco para secciones */
.modal-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.modal-section h4,
.modal-section h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section h4 .glyphicon,
.modal-section h5 .glyphicon {
    color: #0078d7;
}

/* Botones unificados - solo en modales */
.modal .modal-footer .btn-primary,
.modal .modal-body .btn-primary {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 120, 215, 0.3);
}

.modal .modal-footer .btn-primary:hover,
.modal .modal-body .btn-primary:hover {
    background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 120, 215, 0.4);
}

.modal .modal-footer .btn-default,
.modal .modal-body .btn-default {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s;
}

.modal .modal-footer .btn-default:hover,
.modal .modal-body .btn-default:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* ========================================
   Export Modal Specific Styles
   ======================================== */
#history_export .modal-body {
    padding: 0;
}

#history_export .modal-body > h4 {
    background: #fff;
    margin: 0;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e9ecef;
}

#history_export .modal-body > h4:not(:first-child) {
    border-top: 1px solid #e9ecef;
    margin-top: 0;
}

#history_export .modal-body > .form-group {
    background: #fff;
    padding: 15px 20px;
    margin: 0;
}

#history_export .modal-body > .form-group .row {
    margin: 0 -10px;
}

#history_export .modal-body > .form-group .col-xs-6 {
    padding: 0 10px;
}

#history_export #history_export_feedback {
    margin: 15px 20px;
    border-radius: 6px;
}

/* ========================================
   Preferences Dropdown Menu
   ======================================== */
.dropdown-menu.preferences-menu {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    border: none;
    padding: 10px 0;
    min-width: 280px;
}

.dropdown-menu .switch-container-menu {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-menu .switch-container-menu:hover {
    background: #f8f9fa;
}

.dropdown-menu .switch-container-menu:last-child {
    border-bottom: none;
}

/* ========================================
   Orders Modal - Dark Theme Preserved
   ======================================== */
#ordres .modal-dialog {
    width: 95vw !important;
    max-width: 600px !important;
}

#ordres .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid #d0d0d0;
}

#ordres .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
}

#ordres .modal-body {
    background-color: white !important;
    padding: 20px;
    color: #333;
}

#ordres .modal-footer {
    background: #2d2d2d;
    border-top: 1px solid #444;
}

#ordres .modal-footer .btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

#ordres .modal-footer .btn-default {
    background: #444;
    color: #fff;
    border-color: #555;
}

#ordres .modal-footer .btn-default:hover {
    background: #555;
}

/* ========================================
   Confirmation Modal
   ======================================== */
#confirm-modal .modal-dialog {
    width: 90vw !important;
    max-width: 450px !important;
}

#confirm-modal .modal-content {
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

/* ========================================
   Preferences Dropdown - Dashboard Style  
   ======================================== */
#navbar .dropdown-menu,
.navbar-nav .dropdown-menu {
    background: #fff !important;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    padding: 8px 0;
    margin-top: 5px;
}

.navbar-nav .dropdown-menu > li > a {
    color: #333 !important;
    padding: 10px 20px;
    transition: all 0.2s;
}

.navbar-nav .dropdown-menu > li > a:hover {
    background: #e6f2ff !important;
    color: #0078d7 !important;
}

.navbar-nav .dropdown-menu .switch-container-menu {
    padding: 10px 20px;
    color: #333 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-nav .dropdown-menu .switch-container-menu .switch-label {
    color: #333 !important;
}

.navbar-nav .dropdown-menu .switch-container-menu:hover {
    background: #f8f9fa;
}

.navbar-nav .dropdown-menu .divider {
    background-color: #e9ecef;
    margin: 8px 0;
}

/* ========================================
   Preferences Menu - Tablet & Mobile
   ======================================== */

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .navbar-nav .dropdown-menu {
        min-width: 280px;
    }

    .navbar-nav .dropdown-menu .switch-container-menu {
        padding: 14px 16px;
    }

    .navbar-nav .dropdown-menu .switch-container-menu .switch-label {
        font-size: 14px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    /* Dropdown menu full width on mobile */
    .navbar-nav .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2) !important;
        max-height: 70vh;
        overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        animation: slideUpMenu 0.25s ease-out;
    }

    @keyframes slideUpMenu {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* Header indicator for mobile menu */
    .navbar-nav .dropdown-menu::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        background: #dee2e6;
        border-radius: 2px;
        margin: 12px auto 8px;
    }

    /* Larger touch targets */
    .navbar-nav .dropdown-menu .switch-container-menu {
        padding: 16px 20px;
        min-height: 56px;
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-nav .dropdown-menu .switch-container-menu:last-child {
        border-bottom: none;
    }

    .navbar-nav .dropdown-menu .switch-container-menu .switch-label {
        font-size: 15px;
        flex: 1;
        padding-right: 12px;
    }

    /* Larger switch on mobile */
    .navbar-nav .dropdown-menu .switch-container-menu .switch {
        width: 50px;
        height: 28px;
        flex-shrink: 0;
    }

    .navbar-nav .dropdown-menu .switch-container-menu .slider:before {
        width: 22px;
        height: 22px;
        left: 3px;
    }

    .navbar-nav .dropdown-menu .switch-container-menu input:checked + .slider:before {
        transform: translate(22px, -50%);
    }

    /* Links in menu */
    .navbar-nav .dropdown-menu > li > a {
        padding: 16px 20px;
        font-size: 15px;
        display: flex;
        align-items: center;
        min-height: 56px;
    }

    .navbar-nav .dropdown-menu > li > a .glyphicon {
        font-size: 18px;
        margin-right: 12px;
        color: #0078d7;
    }

    /* Divider */
    .navbar-nav .dropdown-menu .divider {
        margin: 4px 20px;
        height: 1px;
    }

    /* Backdrop overlay for mobile menu */
    .navbar-nav.open .dropdown-backdrop {
        background: rgba(0, 0, 0, 0.4);
    }

    /* Collapsed navbar adjustments */
    .navbar-collapse.in {
        max-height: calc(100vh - 50px);
        overflow-y: auto;
    }

    .navbar-collapse.in .navbar-nav {
        margin: 0;
    }

    .navbar-collapse.in .navbar-nav > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-collapse.in .navbar-nav > li > a {
        padding: 15px 20px;
    }

    /* Profile button on mobile */
    .navbar-collapse.in #profileButton {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .navbar-collapse.in #profileButton p {
        margin: 0;
    }
}

/* Small mobile (< 480px) */
@media (max-width: 480px) {
    .navbar-nav .dropdown-menu {
        max-height: 80vh;
    }

    .navbar-nav .dropdown-menu .switch-container-menu .switch-label {
        font-size: 14px;
    }

    /* Stack long labels if needed */
    .navbar-nav .dropdown-menu .switch-container-menu {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ========================================
   Filter Selects - Recus/History modals
   ======================================== */
.modal-controls-bar select,
#pivot_recus select,
#pivot_history select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    background: #fff;
    color: #333;
    min-width: 150px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-controls-bar select:focus,
#pivot_recus select:focus,
#pivot_history select:focus {
    border-color: #0078d7;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.15);
    outline: none;
}

/* Radio buttons - selected state with CSS */
.modal .modal-body .radio-inline.selected,
.modal .modal-body .radio-inline:has(input:checked) {
    background: #0078d7;
    color: white;
    border-color: #0078d7;
}

.modal .modal-body .radio-inline.selected .glyphicon,
.modal .modal-body .radio-inline:has(input:checked) .glyphicon {
    color: white;
}

/* Filters row in modals */
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filters-row label {
    font-weight: 500;
    color: #495057;
    margin: 0;
}

/* ========================================
   History Modal Specific Styles
   ======================================== */

/* Barra de controles unificada para modales */
.modal-controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.modal-controls-left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.modal-controls-left select {
    min-width: 150px;
}

.modal-controls-left label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    margin-right: 8px;
}

/* Contenedor de tabla con scroll */
.modal-table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.modal-table-container .table {
    margin-bottom: 0;
}

/* Estilos de tabla mejorados */
.modal-table-container .table thead th,
#historyTable .table thead th,
#recusTable thead th {
    background-color: #0078d7;
    color: #fff;
    font-weight: 600;
    padding: 12px 15px;
    border: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-table-container .table tbody td,
#historyTable .table tbody td,
#recusTable tbody td {
    padding: 10px 15px;
    vertical-align: middle;
    border-color: #e9ecef;
    font-size: 14px;
}

.modal-table-container .table tbody tr:hover,
#historyTable .table tbody tr:hover,
#recusTable tbody tr:hover {
    background-color: #e6f2ff;
}

/* Responsive para modales */
@media (max-width: 768px) {
    .modal-controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }
    
    .modal-controls-left {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-controls-left select {
        width: 100%;
    }
}

/* Botón Exportar unificado */
.btn-export {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-export:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.btn-export .glyphicon {
    font-size: 12px;
}

/* Paginación unificada */
#paginationContent,
#paginationRecusContent {
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#paginationContent .pagination,
#paginationRecusContent .pagination {
    margin: 0;
    justify-content: center;
}

#paginationContent .pagination li a,
#paginationRecusContent .pagination li a {
    color: #0078d7;
    border-color: #dee2e6;
    padding: 8px 14px;
    border-radius: 4px;
    margin: 0 2px;
}

#paginationContent .pagination li.active a,
#paginationContent .pagination li a.active,
#paginationRecusContent .pagination li.active a,
#paginationRecusContent .pagination li a.active {
    background-color: #0078d7;
    border-color: #0078d7;
    color: #fff;
}

#paginationContent .pagination li a:hover,
#paginationRecusContent .pagination li a:hover {
    background-color: #e6f2ff;
    color: #005a9e;
}

#pivot_history .modal-body {
    padding: 15px;
}

#historyTable .table {
    margin-bottom: 0;
}

#historyTable .table thead th {
    background-color: #0078d7;
    color: #fff;
    font-weight: 600;
    padding: 12px 15px;
    border: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#historyTable .table tbody td {
    padding: 10px 15px;
    vertical-align: middle;
    border-color: #e9ecef;
    font-size: 14px;
}

#historyTable .table tbody tr:hover {
    background-color: #e6f2ff;
}

/* Numeric columns styling */
#historyTable .table tbody td[data-label="Heures"],
#historyTable .table tbody td[data-label="Apport (mm)"] {
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-weight: 500;
    color: #2c3e50;
}

/* Date column */
#historyTable .table tbody td[data-label="Date"] {
    white-space: nowrap;
    color: #495057;
}

/* Pagination styling */
#paginationContent .pagination {
    margin: 15px 0 5px 0;
    justify-content: center;
}

#paginationContent .pagination li a {
    color: #0078d7;
    border-color: #dee2e6;
    padding: 8px 14px;
}

#paginationContent .pagination li.active a,
#paginationContent .pagination li a.active {
    background-color: #0078d7;
    border-color: #0078d7;
    color: #fff;
}

#paginationContent .pagination li a:hover {
    background-color: #e6f2ff;
    color: #005a9e;
}

/* Selector styling */
#pivot_history_selector select,
#pivot_history_sector select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    font-size: 14px;
    margin-right: 10px;
    margin-bottom: 10px;
}

#pivot_history_selector select:focus,
#pivot_history_sector select:focus {
    border-color: #0078d7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 120, 215, 0.2);
}

/* Export button in history modal */
.history-export-btn {
    background-color: #28a745;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-export-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.history-export-btn .glyphicon {
    margin-right: 6px;
}

/* History modal header actions */
.history-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

/* Received data table (recusTable) - same styling */
#recusTable .table thead th {
    background-color: #0078d7;
    color: #fff;
    font-weight: 600;
    padding: 12px 15px;
    border: none;
}

#recusTable .table tbody tr:hover {
    background-color: #e6f2ff;
}

#paginationRecusContent .pagination li a {
    color: #0078d7;
}

#paginationRecusContent .pagination li.active a,
#paginationRecusContent .pagination li a.active {
    background-color: #0078d7;
    border-color: #0078d7;
    color: #fff;
}

/* ========================================
   Dashboard Styles - Los estilos principales están en dashboard.css
   ======================================== */
/* NOTA: Los estilos de tamaño del modal del dashboard están en dashboard.css */
/* No duplicar aquí para evitar conflictos */

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dashboard-pivot-selector,
.dashboard-period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-pivot-selector label,
.dashboard-period-selector label {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.dashboard-pivot-selector select {
    min-width: 200px;
}

.dashboard-period-btn {
    border-color: #0078d7;
    color: #0078d7;
}

.dashboard-period-btn.active,
.dashboard-period-btn:hover {
    background-color: #0078d7;
    border-color: #0078d7;
    color: #fff;
}

/* KPI Cards */
.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-kpis {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.kpi-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #0078d7;
    opacity: 0.3;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.kpi-label {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
}

.kpi-unit {
    font-size: 11px;
    color: #adb5bd;
    text-transform: uppercase;
}

.kpi-variation {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
}

.kpi-variation.positive {
    color: #28a745;
}

.kpi-variation.negative {
    color: #dc3545;
}

.kpi-variation.neutral {
    color: #6c757d;
}

/* Charts */
.dashboard-charts {
    margin-bottom: 20px;
}

.dashboard-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-container h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.chart-container h5 .glyphicon {
    margin-right: 8px;
    color: #0078d7;
}

/* Period Info */
.dashboard-period-info {
    text-align: center;
    padding: 10px;
    color: #6c757d;
}

.dashboard-period-info strong {
    color: #495057;
}

/* Dashboard Button in Pivot Actions */
.btn-dashboard {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
    padding: 4px 8px;
    margin-right: 3px;
}

.btn-dashboard:hover,
.btn-dashboard:focus {
    background-color: #138496;
    border-color: #117a8b;
    color: #fff;
}

.btn-dashboard .glyphicon {
    font-size: 14px;
}

/* History Button - icon style */
.btn-history {
    padding: 4px 8px;
    margin-right: 3px;
}

.btn-history .glyphicon {
    font-size: 14px;
}

/* Loading state for charts */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6c757d;
}

/* Empty state for charts */
.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: #adb5bd;
    font-style: italic;
}

/* KPI Card variants */
.kpi-card.kpi-warning {
    border-left: 4px solid #ff9800;
}

.kpi-card.kpi-warning .kpi-icon {
    color: #ff9800;
}

.kpi-card.kpi-info {
    border-left: 4px solid #17a2b8;
}

.kpi-card.kpi-info .kpi-icon {
    color: #17a2b8;
}

.kpi-card.kpi-success {
    border-left: 4px solid #28a745;
}

.kpi-card.kpi-success .kpi-icon {
    color: #28a745;
}

/* Dashboard KPI second row - smaller values */
.dashboard-kpis + .dashboard-kpis .kpi-value {
    font-size: 20px;
}

.dashboard-kpis + .dashboard-kpis .kpi-card {
    padding: 10px 12px;
}

/* ========================================
   Notification Wrapper (WebSocket)
   ======================================== */
#airvisu-notification-wrapper {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 1040;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s, z-index 0.3s;
}

.airvisu-notification {
    background: rgba(255, 255, 255, 0.95);
    border-left: 4px solid #0078d7;
    border-radius: 6px;
    padding: 10px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 220px;
    max-width: 320px;
    font-size: 13px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.airvisu-notification:hover {
    background: rgba(230, 242, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0, 120, 215, 0.25);
}

.airvisu-notification .glyphicon {
    color: #0078d7;
    font-size: 16px;
}

.airvisu-notification .pivot-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.airvisu-notification .pivot-angle {
    font-weight: 600;
    color: #0078d7;
    background: #e6f2ff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.airvisu-notification .close-btn {
    color: #999;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}

.airvisu-notification .close-btn:hover {
    color: #dc3545;
}

/* Hide notifications when modal is open */
body.modal-open #airvisu-notification-wrapper {
    z-index: 1 !important;
    opacity: 0.2;
    pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #airvisu-notification-wrapper {
        left: 10px;
        right: 10px;
        bottom: 60px;
    }
    
    .airvisu-notification {
        max-width: 100%;
        min-width: auto;
    }
}

/* ========================================
   Profile Modal - Centered Styles
   ======================================== */
#profileModale.modal.in {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px !important;
}

#profileModale.in .modal-dialog {
    width: 90vw !important;
    max-width: 450px !important;
    height: auto !important;
    max-height: 90vh !important;
    margin: 0 !important;
}

#profileModale .modal-content {
    width: 100% !important;
    height: auto !important;
    max-height: 90vh;
    display: block !important;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: none;
}

#profileModale .modal-body {
    flex: none !important;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f8f9fa;
    height: auto !important;
}

/* Profile form styles */
#profile_form_wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 15px !important;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
    min-height: 0 !important;
    height: auto !important;
}

#profile_form_wrapper.well {
    height: auto !important;
    min-height: 0 !important;
}

#profile_form_wrapper * {
    min-height: 0 !important;
}

#profile_form_wrapper .form-group {
    margin-bottom: 12px !important;
    min-height: 0 !important;
}

#profile_form_wrapper .form-group:last-child {
    margin-bottom: 0 !important;
}

#profile_form_wrapper .form-group.row {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 0 15px 0 !important;
    min-height: 0 !important;
    gap: 5px !important;
}

#profile_form_wrapper .form-group.row::before,
#profile_form_wrapper .form-group.row::after {
    display: none !important;
}

#profile_form_wrapper .col-xs-4,
#profile_form_wrapper .col-xs-8 {
    width: 100% !important;
    padding: 0 !important;
    float: none !important;
    position: relative !important;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
    flex: none !important;
}

#profile_form_wrapper .col-xs-4 {
    margin-bottom: 0 !important;
    height: auto !important;
}

#profile_form_wrapper .col-xs-8 {
    height: auto !important;
}

#profile_form_wrapper label,
#profile_form_wrapper .control-label {
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 14px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: left !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
}

#profile_form_wrapper input.form-control,
#profile_form_wrapper input[type="text"],
#profile_form_wrapper input[type="tel"],
#profile_form_wrapper input[type="email"] {
    width: 100% !important;
    height: 40px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    border: 1px solid #ced4da !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #333 !important;
    box-sizing: border-box !important;
    display: block !important;
    margin: 0 !important;
}

#profile_form_wrapper input.form-control:focus {
    border-color: #0078d7 !important;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.15) !important;
    outline: none !important;
}

#profile_button_wrapper {
    margin-top: 15px;
}

#profile_button_wrapper .btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
}

/* Disconnect button section */
#profileModale .well {
    border: none;
    margin-bottom: 0;
}

#profile_disconnect_button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

#profile_disconnect_button:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

/* Mobile responsive for Profile modal */
@media (max-width: 768px) {
    #profileModale.in .modal-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
    }
}
/* =========================================================
   AIRVISU - MODAL CENTERING (Bootstrap 3)
   Centrado vertical + horizontal
   Optimizado para mobile
   ========================================================= */

/* Lista explícita de modales problemáticos */
#modal.in,
#confirm-modal.in,
#ordres.in,
#stopProg-modal.in {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow-y: auto;
}

/* El diálogo NO debe tener margen en BS3 */
#modal.in .modal-dialog,
#confirm-modal.in .modal-dialog,
#ordres.in .modal-dialog,
#stopProg-modal.in .modal-dialog {
    margin: 0 !important;
    width: calc(100% - 20px);
    max-width: 520px;
}

/* Contenedor interno flexible - unified style */
#modal .modal-content,
#confirm-modal .modal-content,
#ordres .modal-content,
#stopProg-modal .modal-content,
#notifModal .modal-content,
#modal-alert .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 20px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

/* Scroll interno solo si hace falta */
#modal .modal-body,
#confirm-modal .modal-body,
#ordres .modal-body,
#stopProg-modal .modal-body {
    overflow-y: auto;
}

/* ---------- MOBILE ---------- */
@media (max-width: 767px) {
    #modal.in,
    #confirm-modal.in,
    #ordres.in,
    #stopProg-modal.in {
        padding: 6px;
    }

    #modal.in .modal-dialog,
    #confirm-modal.in .modal-dialog,
    #ordres.in .modal-dialog,
    #stopProg-modal.in .modal-dialog {
        width: calc(100% - 12px);
        max-width: none;
    }

    #modal .modal-header,
    #confirm-modal .modal-header,
    #ordres .modal-header,
    #stopProg-modal .modal-header,
    #modal .modal-body,
    #confirm-modal .modal-body,
    #ordres .modal-body,
    #stopProg-modal .modal-body,
    #modal .modal-footer,
    #confirm-modal .modal-footer,
    #ordres .modal-footer,
    #stopProg-modal .modal-footer {
        padding: 10px;
    }
}

/* ---------- PANTALLAS BAJAS ---------- */
@media (max-height: 520px) {
    #modal.in,
    #confirm-modal.in,
    #ordres.in,
    #stopProg-modal.in {
        align-items: flex-start;
    }
}

/* ===========================================
   MODAL ALERT - Email Confirmation Form
   =========================================== */

#modal-alert .modal-body {
    padding: 20px;
    background: #fff;
}

#modal-alert .modal-body input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#modal-alert .modal-body input[type="email"]:focus {
    outline: none;
    border-color: #0078d7;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.15);
}

#modal-alert .modal-body .btn-primary {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#modal-alert .modal-body .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.3);
}

#modal-alert .modal-body .btn-primary:active {
    transform: translateY(0);
}

/* ===========================================
   ALARMES MANAGER STYLES
   =========================================== */

/* Device alarmes container in accordion - MUST have scroll */
.device-alarmes {
    max-height: 300px !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    display: block !important;
    position: relative;
}

/* Make sure panel-body doesn't block scroll */
.panel-body {
    overflow: visible;
}

.alarmes-manager {
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    /* Don't set overflow here - let parent handle it */
}

.alarmes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
}

.alarmes-title {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

/* ===========================================
   UNIFIED ADD BUTTONS - All accordion sections
   =========================================== */

/* Base style for all add/create buttons in accordion panels */
.alarmes-add-btn,
.btn-add-sector,
.btn-add-program,
.btn-add-geofence,
.panel-body .btn-primary,
.device-sectors .btn-primary,
.device-programs .btn-primary,
.device-geofence .btn-primary {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 120, 215, 0.2);
}

.alarmes-add-btn:hover,
.btn-add-sector:hover,
.btn-add-program:hover,
.btn-add-geofence:hover,
.panel-body .btn-primary:hover,
.device-sectors .btn-primary:hover,
.device-programs .btn-primary:hover,
.device-geofence .btn-primary:hover {
    background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 120, 215, 0.3);
    color: #fff;
}

.alarmes-add-btn:active,
.btn-add-sector:active,
.btn-add-program:active,
.btn-add-geofence:active,
.panel-body .btn-primary:active,
.device-sectors .btn-primary:active,
.device-programs .btn-primary:active,
.device-geofence .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 120, 215, 0.2);
}

/* Outline variant for secondary add buttons */
.btn-add-outline,
.device-geofence .btn-outline-primary {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    background: #fff;
    border: 2px solid #0078d7;
    border-radius: 6px;
    color: #0078d7;
    transition: all 0.2s ease;
}

.btn-add-outline:hover,
.device-geofence .btn-outline-primary:hover {
    background: #0078d7;
    color: #fff;
}

/* GeoFence Manager - Spinner et améliorations */
.device-geofence .gf-save-spinner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.device-geofence .glyphicon-spin {
    animation: gf-spin 1s infinite linear;
}

@keyframes gf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.device-geofence .btn-success {
    min-width: 160px;
    transition: all 0.2s ease;
}

.device-geofence .btn-success:disabled {
    opacity: 0.7;
    cursor: wait;
}

.device-geofence .table-bordered th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-geofence .table-bordered td {
    vertical-align: middle;
}

.device-geofence .table input.form-control {
    text-align: center;
}

.device-geofence #gf-msg {
    font-size: 13px;
    padding: 4px 0;
}

.device-geofence [id^="gf-footer-"] {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Estados de carga de la tabla */
.device-geofence .gf-loading-row td,
.device-geofence .gf-empty-row td,
.device-geofence .gf-error-row td {
    background: #fafbfc !important;
}

.device-geofence .gf-loading-row .glyphicon-spin {
    color: #0078d7;
}

.device-geofence .gf-empty-row .glyphicon {
    color: #bbb;
}

.device-geofence .gf-error-row .glyphicon {
    color: #d9534f;
}

/* Alarmes content - scrollable list */
.alarmes-content {
    min-height: 60px;
    /* No max-height here - parent handles scroll */
}

/* Alarmes list inside content */
.alarmes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
}

/* Custom scrollbar for device-alarmes container */
.device-alarmes::-webkit-scrollbar {
    width: 8px;
}

.device-alarmes::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.device-alarmes::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 4px;
}

.device-alarmes::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.alarmes-loading,
.alarmes-error,
.alarmes-empty {
    text-align: center;
    padding: 25px 15px;
    color: #666;
}

.alarmes-empty .glyphicon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
    color: #ccc;
}

.alarmes-empty p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.alarmes-empty small {
    font-size: 12px;
    color: #999;
}

.alarmes-error {
    color: #e74c3c;
}

.alarme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.alarme-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.alarme-item.inactive {
    opacity: 0.6;
    background: #f5f5f5;
}

.alarme-item.active {
    border-left: 3px solid #f39c12;
}

.alarme-item.permanent {
    border-left: 3px solid #27ae60;
    background: #f0fff4;
}

.alarme-info {
    flex: 1;
    min-width: 0;
}

.alarme-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.alarme-icon {
    font-size: 16px;
    color: #3498db;
}

.alarme-angle {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.alarme-details {
    display: flex;
    gap: 10px;
    font-size: 12px;
}

.alarme-envoi {
    color: #666;
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.alarme-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.alarme-status.status-ponctuelle {
    background: #fff3cd;
    color: #856404;
}

.alarme-status.status-permanent {
    background: #d4edda;
    color: #155724;
}

.alarme-status.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Select dropdown for actif type */
.alarme-actif-select {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    min-width: 100px;
}

.alarme-actif-select:focus {
    outline: none;
    border-color: #3498db;
}

/* DateTime display for type 20 */
.alarme-datetime {
    font-size: 11px;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

.alarme-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

/* Toggle switch for alarmes */
.alarme-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    margin: 0;
}

.alarme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.alarme-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.alarme-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
}

.alarme-toggle input:checked + .toggle-slider {
    background-color: #27ae60;
}

.alarme-toggle input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.alarme-delete {
    padding: 4px 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.alarme-delete:hover {
    opacity: 1;
}

/* ===========================================
   GLOBAL ALARMES STYLES
   =========================================== */

/* Section headers for alarmes list */
.alarmes-section-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alarmes-section-header.global-section {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 3px solid #1565c0;
}

.alarmes-section-header.global-section .glyphicon {
    color: #1565c0;
}

.alarmes-section-header.pivot-section {
    background: #f5f5f5;
    color: #666;
    border-left: 3px solid #999;
    margin-top: 12px;
}

/* Global alarme item styling */
.alarme-item.alarme-global {
    border-left: 3px solid #1565c0;
    background: #f3f8fc;
}

.alarme-item.alarme-global:hover {
    background: #e3f2fd;
}

.alarme-item.alarme-global.permanent {
    border-left: 3px solid #1565c0;
    background: #e8f5e9;
}

/* Global badge on alarme name */
.alarme-global-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1565c0;
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

.alarme-global-badge .glyphicon {
    font-size: 10px;
    color: #fff;
}

/* Global checkbox group in modal */
#globalGroup-checkbox,
[id^="globalGroup-"] {
    margin-top: 12px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
    border-left: 3px solid #1565c0;
}

[id^="globalGroup-"] label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    color: #1565c0;
}

[id^="globalGroup-"] label input[type="checkbox"] {
    margin: 0;
}

[id^="globalGroup-"] .help-block {
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 11px;
    color: #666;
}

/* Modal styles for adding alarmes - Style matching ordres popup */
#addAlarmeModal .modal-content,
[id^="addAlarmeModal-"] .modal-content {
    background: #fff;
    color: #333;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

#addAlarmeModal .modal-header,
[id^="addAlarmeModal-"] .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: #fff;
    border-bottom: none;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
}

#addAlarmeModal .modal-header .modal-title,
[id^="addAlarmeModal-"] .modal-header .modal-title {
    color: #fff;
    font-weight: 500;
    font-size: 18px;
}

#addAlarmeModal .modal-header .close,
[id^="addAlarmeModal-"] .modal-header .close {
    color: #fff;
    opacity: 0.8;
    text-shadow: none;
    font-size: 24px;
}

#addAlarmeModal .modal-header .close:hover,
[id^="addAlarmeModal-"] .modal-header .close:hover {
    opacity: 1;
}

#addAlarmeModal .modal-body,
[id^="addAlarmeModal-"] .modal-body {
    background: #fff;
    padding: 20px;
    color: #333;
}

#addAlarmeModal .form-control,
[id^="addAlarmeModal-"] .form-control {
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    border-radius: 4px;
    height: 38px;
}

#addAlarmeModal .form-control:focus,
[id^="addAlarmeModal-"] .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#addAlarmeModal label,
[id^="addAlarmeModal-"] label {
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

#addAlarmeModal .modal-footer,
[id^="addAlarmeModal-"] .modal-footer {
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    padding: 15px 20px;
    border-radius: 0 0 10px 10px;
}

#addAlarmeModal .modal-footer .btn-default,
[id^="addAlarmeModal-"] .modal-footer .btn-default {
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
}

#addAlarmeModal .modal-footer .btn-default:hover,
[id^="addAlarmeModal-"] .modal-footer .btn-default:hover {
    background: #d0d0d0;
}

#addAlarmeModal .modal-footer .btn-primary,
[id^="addAlarmeModal-"] .modal-footer .btn-primary {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
}

#addAlarmeModal .modal-footer .btn-primary:hover,
[id^="addAlarmeModal-"] .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
}

/* Form group spacing */
#addAlarmeModal .form-group,
[id^="addAlarmeModal-"] .form-group {
    margin-bottom: 15px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .alarme-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .alarme-actions {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
    }
}

/* ============================================
   Global Alarms Modal Styles (Preferences)
   ============================================ */

#globalAlarmesModal .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

#globalAlarmesModal .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: #fff;
    border-bottom: none;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
}

#globalAlarmesModal .modal-header .modal-title {
    color: #fff;
    font-weight: 500;
    font-size: 18px;
}

#globalAlarmesModal .modal-header .modal-title .glyphicon {
    margin-right: 8px;
}

#globalAlarmesModal .modal-header .close {
    color: #fff;
    opacity: 0.8;
    text-shadow: none;
}

#globalAlarmesModal .modal-header .close:hover {
    opacity: 1;
}

#globalAlarmesModal .modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

#globalAlarmesModal .list-group-item {
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

#globalAlarmesModal .list-group-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#globalAlarmesModal .list-group-item-success {
    background-color: #e8f5e9;
    border-color: #a5d6a7;
}

#globalAlarmesModal .list-group-item-warning {
    background-color: #fff8e1;
    border-color: #ffe082;
}

#globalAlarmesModal .list-group-item-disabled {
    background-color: #f5f5f5;
    border-color: #e0e0e0;
    opacity: 0.7;
}

#globalAlarmesModal .global-alarmes-loading,
.global-alarmes-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

#globalAlarmesModal .global-alarmes-loading .glyphicon,
.global-alarmes-loading .glyphicon {
    font-size: 24px;
    display: block;
    margin-bottom: 10px;
}

/* Alarmes Resume Modal */
#alarmesResumeModal .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

#alarmesResumeModal .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: #fff;
    border-bottom: none;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
}

#alarmesResumeModal .modal-header .modal-title {
    color: #fff;
    font-weight: 500;
    font-size: 18px;
}

#alarmesResumeModal .modal-header .modal-title .glyphicon {
    margin-right: 8px;
}

#alarmesResumeModal .modal-header .close {
    color: #fff;
    opacity: 0.8;
    text-shadow: none;
}

#alarmesResumeModal .modal-header .close:hover {
    opacity: 1;
}

#alarmesResumeModal .modal-body {
    padding: 20px;
}

#alarmesResumeModal .list-group-item {
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

#alarmesResumeModal .list-group-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#alarmesResumeModal .well {
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Add Global Alarme Modal */
#addGlobalAlarmeModal .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

#addGlobalAlarmeModal .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: #fff;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

#addGlobalAlarmeModal .modal-header .modal-title {
    color: #fff;
}

#addGlobalAlarmeModal .modal-header .close {
    color: #fff;
    opacity: 0.8;
}

#addGlobalAlarmeModal .form-control {
    height: 42px;
    font-size: 14px;
}

/* Mobile Responsive - Global Alarms */
@media (max-width: 767px) {
    #globalAlarmesModal .modal-dialog {
        margin: 10px;
        width: calc(100% - 20px);
    }

    #globalAlarmesModal .modal-body {
        padding: 15px;
        max-height: 60vh;
    }

    #globalAlarmesModal .list-group-item .row {
        flex-wrap: wrap;
    }

    #globalAlarmesModal .list-group-item .col-xs-1 {
        flex: 0 0 30px !important;
    }

    #globalAlarmesModal .list-group-item .col-xs-5 {
        flex: 1 1 calc(100% - 40px) !important;
    }

    #globalAlarmesModal .list-group-item .col-xs-3 {
        flex: 1 1 100% !important;
        text-align: left !important;
        margin-top: 10px;
        padding-left: 40px;
    }

    #globalAlarmesModal .list-group-item .col-xs-3:last-child {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    #globalAlarmesModal .global-actif-select {
        flex: 1;
        max-width: none !important;
        width: auto !important;
    }

    /* Add modal mobile */
    #addGlobalAlarmeModal .modal-dialog {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* ========================================
   Storm Park Modal - Unified Style
   ======================================== */
#stormParkModal .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

#stormParkModal .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: #fff;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

#stormParkModal .modal-header .modal-title,
#stormParkModal .modal-header h4 {
    color: #fff;
}

#stormParkModal .modal-header .close {
    color: #fff;
    opacity: 0.8;
}

#stormParkModal .modal-header .close:hover {
    color: #fff;
    opacity: 1;
}

/* ========================================
   Alarmes Config Modal - Unified Style
   ======================================== */
#alarmesConfigModal .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

#alarmesConfigModal .modal-header {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: #fff;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

#alarmesConfigModal .modal-header .modal-title,
#alarmesConfigModal .modal-header h5 {
    color: #fff;
}

#alarmesConfigModal .modal-header .close {
    color: #fff;
    opacity: 0.8;
}

#alarmesConfigModal .modal-header .close:hover {
    color: #fff;
    opacity: 1;
}
