body {
  overflow-x: hidden;
  background:#2C3E50;
  color: gray;
  font-family: "Poppins", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.8;
}

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background: #2C3E50;
  border-right: 2px solid #ccc;
  transition: width 0.3s;
  z-index: 1000;
}

#sidebar.collapsed {
  width: 80px;
}

#sidebar .logo {
  padding: 15px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/*
#sidebar .logo span {
  white-space: nowrap;
}

#sidebar.collapsed .logo span {
  display: none;
}
*/
#sidebar ul {
  padding: 0;
}

#sidebar ul li {
  list-style: none;
}

#sidebar ul li a {
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar ul li.active a {
  background: lightsteelblue !important;
}

#sidebar ul li a:hover {
    color: #fff;
    background-color: #F9B226;
}

#sidebar.collapsed ul li a span {
  display: none;
}

/* ===== HEADER SIDEBAR ===== */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}

/* Toggle siempre a la izquierda */
#sidebarToggle {
  flex-shrink: 0;
}

/* Logo */
.sidebar-logo {
  max-height: 73px;
  transition: all 0.3s ease;
}

/* Sidebar colapsado */
#sidebar.collapsed .sidebar-header {
  justify-content: center;
}

#sidebar.collapsed .sidebar-logo {
  max-height: 28px;
}


/* ===== CONTENT ===== */
#content {
  margin-left: 250px;
  transition: margin-left 0.3s;
}

#sidebar.collapsed + #content {
  margin-left: 80px;
}

/* ===== TOPBAR ===== */
.topbar {
  background: #2C3E50;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== BOTÓN FILTROS ===== */
.btn-filtros {
  background-color: lightsteelblue;
  color: #fff;
  border: none;
}

.btn-filtros:hover,
.btn-filtros:focus,
.btn-filtros:active,
.btn-filtros.show {
  background-color: #F9B226 !important;
  color: #fff;
}

.masfiltros-badge {
     display: none;
     position: absolute;
     top: 2px;
     right: 2px;
     width: 12px;
     height: 12px;
     border-radius: 50%;
     background: #ff3b30;
     border: 2px solid #fff;
     box-shadow: 0 0 2px rgba(0,0,0,0.2);
}

/* ===== BOTONES GENERALES ===== */
.btn-general {
    background-color: #F9B226;
    border-color: #cd9321;
    color: #2C3E50;
}

.btn-general:hover{
    background-color: #cf9626 !important;
    border-color: #cf9626 !important;
    color: #ffffff !important;
}

/* ===== BOTÓN AYUDA ===== */
.btn-help {
  color: #fff;
  font-size: x-large;
  padding: 6px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-help i {
  color: #fff;
  transition: all 0.2s ease;
  border-radius: 50%;
  padding: 6px;
}

.btn-help i:hover {
  background-color: #fff;
  color: #333;
}

/* ===== AVATAR ===== */
.avatar {
  width: 40px;
  height: 40px;
  background-color: lightsteelblue;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.avatar:hover,
.show > .avatar {
  background-color: #F9B226;
}

/* Quitar flecha del dropdown */
.dropdown-toggle::after {
  display: none !important;
}

/* Dropdown menu: show a small circle to the left of each option in the filters menu */
#menuFiltros .dropdown-item {
  position: relative;
  padding-left: 40px; /* leave space for the circle */
}

#menuFiltros .dropdown-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cfcfcf; /* default circle color */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05) inset;
}

/* Hover affordance: don't override per-option color, just slightly scale and add outline */
#menuFiltros .dropdown-item:hover::before,
#menuFiltros .dropdown-item:focus::before {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06), 0 0 6px rgba(0,0,0,0.08);
}

/* Hover background for dropdown items (requested) */
#menuFiltros .dropdown-item:hover,
#menuFiltros .dropdown-item:focus {
  background-color: rgb(213, 208, 208) !important;
}

/* Individual colors for each filter option */
#menuFiltros .dropdown-item#filtroActivos::before {
  background-image: linear-gradient(to right, #8ed973, rgba(0, 150, 0, 1)); /* green */
}
#menuFiltros .dropdown-item#filtroCaduca1mes::before {
  background-image: linear-gradient(to right, #FFD700, #FFC107); /* gold */
}
#menuFiltros .dropdown-item#filtroCaducada::before {
  background-image: linear-gradient(to right, #ff0000, #b30000);/* red */
}
#menuFiltros .dropdown-item#filtroBloqueada::before {
  background-image: linear-gradient(to right, #FF8C00, #FF4500); /* orange */
}
#menuFiltros .dropdown-item#filtroSinLicencia::before {
  background-image: linear-gradient(to right, #808080, #C0C0C0); /* gray */
}
#menuFiltros .dropdown-item#filtroPdteAlta::before {
  background-image: linear-gradient(to right, #2393bf, rgb(16 66 131)); /* blue */
}

/* Ensure the filters dropdown is above the table and receives pointer events
   so hovering/clicking its items doesn't interact with underlying table rows */
#menuFiltros {
  z-index: 2100; /* above datatables and other UI */
  pointer-events: auto;
}

#menuFiltros .dropdown-item {
  z-index: 2110;
}

/* Hide circle for specific options */
#menuFiltros .dropdown-item#filtroLimiteSup::before,
#menuFiltros .dropdown-item#filtroTodos::before {
  display: none;
}

#filtroLimiteSup {
    background-color: #f73939;
    color: white;
}

/* ===== CAJA BUSCAR ===== */
.dt-search {
    position: relative;
    flex: 1;              /* ← CLAVE */
    min-width: 140px;
}

.dt-search input {
    width: 500px;
    height: 32px;
    background: #fcfcfc;
    border: 1px solid #aaa;
    border-radius: 5px;
    box-shadow: 0 0 3px #ccc, 0 10px 15px #ebebeb inset;
    text-indent: 10px;
}

.dt-search .fa-search {
    position: absolute;
    top: 10px;
    left: auto;
    right: 10px;
}

/* ===== BOTONES FILTRO TABLA ===== */
.dt-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px;
}

.dt-buttons .dt-button, .dt-buttons .btn {
    width: 36px !important;
    height: 36px !important;
    padding: 5px 0 0 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #ccc !important;
    background: linear-gradient(to bottom, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 4px !important;
    color: inherit;
}
.dt-buttons .btn, .dt-buttons .dt-button {
    color: #333 !important;
    background-color: #fff !important;
    border: 1px solid #ccc !important;
}

/* ===== ESTILOS DATATABLES ===== */
.custom-th{
    background: #2C3E50;
    color: #fff;
    font-size: 13px;
    padding: 10px 5px !important;
} 

td {
    border: 1px #DDD solid;
}

/* ===== COLORES CIRCULOS ESTADO ===== */
i.fa.fa-circle.Bloqueada{
    font-size: 17px;
    background: -webkit-linear-gradient(#FF8C00, #FF4500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

i.fa.fa-circle.Caduca1mes{
    font-size: 17px;
    background: -webkit-linear-gradient(#FFD700, #FFC107);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

i.fa.fa-circle.Caducada{
    font-size: 17px;
    background: -webkit-linear-gradient(#ff0000, #b30000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

i.fa.fa-circle.SinLicencia{
    font-size: 17px;
    background: -webkit-linear-gradient(#808080, #C0C0C0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

i.fa.fa-circle.Activa{
    font-size: 17px;
    background: -webkit-linear-gradient( #8ed973, rgba(0, 150, 0, 1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

i.fa.fa-circle.Pdte{
    font-size: 17px;
    background: -webkit-linear-gradient(#2393bf, rgb(16 66 131));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== ESTILOS ADICIONALES ===== */
.limiteSupFila {
    background-color: #f73939 !important;
    color: white;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 1199.98px) {
  .dt-search input {
    width: 360px;
  }

  .custom-th{
    background: #2C3E50;
    color: #fff;
    font-size: 13px;
    padding: 0 27px !important;
  }
}
@media (max-width: 991.98px) {
  .dt-search input {
    width: 260px;
  }
}

/* ===== MOBILE ===== */
@media (max-width: 991.98px) {
  #sidebar {
    left: -250px;
    width: 250px;
  }

  #sidebar.show {
    left: 0;
  }

  #content {
    margin-left: 0;
  }

  .topbar {
    flex-wrap: nowrap;
  }

.dt-buttons {
    width: 100%;
    justify-content: flex-start;
}

.dt-buttons .dt-button,
.dt-buttons .btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem;
}

.dt-search {
        top: 12px;
    right: 1px;
  }

  .dt-search input {
    width: 99%;
    padding-right: 28px;
  }
}

/* Sidebar header normal */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* MODO COLAPSADO (DESKTOP) */
@media (min-width: 992px) {

  #sidebar.collapsed .sidebar-header {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  #sidebar.collapsed #sidebarToggle {
    order: 2;
  }

  #sidebar.collapsed .sidebar-logo {
    order: 1;
    max-height: 28px;
  }
  
  /* Sidebar colapsado */
  #sidebar.collapsed ul li a {
    justify-content: center;     /* centra icono */
    padding: 12px 0;             /* elimina desplazamiento lateral */
  }

  /* Iconos perfectamente centrados */
  #sidebar.collapsed ul li a i {
    margin: 0;
    font-size: 1.2rem;
  }

  /* Ocultar texto */
  #sidebar.collapsed ul li a span {
    display: none;
  }
  
  #sidebar.collapsed {
    text-align: center;
  }
  
}

/* ===== CONTENEDOR BOTÓN NUEVO + BUSCADOR ===== */
.dt-layout-cell.dt-layout-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Ensure dropdown menus injected into the DataTables layout don't change
   the table container height. Position them absolutely and limit their
   max-height so they scroll internally instead of expanding the parent. */
.dt-layout-cell .dropdown,
.dataTables_wrapper .dropdown,
.btn-group,
.btn-filtro,
.dt-layout-cell .btn-group {
  position: relative; /* anchor for absolute dropdown-menu and btn-group injected menus */
}

.dt-layout-cell .dropdown .dropdown-menu,
.dataTables_wrapper .dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 2100;
  display: none; /* controlled by JS when used inline */
  max-height: 260px; /* avoid growing parent; scroll internally */
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  background: #fff;
}

/* menuFiltros default (no forced position) - JS will position this when opened */
#menuFiltros {
  z-index: 2100;
  pointer-events: auto;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  background: #fff;
}

/* small adjustments for narrow screens so the dropdown stays within viewport */
@media (max-width: 575.98px) {
  .dt-layout-cell .dropdown .dropdown-menu,
  #menuFiltros {
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    max-height: 40vh !important;
  }
}

/* Style DataTables action buttons inside the table area to use dark-blue on hover
   and ensure icons turn white. Scoped to each table wrapper to avoid global changes. */
/* Apply the same styling to DataTables buttons across all tables and responsive wrappers */
.dataTables_wrapper .dt-buttons .btn,
.dataTables_wrapper .dt-buttons .dt-button,
.table-responsive .dt-buttons .btn,
.table-responsive .dt-buttons .dt-button,
.dt-buttons .btn,
.dt-buttons .dt-button {
  background-color: transparent;
  color: #2C3E50; /* default icon/text color */
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.dataTables_wrapper .dt-buttons .btn i,
.dataTables_wrapper .dt-buttons .dt-button i,
.table-responsive .dt-buttons .btn i,
.table-responsive .dt-buttons .dt-button i,
.dt-buttons .btn i,
.dt-buttons .dt-button i {
  color: inherit;
}
.dataTables_wrapper .dt-buttons .btn:hover,
.dataTables_wrapper .dt-buttons .dt-button:hover,
.table-responsive .dt-buttons .btn:hover,
.table-responsive .dt-buttons .dt-button:hover,
.dt-buttons .btn:hover,
.dt-buttons .dt-button:hover {
  background-color: #0f55cc !important; /* dark blue */
  border-color: #0f55cc !important;
  color: #ffffff !important;
}
.dataTables_wrapper .dt-buttons .btn:hover i,
.dataTables_wrapper .dt-buttons .dt-button:hover i,
.table-responsive .dt-buttons .btn:hover i,
.table-responsive .dt-buttons .dt-button:hover i,
.dt-buttons .btn:hover i,
.dt-buttons .dt-button:hover i {
  color: #ffffff !important;
}

/* Table rows font size */
/* Apply 14px font to the empresas table rows and cells */
#TablaEmpresas tbody tr,
#TablaEmpresas tbody td {
  font-size: 14px;
}

/* Hover on table rows: blue background and hand cursor */
tbody tr:not(.selected):hover {
  cursor: pointer !important;
  background: #8fc8f3 !important;
}

.context-menu-icon.context-menu-icon-licencia:before {
  font-family: 'iconosSCT' !important;
  content: "\e905"; 
  font-size: 16px;
  margin-left: -2px;
}

.modal-header {
    background-color: #F9B226 !important;
}
  
.modal-title{
    color: #2C3E50;;
    display: inline-block;
}

.modal-header .close {
    color: #2C3E50;
    opacity: 1 !important;
}

.close:hover {
    color: #fff;
    text-decoration: none; }

.btn-primary {
    background-color: #F9B226 !important;
    border-color: #cd9321 !important;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* Modal Informacion: stack terminal info above employees table on tablet & mobile */
@media (max-width: 991.98px) {
  #modalInformacion .modal-dialog {
    width: 95% !important;
    max-width: 95% !important;
  }

  /* Force the two columns to be full width and remove left border */
  #modalInformacion .modal-body .col-md-3,
  #modalInformacion .modal-body .col-md-9 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }

  #modalInformacion .modal-body .border-left {
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  /* Make form labels and inputs stack nicely */
  #modalInformacion .form-group.row {
    display: block !important;
    margin-bottom: 8px !important;
  }

  #modalInformacion .form-group.row .col-sm-4,
  #modalInformacion .form-group.row .col-sm-8 {
    width: 100% !important;
    display: block !important;
    padding: 0 !important;
  }

  /* Give the employees table a small top margin when stacked */
  #modalInformacion .table-responsive {
    margin-top: 12px !important;
  }
}

.btn-primary:hover {
    background-color: #cf9626 !important;
    border-color: #cf9626 !important;
    color: #ffffff !important;
}

form p {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 15px;
    padding-left: 120px;
    padding-right: 120px;
}

form p label {
    flex: 1;
    margin-bottom: 0;
    text-align: left;
    display: block;
    width: 100%;
}

.obligatorio {
    color: red;
}

#divCheckboxes{
    display: flex;
    gap: 20px;
    align-items: center;
    margin-left: 120px;
}

#search-input, #comunicacion-input {
    background-image: url(../images/searchicon.png);
    background-size: 35px;
    background-position: 10px center;
    background-repeat: no-repeat;
    font-size: 14px;
    padding: 12px 20px 12px 50px;
    border: 1px solid #ddd;
    margin-bottom: 12px;
}

.ajustarColumna {
    white-space: normal !important;
}

td {
    font-size: 14px !important;
}
.grid-td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.grid-td > div:first-child {
    width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-td > div:last-child {
    width: 30%;
}

#TablaTerminales th,
#TablaTerminales td {
  vertical-align: middle !important;
  white-space: nowrap;
}

.margenForm {
    margin-left: 50px !important;
    margin-right: 50px !important;
}

.margenColum {
    padding-right: 45px !important;
}

/* Page-specific card sizing: make the main card smaller on PanelControl page */
.page-PanelControl .card.custom-card {
  max-width: 717px; /* narrower container */
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 !important;
}

/* Slightly tighter inner padding for that page to reduce height and visual bulk */
.page-PanelControl .card.custom-card .card-body {
  padding: 12px !important;
}

.form-control-plaintext {
    display: block;
    width: 100%;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    margin-bottom: 0;
    line-height: 1.5;
    color: #212529;
    background-color: transparent;
    border: solid transparent;
    border-width: 1px 0;
    font-size: 0.9rem;
}


@media (max-width: 992px) {
    form p {
        padding-left: 40px;
        padding-right: 40px;
    }

    #divCheckboxes{
      margin-left: 40px;
    }

    .margenForm {
      margin-left: 0 !important;
      margin-right: 0 !important;
    }

    .margenColum {
        padding-right: 0 !important;
    }

    #modalInformacion .dt-search {
      display: flex !important;
      justify-content: flex-end !important;
      margin-bottom: 12px !important;
      width: 100% !important;
    }
}

@media (max-width: 576px) {
    form p {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    #divCheckboxes{
      margin-left: 15px;
    }

    #modalInformacion .dt-search {
      display: flex !important;
      justify-content: flex-end !important;
      margin-bottom: 12px !important;
      width: 100% !important;
    }
}

#filtrosEstadosCount.show {
    display: inline-block !important;
}
#filtrosEstadosCount {
    position: absolute !important;
    top: 77% !important;
    left: 15px !important;
    transform: translateY(-50%) !important;
    display: none !important;
    min-width: 20px !important;
    padding: 2px 6px !important;
    border-radius: 12px !important;
    text-align: center !important;
    z-index: 9999 !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #e72c2c !important;
    font-size: 11px !important;
}

#aplicarEstadosFiltro {
    background-color: #F9B226 !important;
    border-color: #cd9321 !important;
    color: #000 !important;
}
#aplicarEstadosFiltro:hover {
    background-color: #cf9626 !important;
    border-color: #cf9626 !important;
    color: #ffffff !important;
}

#limpiarEstadosFiltro{
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

#limpiarEstadosFiltro:hover {
    color: #fff !important;
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

#filtros.filter-active {
    position: relative;
}

#filtros.filter-active::after {
    content: "";
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #ff3b30; /* rojo */
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}
.dt-buttons .dt-button i, .dt-buttons .btn i {
    font-size: 16px;
}

/* When filters menu is open, hide the table's internal scrollbars so the menu overlays cleanly */
.dataTables_wrapper.menu-open .dt-scroll-body {
  overflow: hidden !important;
}

/* Fallback: if wrapper not found, body.menu-open hides any visible table scroll areas */
body.menu-open .dt-scroll-body {
  overflow: hidden !important;
}
