body {
  font-family: "Nunito Sans", sans-serif;
  font-optical-sizing: auto;
  margin: 0;
  padding: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

button {
  padding: 0.5rem;
  margin-left: 0.5rem;
}

ul{
  list-style: none;
}

main {
  display: flex;
  gap: 2rem;
}

.tabla-clientes {
  padding: 0;
}



.oculto {
  display: none;
}




:root {
  --primary: #006880;
  --white: #ffffff;
  --bg-color: #EFF0EA;
  --filtros: #fbfcdc;
  --gray: #9a9a9a;
  --dark-gray: #464646;
  --light-gray: #D0D0D0;
  --primary-light: #0E90AD;
  --green: #168f31;
  --red: #dc3545;
}

.blue{
  color: var(--primary);
}
* {
  box-sizing: border-box;
}

a{
  color: var(--primary-light);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}
.hidden{
  display: none;
}
.wrapper{
  width: 1276px;
  max-width: 90%;
  margin: 0 auto;
}
.right{
  float: right;
}
.align-right{
  text-align: right;
}
.align-center{
  text-align: center;
}
.light{
  font-weight: 300;
}
.full-height{
  height: 100dvh;
}
.full-width{
  width: 100%;
}
.bg-color{
  background-color: var(--bg-color);
}
.bg-white{
  background-color: white;
}
.row{
  display: flex;
  gap: 20px;
}

.col-100{
  width: 100%;
}
.col-75{
  width: 75%;
}
.col-50{
  width: 50%;
}
.col-66{
  width: 66%;
}
.col-33{
  width: 33%;
}
.col-25{
  width: 25%;
}

.header{
  background-color: var(--primary);
  color: #fff;
  margin: auto;
}
  .header div{
    margin: auto;
  }
  .header a{
    color: #fff;
  }

.settings-menu{
  display: flex;
  list-style: none;
  float: right;
  align-items: center;
}
  .settings-menu li{
    margin-right: 20px;
  }
    .settings-menu li a{
      text-decoration: none;
      position: relative;
      border-radius: 4px;
      padding: 2px 5px;
      line-height: 1.4em;
      height: 25px;
      background-color: transparent;
      font-weight: 300;
    }
    .settings-menu li a:hover{
      color: var(--primary);
      background-color: #fff;
    }
    .settings-menu li i{
      margin-right: 5px;
      font-size: 16px;
    }
    #user-menu-toggle i{
      margin-right: 0;
    }

    


.main-menu{
  background-color: var(--primary);
  color: var(--bg-color);
  margin: auto;
}
  .main-menu ul, .secondary-menu ul{
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
  }
    .main-menu li, .secondary-menu li{
      margin: 0;
      padding: 0;
      font-weight: 600;
      z-index: 1;
    }
      .main-menu li a{
        display: block;
        cursor: pointer;
        font-weight: 700;
        padding: 12px 40px;
        padding-top: 20px;
        min-width: 150px;
        color: var(--bg-color);
        text-decoration: none;
        font-size: 1rem;
        border-radius: 8px 8px 0px 0px;
        text-align: center;
      }
      .main-menu li a:hover, .main-menu li a.active{
        background-color: var(--bg-color);
        text-decoration: underline;
        font-size: 1rem;
        text-align: center;
        color: var(--primary);
      }
    .secondary-menu{
      margin: 20px 0 0 0;
    }
      .secondary-menu li a{
        display: block;
        font-weight: normal;
        color: #000;
        text-decoration: none;
        font-size: 1rem;
        text-align: center;
        padding: 10px;
        border-bottom: 1px solid var(--light-gray);
      }
      .secondary-menu li a.active, .secondary-menu li a:hover{
        color: var(--primary);
        border-bottom: solid 2px var(--primary);
      }
main{
  background-color: var(--bg-color);
}

.main-buttons{
  text-align: right;
  margin: auto;
  display: flex;
  justify-content: end;
  gap: 20px;
}

.btn{
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}
  .btn:hover{
    cursor: pointer;
  }

.btn.primary, .btn.secondary {
  padding: 16px 24px;
  border-radius: 8px;
}
  .btn.primary i, .btn.secondary i{
    margin-right: 4px;
    color: #fff;
  }
.btn.primary {
  color: #fff;
  background-color: var(--primary-light);
  border: 1px solid var(--primary-light);
  border-bottom: 1px solid var(--primary);
  -webkit-transition: all 0.05s;
  transition: all 0.05s;
}
  .btn.primary:hover {
    background-color: var(--primary);
    border: 1px solid var(--primary);
  }

.btn.secondary, .btn.terciary{
  border: 1px solid var(--primary-light);
  color: var(--primary-light);
  background-color: transparent;
}
  .btn.secondary:hover, .btn.terciary:hover {
    background-color: var(--primary-light);
    color: #fff;
    border-color: var(--primary-light);
  }
  .btn.secondary i, .btn.terciary i{
    color: var(--primary-light);
    margin-right: 4px;
  }

  .btn.secondary:hover i, .btn.terciary:hover i{
    color: #fff;
  }

.btn.secondary {
  -webkit-transition: all 0.05s;
  transition: all 0.05s;
}

.btn.terciary {
  padding: 5px 6px 4px 6px;
  font-size: 0.7145rem;
  line-height: 13px;
  border-radius: 4px;
  display: inline-flex;
}
.btn.back{
  color: var(--primary-light);
  text-decoration: none;
  text-transform: uppercase;
}
  .btn.back i{
    color: var(--primary-light);
  }
  .btn.back:hover{
    color: var(--primary);
    text-decoration: underline;
  }
    .btn.back:hover i{
      color: var(--primary);
    }
footer{
  background-color: var(--bg-color);
}

.filtros{
  background-color: var(--filtros);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

input:read-only {
  background-color: #f4f4f4;
}
label:has(input) {
  width: 100%;
  margin-bottom: 0;
  font-weight: 200;
}
input, select, textarea{
  background-color: #fff;
  border: 1px solid var(--light-gray);
  padding: 12px 15px;
  color: #000;
  width: 100%;
  font-size: 1rem;
  font-family: "Nunito Sans", sans-serif;
  line-height: 0.9285rem;
  font-weight: 300;
  border-radius: 8px;
}
.inline-input {
  margin: 0 30px;
}
.inline-input label{
  margin: auto auto auto 0;
}
.inline-input input{
  width: 30%;
}
table a{
  display: flex;
}
table.grid{
  width: 100%;
  margin: 0px;
  padding: 0px;
  border-spacing: 0px 6px;
  background-color: transparent;
  border-collapse: separate;
  position: relative;
  margin-bottom: 20px;
}
thead {
  display: table-header-group;
  vertical-align: middle;
  unicode-bidi: isolate;
  border-color: inherit;
  background-color: var(--gray);

}
table.grid thead th {
    padding: 8px 10px 8px 10px;
    font-size: 0.8571rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
    line-height: 1.3em;
    border: none;
    background-color: var(--gray);
    vertical-align: middle;
    border-left: 1px solid #fff;
    text-align: left;
    position: relative;
}
  table.grid thead th:first-child {
      border-left: 1px solid #AAAAAA;
      border-radius: 8px 0px 0px 8px;
  }
  table.grid thead th:last-child {
      border-radius: 0 8px 8px 0;
  }

table.grid tbody td {
  font-size: 0.8571rem;
  font-weight: 400;
  padding: 16px 8px 16px 8px;
  border: none;
  background-color: #fff;
  vertical-align: middle;
  text-align: left;
  position: relative;
}
  table.grid tbody td:first-child {
    border-radius: 8px 0px 0px 8px;
  }
  table.grid tbody td:last-child {
      border-radius: 0 8px 8px 0;
  }
.footer{
  background-color: var(--bg-color);
  text-align: center;
  margin: auto;
  padding: 20px 0;
}
#busqueda{
  width: 100%;
  background: #fff url(../assets/img/icon-search.svg) right center no-repeat;
  padding-right: 38px;
}
.checkboxes-list{
  display: grid;
  align-items: center;
}
h1, h2, h3, h4, h5, h6ßß{
  font-weight: 300;
  font-family: "Nunito Sans", sans-serif;
  margin: 20px 0 10px 0;
}
h1{
  font-size: 2rem;
}
h2{
  font-size: 1.4rem;
}
h2.section-title::before{
  content: "";
  display: block;
  width: 70px;
  height: 2px;
  background-color: var(--primary-light);
  margin: 30px 0 10px 0;
}
.aclaracion{
  color: var(--gray);
}
.tooltip {
  display: inline-block;
  cursor: pointer;
}
  .tooltip:hover .tooltiptext {
    visibility: visible;
  }
  .tooltip i{
    color: var(--gray);
  }
    .tooltip i:hover{
      color: var(--primary-light);
    }
.tooltiptext {
  visibility: hidden;
  text-transform: none;
  width: 300px;
  background-color: var(--primary-light);
  color: var(--white);
  padding: 10px;
  border-radius: 6px;
  position: absolute;
  bottom: 120%;
  left: 65%;
  margin-left: -150px; /* Use half of the width (130/2 = 65), to center the tooltip */
  z-index: 1; /* Ensure tooltip is displayed above content */
  font-size: 14px;
  font-weight: 300;
}
.tooltiptext::after {
  content: " ";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 49%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--primary-light) transparent transparent transparent;
}
.tooltip a{
  color: #fff;
  font-weight: 300;
  text-decoration: underline;
}
form.folio{
  background-color: #fff;
}
form .block{
  background-color: #E7E7DF;
  padding: 35px 45px;
  border-radius: 8px;
  margin-bottom: 20px;
}
  form .block label, form .block .label, form .row label{
    text-transform: uppercase;
    font-weight: 200;
    align-self: center;
  }
  form.folio .block{
    background-color: transparent;
  }
form .row{
  margin-bottom: 8px;
}

form i{
  color: var(--gray);
  font-size: 14px;
}
.label-name{
  text-transform: uppercase;
  font-weight: 700;
  margin-right: 10px;
}
.label-description{
  color: var(--gray);
  font-size: .8571rem;
}
.radio-buttons-collection, .checkboxes-collection{
  margin: 5px 0px 20px 0px;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  padding: 7px;
  width: 100%;
  line-height: 0px;
}
  .radio-buttons-collection li, .checkboxes-collection li {
    margin: 0px;
    padding: 0px;
    width: 100%;
  }
    .radio-buttons-collection li:not(:last-child), .checkboxes-collection li:not(:last-child) {
      margin-bottom: 4px;
    }
    .radio-buttons-collection li a, .radio-buttons-collection li label, .checkboxes-collection li a,
.checkboxes-collection li label {
      font-weight: 400;
      margin: 0;
      font-size: 0.9285rem;
      display: flex;
      align-items: center;
      border: 1px solid var(--light-gray);
      border-radius: 6px;
      cursor: pointer;
      text-decoration: none;
      padding: 4px 0;
  }
    .radio-buttons-collection li a, .radio-buttons-collection li label input, .checkboxes-collection li a,
.checkboxes-collection li label input, .checkboxes input{
      padding: 9px 30px 9px 12px;
      width: auto;
      margin-right: 10px;
    }

.radio-buttons-inline {
  display: flex;
  gap: 15px;
  padding-inline-start: 0;
  margin: 8px 0 0 0;
}

.radio-buttons-inline label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-buttons-inline input[type="radio"] {
  margin-right: 6px;
}
.radio-buttons-inline .label-name{
  font-weight: normal;
}

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: auto;
  background-color: var(--primary-light);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  font-size: 14px;

}

.tooltip:hover .tooltip-text {
  visibility: visible;
}

.tooltip-arrow {
  position: absolute;
  top: 100%; /* coloca justo debajo del tooltip */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--primary-light); /* color del fondo del tooltip */
}

.item{
  padding: 0 10px;
}

form table{
  border: 1px solid var(--light-gray);
}
form table, .tabla-datos {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
}
form table{
  overflow: hidden;
}

form table th,
form table td, .tabla-datos th,
.tabla-datos td {
  border-bottom: 1px solid #E6E6E6;
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  display: table-cell;
}
.tabla-datos{
  table-layout: fixed;
  width: 100%;
}
.tabla-datos td, .tabla-datos td a {
  white-space: nowrap;
  overflow: scroll;
  /* text-overflow: ellipsis; */
  min-width: 60px;
  padding: 0.5rem;
  box-sizing: border-box;
  vertical-align: middle;
}
.tabla-datos td a {
  display: inline-block;
  max-width: 100%;
}
form table thead th, form table thead th {
  background: var(--bg-color);
  font-weight: 600;
}

form table input[type="text"],
form table input[type="number"], .tabla-datos input[type="text"],
.tabla-datos input[type="number"] {
  width: 100%;
  box-sizing: border-box;
}

.btn-del, Aform table .btn-del, .tabla-datos .btn-del {
  background: transparent;
  border: 0;
  color: #a00;
  font-size: 18px;
  cursor: pointer;
}

.inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.autocomplete-suggestions {
  background: white;
  position: absolute;
  z-index: 1000;
  width: auto;
  border: 1px solid var(--light-gray);
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  background-color: #fff;
}

.autocomplete-suggestions:empty {
  display: none;
}

.suggestion-item {
  padding: 4px 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 0.95rem;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: var(--primary);
  color: white;
}

.autocomplete-list {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--light-gray);
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  min-width: 260px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.autocomplete-item {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s ease;
  font-size: 0.95rem;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: var(--primary);
  color: white;
}

.autocomplete-item:hover strong,
.autocomplete-item.active strong {
  color: white;
}

.autocomplete-item strong {
  color: var(--primary);
  font-weight: 600;
}

.autocomplete-empty {
  padding: 12px 15px;
  color: var(--gray);
  font-style: italic;
  text-align: center;
  cursor: default;
}

.autocomplete-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}
/* ===== Login ===== */
.login-layout{
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100dvh - 64px); /* resta la cabecera aproximada */
  background: var(--bg-color);
}

.login-left{
  width: 100%;
  background: var(--bg-color);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.login-right{
  width: 100%;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.logo-box{
  width: 420px;
}
.login-card{
  width: 420px;
  max-width: 92%;
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 22px;
}

.login-title{
  margin: 0 0 18px;
  font-size: 1.75rem;
  font-weight: 200;
  color: #2b2b2b;
}

.login-form .login-field{
  margin-bottom: 14px;
}
.login-form label{
  text-transform: uppercase;
  font-weight: 200;
  font-size: .92rem;
  display: block;
  margin-bottom: 6px;
  color: #444;
}
.login-form input[type="email"],
.login-form input[type="password"]{
  background-color: #fff;
  border: 1px solid var(--light-gray);
  padding: 12px 15px;
  color: #000;
  width: 100%;
  font-size: 1rem;
  line-height: 1rem;
  font-weight: 300;
  border-radius: 8px;
  transition: box-shadow .15s, border-color .15s;
}
.login-form input:focus{
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(14,144,173,.15);
}

.login-link{
  color: var(--primary-light);
  text-decoration: none;
  font-size: .92rem;
}
.login-link:hover{ text-decoration: underline; }

.login-small{
  margin: 14px 0 0;
  font-size: .92rem;
  color: #666;
  text-align: center;
}

.login-hero{
  text-align: center;
  max-width: 520px;
  padding: 0 20px;
}
.login-hero h2{
  font-weight: 800;
  font-size: 1.8rem;
  color: #3a3a3a;
  line-height: 1.25;
  margin: 0;
}

/* Responsive */
@media (max-width: 900px){
  .login-layout{ grid-template-columns: 1fr; }
  .login-right{ display: none; } /* en móvil solo mostramos el formulario */
}

/* Contenedor del li */
.user-menu {
  position: relative;
  font-weight: 300;
  font-size: .9rem;
}
.user-menu span{
  color: #333;
}
.user-menu a{
  color: var(--primary);
}
/* Botón */
#user-menu-toggle {
  border: 3px solid var(--primary);
  width:38px; height:38px;
}
#user-menu-toggle span{
  color: #fff;
}
#user-avatar-menu{
  width:32px; height:32px;
  margin-right: 10px;
}
#user-menu-toggle, #user-avatar-menu {
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  background: var(--primary-light); color:#fff; font-size:18px;
  text-decoration:none; transition: background-color .2s;
  z-index: 10;
  aspect-ratio: 1 / 1;
}

/* Estado hover o abierto: Border */
#user-menu-toggle:hover, .user-menu.open #user-menu-toggle{
  border: 2px solid #fff;      /* se mantiene al abrir */
}

/* Dropdown */
.user-dropdown {
  position:absolute; top:40px; right:0; z-index:1000;
  background:#fff; border-radius:8px; width:260px;
  padding: 12px;
  box-shadow:0 4px 12px rgba(0,0,0,.1);
}
  .user-dropdown .row{
    border-bottom: solid 1px var(--bg-color);
  }
  .user-dropdown a { display:block; padding:10px 15px; text-decoration:none; font-size:.9rem; }
  .user-dropdown a:hover { background: var(--bg-color); color: var(--primary); }
  .user-dropdown .btn{
    margin: 8px 0;
  }
  .user-dropdown i::before{
    font-size: 14px;
  }

/* “Conector” blanco vertical bajo el botón cuando está abierto */
.user-menu.open::after{
  content:"";
  position:absolute;
  top:19px;
  width:100%;
  height:40px;
  background:#fff;
  z-index:1;
}

/* Utilidad */
.hidden { display:none; }


/* Mi cuenta */
.account-actions { display:flex; gap:10px; flex-wrap:wrap; }
.form-hint { margin: 8px 0 0; font-size: .95rem; color: #666; }
.form-hint.error { color: #b10; }
.form-hint.ok { color: #1a7f37; }

/* ===== Modal genérico ===== */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 2000; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
}
.modal-dialog {
  position: relative;
  background: var(--bg-color);
  width: min(920px, 92vw);
  margin: 5vh auto 0;
  border-radius: 16px;
  box-shadow: 0 22px 70px rgba(0,0,0,.25);
  overflow: hidden;
}
  .modal-dialog.modal-wide{
    max-width: 800px;
  }
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding: 18px 22px; background: var(--bg-color);
}
.modal-header h2 { margin:0; font-size: 1.6rem; }
.modal-close {
  background: transparent; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color:#555;
}
.modal-body { padding: 22px; }
.modal-body .help { display:block; color:#777; font-size:.85rem; margin-top:6px; }

.modal-footer {
  display:flex; justify-content:space-between;
  padding: 22px; background: var(--bg-color);
}
form .modal-footer {
  padding: 18px 0;
}
/* opcional: inputs dentro del modal ocupen bien */
.modal .item { padding: 0 10px; }

.modal-cancel{
  border: none;
  background-color: transparent;
}



/* Columna de la estrella */
.col-default {
  text-align: center;
  width: 48px;
}

/* Ocultar el input radio nativo */
.col-default input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Estilo base de la estrella (vacía) */
.col-default .star i, .col-default i:not(.fa-ellipsis-vertical) {
  font-size: 20px;
  color: var(--primary-light);
  transition: color .2s ease;
}


/* Última celda con acciones embebidas */
.tabla-datos .with-inline-actions {
  position: relative;
  white-space: nowrap;   /* mantiene email y botón en línea */
  overflow: visible;
}

/* Botón ⋮ */
.kebab-inline {
  position: absolute;
  top: 0;
  right: -30px;
  width: 30px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font-size: 18px;
}
.kebab-inline:hover {
  color: var(--primary);
}

/* Popover de acciones dentro de la celda */
.action-menu-inline {
  position: absolute;
  top: 36px;            /* justo debajo de la línea de la tabla */
  right: 0;
  min-width: 200px;
  background: var(--primary-light);
  border: none;
  border-radius: 10px;
  padding: 0;
  z-index: 1000;
  overflow: hidden;
  display: none;
}
.action-menu-inline.open { display: block; }

/* Items del menú */
.action-menu-inline .menu-item {
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  margin: 0;
  font-weight: 400;
  font-size: 14px;
  font-family: "Nunito Sans", sans-serif;
}
.action-menu-inline .menu-item i { color: #fff; }
.action-menu-inline .menu-item:hover {
  background: var(--primary);
}
.action-menu-inline .menu-item.danger i { color: #a33434; }
.action-menu-inline .menu-item.danger:hover { color: #a33434; background: #fff0f0; }
.action-buttons{
  margin: auto;
}

/* ========== ESTILOS PARA ICONO DE EMAIL ========== */

/* Celda de descripción con icono de email */
.descripcion-con-icono {
  position: relative;
  max-width: 300px; /* Ajusta según el ancho deseado */
}

.descripcion-texto {
  display: block;
  padding-right: 40px; /* Espacio para el icono */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Contenedor de iconos de acción */
.action-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  top: 0;
  right: -30px;
  height: 100%;
}

/* Botón de icono de email */
.email-icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
}

.email-icon-btn:hover {
  transform: translateY(-50%) scale(1.1);
}

.email-icon-btn i {
  transition: color 0.2s ease;
}

/* Menú de email (popover similar al kebab) */
.action-menu-email {
  position: absolute;
  top: 36px;
  right: 0;
  min-width: 220px;
  background: var(--primary-light);
  border: none;
  border-radius: 10px;
  padding: 0;
  z-index: 1000;
  overflow: hidden;
  display: none;
}

.action-menu-email.open {
  display: block;
}

/* Items del menú de email */
.action-menu-email .menu-item {
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  margin: 0;
  font-weight: 400;
  font-size: 14px;
  font-family: "Nunito Sans", sans-serif;
  text-align: left;
}

.action-menu-email .menu-item i {
  color: #fff;
}

.action-menu-email .menu-item:hover {
  background: var(--primary);
}

.action-menu-email .menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0;
}

/* Estados de color del icono de email */
.email-icon-btn .email-success {
  color: #28a745 !important;
}

.email-icon-btn .email-error {
  color: var(--red) !important;
}

/* Estilos para filtro de fechas */
.filtro-fechas {
  display: flex;
}

.fecha-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fecha-inputs input[type="date"] {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.fecha-inputs span {
  color: var(--gray);
  font-weight: 400;
}

.fecha-inputs .btn {
  padding: 0.5rem 1rem;
  font-size: 14px;
}

/* ========== ESTILOS DE PAGINACIÓN ========== */
.datatable_bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 14px;
}

.dataTables_info {
  color: #666;
}

.dataTables_paginate {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.paginate_button {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  margin: 0 2px;
  border: 1px solid #ddd;
  background: var(--white);
  color: #333;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
  min-width: 35px;
  text-align: center;
}

.paginate_button:hover:not(.disabled):not(.current) {
  background: #f5f5f5;
  border-color: #ccc;
}

.paginate_button.current {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.paginate_button.disabled {
  color: #999;
  cursor: not-allowed;
  background: #f9f9f9;
  border-color: #eee;
}

.ellipsis {
  padding: 0.5rem 0.25rem;
  color: #666;
  font-weight: bold;
}

.previous, .next {
  font-weight: 500;
}

/* Responsive para paginación */
@media (max-width: 768px) {
  .datatable_bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .dataTables_paginate {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .paginate_button {
    padding: 0.4rem 0.6rem;
    font-size: 13px;
    min-width: 30px;
  }
}

/* Estilos para precios especiales del cliente */
.add-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn.small {
  padding: 0.4rem 0.8rem;
  font-size: 13px;
}

.origen-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.origen-badge.sistema {
  background-color: #e3f2fd;
  color: #1976d2;
}

.origen-badge.personalizado {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.botones-exportar{
  margin-top: 20px;
}

/* Dashboard SAT Styles */
.dashboard-filters {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--filtros);
  border-radius: 8px;
}

.period-tabs {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.label-actual, .label-anterior {
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
}

.period-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-light);
  background: var(--white);
  color: var(--primary-light);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.period-tab:hover {
  background: var(--primary-light);
  color: var(--white);
}

.period-tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.period-anterior, .period-anterior-type {
  color: var(--gray);
  font-size: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.dashboard-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid var(--gray);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.dashboard-card.red-accent {
  border-left-color: #e74c3c;
}

.dashboard-card.green-accent {
  border-left-color: #27ae60;
}

.dashboard-card.blue-accent {
  border-left-color: var(--primary-light);
}

.dashboard-card.orange-accent {
  border-left-color: #f39c12;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
}

.card-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header i {
  font-size: 24px;
  color: var(--gray);
  opacity: 0.7;
}

.info-icon {
  font-size: 16px !important;
  color: var(--primary-light) !important;
  opacity: 1 !important;
  cursor: pointer;
  transition: color 0.2s ease;
}

.info-icon:hover {
  color: var(--primary) !important;
}

.card-main-number {
  font-size: 3rem;
  font-weight: 300;
  color: var(--primary);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.card-comparison {
  display: contents;
  align-items: center;
  font-size: 14px;
  color: var(--gray);
}

.card-subtitle {
  font-size: 14px;
  color: var(--gray);
}

.change-indicator {
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 12px;
  float: inline-end;
}

.change-indicator.positive {
  background: #d4edda;
  color: #155724;
}

.change-indicator.negative {
  background: #f8d7da;
  color: #721c24;
}

.dashboard-section {
  margin: 3rem 0;
}

.dashboard-section h2 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.tecnicos-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 1rem;
}

.tecnico-stat {
  background: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease;
}

.tecnico-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tecnico-name {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.tecnico-parts {
  color: var(--gray);
  font-size: 14px;
}

.cliente-revenue {
  font-weight: 600;
  color: var(--primary-light);
  font-size: 14px;
  background: #e8f4f8;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
}

.cliente-stat {
  background: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease;
}

.cliente-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cliente-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.cliente-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.summary-item {
  font-size: 13px;
  color: var(--gray);
}

.cliente-sections {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.cliente-section h4 {
  margin: 0 0 0.8rem 0;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.3rem;
}

.avisos-estados {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.estado-item.aviso-pendiente {
  background: #fff3cd;
  border-left: 3px solid #ffc107;
}

.estado-item.aviso-asignado {
  background: #e2e3ff;
  border-left: 3px solid #6f42c1;
}

.estado-item.aviso-en-curso {
  background: #d1ecf1;
  border-left: 3px solid #17a2b8;
}

.estado-item.aviso-completado {
  background: #d4edda;
  border-left: 3px solid #28a745;
}

@media (max-width: 768px) {
  .cliente-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .cliente-summary {
    align-items: flex-start;
  }
}

.tecnico-estados {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.estado-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 12px;
}

.estado-item.borrador {
  background: #f4f4f4;
  border-left: 3px solid #6c757d;
}

.estado-item.por-firmar {
  background: #fff3cd;
  border-left: 3px solid #ffc107;
}

.estado-item.firmado {
  background: #d4edda;
  border-left: 3px solid #28a745;
}

.estado-item.facturado {
  background: #d1ecf1;
  border-left: 3px solid #17a2b8;
}

.estado-badge {
  font-weight: 500;
  color: #495057;
}

.estado-count {
  font-weight: 600;
  color: var(--primary);
  background: white;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--gray);
}

.no-data {
  text-align: center;
  padding: 2rem;
  color: var(--gray);
  font-style: italic;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-card {
    padding: 1.5rem;
  }

  .card-main-number {
    font-size: 2.5rem;
  }

  .tecnicos-stats {
    grid-template-columns: 1fr;
  }

  .period-tabs {
    justify-content: center;
  }
}

/* Ocultar valoración para clientes específicos */
.ocultar-valoracion .precio-col,
.ocultar-valoracion .importe-col,
.ocultar-valoracion .total-col {
  display: none !important;
}

/* Asegurar que las columnas dentro de tablas también se oculten */
.ocultar-valoracion table .precio-col,
.ocultar-valoracion table .importe-col,
.ocultar-valoracion .total-col {
  display: none !important;
}

/* Media query para impresión */
@media print {
  .ocultar-valoracion .precio-col,
  .ocultar-valoracion .importe-col,
  .ocultar-valoracion .total-col {
    display: none !important;
  }
}

.nombre-comercial{
  padding: 0.5rem;
}
.buttons{
  margin-top: 16px;
}

/* ===== Badges de Estado ===== */
.badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  vertical-align: baseline;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  max-width: 150px;
}

.badge-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.badge-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.badge-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.badge-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.badge-primary {
  background-color: #cfe2ff;
  color: #084298;
  border: 1px solid #b6d4fe;
}

.badge-secondary {
  background-color: #e2e3e5;
  color: #41464b;
  border: 1px solid #d3d6d8;
}
.badges-container{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tabla-datos td .badges-container a{
  padding: 0;
}

/* ===== VERI*FACTU - Estado y Detalles ===== */

/* Detalles VERI*FACTU en modal */
.verifactu-details {
  font-size: 0.95rem;
  line-height: 1.6;
}

.verifactu-details .mb-3 {
  margin-bottom: 1rem;
}

.verifactu-details code.csv-code {
  background-color: #f8f9fa;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  border: 1px solid #dee2e6;
}

.verifactu-details .alert {
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
}

.verifactu-details .alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.verifactu-details .alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.verifactu-details .alert > div {
  margin-bottom: 0.3rem;
}

.verifactu-details .alert > div:last-child {
  margin-bottom: 0;
}

.banner{
  padding: 12px;
  margin: 8px 0;
  border-radius: 6px;
  font-weight: 500;
}
  .banner i{
    margin-right: 5px;
  }
  .banner-info{
    background: #cdebf1;
    color: #0c5460;
    border: 1px solid #afe7f3;
  }
  .banner-solo-lectura{
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffeaa7;
  }

/* ===== Dropdown Menu ===== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-toggle .fa-chevron-down {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.dropdown.open .fa-chevron-down {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 8px 0;
  z-index: 1000;
  display: none;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #333;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.dropdown-item i {
  color: var(--primary-light);
  font-size: 14px;
}

.dropdown-item:hover:not(:disabled) {
  background: var(--bg-color);
  color: var(--primary);
}

.dropdown-item:hover:not(:disabled) i {
  color: var(--primary);
}

.dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropdown-separator {
  height: 1px;
  background: #e0e0e0;
  margin: 4px 0;
}

.menu-separator {
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 4px 0;
}
.tabla-factura{
  border-collapse: separate;
  border-spacing: 0 8px;
  border: none;
}
  .table-factura thead th:first-child {
    border-radius: 8px 0px 0px 8px;
  }
  .table-factura thead th:last-child {
    border-radius: 0 8px 8px 0;
  }
.tabla-factura tbody tr{
  background: white;
}
.tabla-factura tbody td{
  vertical-align: top;
  border-top: solid 1px var(--light-gray);
  border-bottom: solid 1px var(--light-gray);
}
.tabla-factura tbody td:first-child{
  border-left: solid 1px var(--light-gray);
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.tabla-factura tbody td:last-child{
  border-right: solid 1px var(--light-gray);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.tabla-factura thead th{
  border: none;
}
.tabla-factura input, .tabla-factura select{
  border: none;
  padding: 8px 16px;
}
.tabla-factura .small-select, .small-select{
  width: fit-content;
  padding: 2px;
  text-transform: uppercase;
  font-size: 10px;
  border: solid 1px var(--gray);
  margin: 4px;
}
/* ========== ESTILOS PARA TABLAS ORDENABLES ========== */
.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.sortable:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sortable .sort-icon {
  margin-left: 6px;
  font-size: 0.9em;
  transition: color 0.2s;
  color: #ffffff;
  vertical-align: middle;
}

.sortable:hover .sort-icon {
  color: var(--primary-light);
}

.sortable .fa-sort-up,
.sortable .fa-sort-down {
  
}

/* ========== PESTAÑAS DE FACTURAS ========== */

.facturas-tabs {
  display: flex;
  gap: 0;
  margin: 24px 0 20px 0;
  border-bottom: 2px solid var(--light-gray);
}

.tab-button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  position: relative;
  bottom: -2px;
}

.tab-button:hover {
  color: var(--primary);
  background-color: rgba(0, 104, 128, 0.05);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Estilos para select múltiple en filtros */
#filtro-series,
#filtro-etiquetas {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 35px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#filtro-series option,
#filtro-etiquetas option {
  padding: 8px 12px;
}

#filtro-series option:checked,
#filtro-etiquetas option:checked {
  background-color: var(--primary);
  color: white;
}

.label-text {
  display: block;
  margin-bottom: 5px;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--dark-gray);
}

/* ========== FACTURAS ANULADAS ========== */

/* Filas de facturas anuladas - fondo grisáceo suave */
.factura-anulada td {
  background-color: #f7f8f2 !important;
  color: #666;
}

/* Enlaces en facturas anuladas - color más apagado */
.factura-anulada a {
  color: #888;
}

.factura-anulada .badge {
  background-color: #e2e3e5;
  color: #888;
  border: 1px solid #d3d6d8;
}

/* Badges de facturas rectificativas */
.badge-rectificativa-sustitucion {
  background-color: #fff4e6;
  color: #e67700;
  border: 1px solid #ffd699;
}


/* Badge cuando una factura tiene rectificativas asociadas */
.badge-tiene-rectificativas {
  background-color: #f0f0ff;
  color: #5500cc;
  border: 1px solid #d0d0ff;
}

/* Badge clickeable (con cursor y efecto hover) */
.badge-clickeable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-clickeable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.badge-clickeable:active {
  transform: translateY(0);
}

.badge-tiene-sustitucion {
  background-color: #fff0f0;
  color: #cc3300;
  border: 1px solid #ffd0d0;
}

/* ========== PANEL DE FACTURACIÓN ========== */

/* Cards pequeñas para estadísticas */
.dashboard-card-small {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-small-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--dark-gray);
}

.card-small-header i {
  font-size: 20px;
  color: var(--primary);
}

.card-small-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.card-small-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 14px;
  color: #666;
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark-gray);
}

/* Lista de actividad reciente */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.activity-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 104, 128, 0.1);
}

.activity-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--dark-gray);
}

.activity-details {
  font-size: 13px;
  color: #666;
}

.activity-action {
  flex-shrink: 0;
}

/* Clases de texto con color */
.text-error {
  color: var(--red);
  font-weight: 500;
}

.text-warning {
  color: #ffc107;
  font-weight: 500;
}

.text-success {
  color: #28a745;
  font-weight: 500;
}

/* Accento morado para card AEAT */
.dashboard-card.purple-accent .card-header h3 {
  color: #6f42c1;
}

.dashboard-card.purple-accent .card-header i {
  color: #6f42c1;
}

/* Estilos para etiquetas de email */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background-color: var(--primary-light);
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tag-badge:hover {
  background-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tag-badge:active {
  transform: translateY(0);
}

.help-text {
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Tag Selector Component */
.tag-selector-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tag-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.5rem;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  background-color: var(--white);
}

.tag-chips-container:empty {
  display: none;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary);
  color: var(--white);
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0 0 0 0.25rem;
  width: 1rem;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.tag-chip-remove:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.tag-selector-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  font-size: 0.875rem;
  background-color: var(--white);
  cursor: pointer;
}

.tag-selector-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 104, 128, 0.1);
}

/* ============================================================================
   MODAL DE GESTIÓN DE COBROS
   ============================================================================ */

/* Modal más ancho para cobros */
.modal-cobros-wide .modal-dialog {
  max-width: 900px;
  width: 90%;
}

/* Contenedor principal del modal de cobros */
.modal-cobros-content {
  padding: 1rem 0;
}

/* Información de la factura */
.cobros-info-factura {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #dee2e6;
}

.cobro-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cobro-info-item .label {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cobro-info-item .value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #212529;
}

.cobro-info-item .value.cobrado {
  color: #28a745;
}

.cobro-info-item .value.pendiente {
  color: var(--red);
}

.cobro-info-item .value.completado {
  color: #28a745;
}

/* Badges de estado de cobro */
.badge.estado-cobro-pendiente {
  background-color: #ffc107;
  color: #000;
}

.badge.estado-cobro-cobrada {
  background-color: #28a745;
  color: white;
}

.badge.estado-cobro-cobroparcial {
  background-color: #17a2b8;
  color: white;
}

.badge.estado-cobro-impagada {
  background-color: var(--red);
  color: white;
}

/* Tabla de cobros */
.cobros-tabla-container {
  margin: 2rem 0;
}

.cobros-tabla-container h4 {
  margin-bottom: 1rem;
  color: #212529;
  font-size: 1.1rem;
  font-weight: 600;
}

.tabla-cobros {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tabla-cobros thead {
  background-color: #f8f9fa;
}

.tabla-cobros th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tabla-cobros td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e9ecef;
  color: #212529;
  font-size: 0.9rem;
}

.tabla-cobros tbody tr:hover {
  background-color: #f8f9fa;
}

.tabla-cobros tbody tr:last-child td {
  border-bottom: none;
}

.tabla-cobros .text-right {
  text-align: right;
  font-weight: 600;
}

/* Botón de eliminar cobro */
.btn-eliminar-cobro {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-eliminar-cobro:hover {
  background-color: var(--red);
  color: white;
}

/* Formulario de nuevo cobro */
.cobros-form-container {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.cobros-form-container h4 {
  margin-bottom: 1.5rem;
  color: #212529;
  font-size: 1.1rem;
  font-weight: 600;
}

.form-cobro .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-cobro .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-cobro label {
  font-weight: 500;
  font-size: 0.9rem;
  color: #495057;
}

.form-cobro input[type="text"],
.form-cobro input[type="number"],
.form-cobro input[type="date"],
.form-cobro select {
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.2s;
  background-color: white;
}

.form-cobro input:focus,
.form-cobro select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 104, 128, 0.1);
}

.form-cobro .help-text {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.form-cobro .form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* Mensajes */
.no-cobros {
  padding: 2rem;
  text-align: center;
  color: #6c757d;
  background: #f8f9fa;
  border-radius: 6px;
  margin: 1rem 0;
}

.factura-cobrada {
  padding: 1.5rem;
  text-align: center;
  color: #28a745;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  margin: 1rem 0;
  font-weight: 500;
  font-size: 1.05rem;
}

.factura-cobrada i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-cobros-wide .modal-dialog {
    width: 95%;
    max-width: none;
  }

  .cobros-info-factura {
    grid-template-columns: 1fr;
  }

  .form-cobro .form-row {
    grid-template-columns: 1fr;
  }

  .tabla-cobros {
    font-size: 0.8rem;
  }

  .tabla-cobros th,
  .tabla-cobros td {
    padding: 0.5rem;
  }
}

/* ============================================================================
   BADGES DE ESTADO DE COBRO (Lista de facturas)
   ============================================================================ */

.secondary-badge{
  border: solid 2px;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-cobro-success {
  border-color: var(--green);
  color: var(--green);
  display: inline-block;
  margin-top: 0.25rem;
}

.badge-cobro-warning {
  border-color: var(--primary-light);
  color: var(--primary-light);
  display: inline-block;
  margin-top: 0.25rem;
}

.badge-cobro-danger {
  background-color: var(--red);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
  margin-top: 0.25rem;
}

.badge-cobro-secondary {
  border-color: #6c757d;
  color: #6c757d;
  display: inline-block;
  margin-top: 0.25rem;
}

/* Ajustar el contenedor de badges para que estén en columna */
.badges-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

/* ========== TAB BUTTONS ========== */
.tab-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-buttons .tab-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--light-gray);
  background: white;
  cursor: pointer;
  border-radius: 4px;
  font-family: "Nunito Sans", sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.tab-buttons .tab-btn:hover {
  background: var(--bg-gray);
}

.tab-buttons .tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}


/* ========== HOME PAGE ========== */
.home-hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.home-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 104, 128, 0.3);
}

.home-logo.has-image {
  width: auto;
  height: auto;
  max-width: 200px;
  max-height: 120px;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.home-logo i {
  font-size: 3.5rem;
  color: white;
}

.home-logo img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.home-empresa {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-gray);
  margin: 0 0 0.5rem;
}

.home-subtitulo {
  font-size: 1rem;
  color: var(--gray);
  margin: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.home-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.home-card.blue { border-left-color: #3498db; }
.home-card.green { border-left-color: #27ae60; }
.home-card.orange { border-left-color: #e67e22; }
.home-card.red { border-left-color: #e74c3c; }
.home-card.purple { border-left-color: #9b59b6; }
.home-card.teal { border-left-color: #1abc9c; }

.home-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-card.blue .home-card-icon { background: rgba(52, 152, 219, 0.1); color: #3498db; }
.home-card.green .home-card-icon { background: rgba(39, 174, 96, 0.1); color: #27ae60; }
.home-card.orange .home-card-icon { background: rgba(230, 126, 34, 0.1); color: #e67e22; }
.home-card.red .home-card-icon { background: rgba(231, 76, 60, 0.1); color: #e74c3c; }
.home-card.purple .home-card-icon { background: rgba(155, 89, 182, 0.1); color: #9b59b6; }
.home-card.teal .home-card-icon { background: rgba(26, 188, 156, 0.1); color: #1abc9c; }

.home-card-icon i {
  font-size: 1.5rem;
}

.home-card-content {
  flex: 1;
  min-width: 0;
}

.home-card-content h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark-gray);
}

.home-card-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray);
}
