* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    background-color: #f5f7f9;
}

body {
    display: flex;
    flex-direction: column;
    overflow-y: auto; 
}

.container {
    display: flex;
    height: 100vh;
}

.login-layout {
    display: flex;
    height: 100vh;
}

/* 2. Aumentar el tamaño del logo */
.logo_marco{
  height: 40px; /* Tamaño mas grande para el logo */
  width: auto;
}

/* Columna izquierda */
.left {
    flex: 60%;
    background-size: cover;
    background-position: 1% center;
    background-repeat: no-repeat;
    transition: opacity 1s ease-in-out;
}

.left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Columna derecha */
.right {
    flex: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #ffffff;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.login-card h1 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.login-card h2 {
    margin-top: 5px;
    color: #0072ce;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
}

label {
    font-size: 14px;
    color: #444;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="search"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    
    background: #0072ce;
    color: #fff;
    padding: 12px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background: #005fa3;
}

form button,
.login-card button {
    width: 100%;
}

.error {
    background: #ffe0e0;
    color: #a00;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

#tabla-alb tbody tr.fila-baja td {
    background-color: #d76f6f !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .left {
        display: none;
    }

    .right {
        flex: 100%;
    }
}

.logo-area{
    display: flex;
    flex-direction: column;
    align-items:center;
}

/* Área del logo y nombre de la app */
.logo-area img {
    width: 200px; /* Ajusta el tamaño de tu logo */
    margin-bottom: 10px;
}

.logo-area h1 {
    color: #007bff; /* Color azul para el nombre "TimelyCare" */
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 30px;
}

.logo_menu{
  display: flex;
  flex-direction: column;
  align-items:center;
}

.logo_menu{
  width: 30px;
  margin-bottom: 10px;
}

.menu-container {
  flex: 1; /* 👈 ocupa el espacio disponible */

  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 2rem;

  width: 100%;
  max-width: 1400px;
  margin: 0 auto;

  padding: 2rem;

  justify-content: center; /* Este centra los botones */
}

/* Información del dominio */
.domain-info {
    margin-top: 40px;
    font-size: 12px;
    color: #888;
}

.login-error {
  background: #ffdddd;
  color: #900;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #f00;
}

.app-footer {
  padding: 1rem 2rem;
  background-color: #f1f1f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #555;
}

.app-version {
  font-weight: 500;
}

.busqueda-flex {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

/* MISMA ALTURA PARA TODO */
.busqueda-flex .btn,
.busqueda-flex .form-control,
.busqueda-flex .form-select {
  height: 32px !important;
  line-height: 32px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  width: auto;
  max-width: 160px;
}

/* Botones */
.busqueda-flex .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 576px) {
  .busqueda-flex {
    flex-wrap: wrap;
  }

  .busqueda-flex .btn,
  .busqueda-flex .form-control,
  .busqueda-flex .form-select {
    width: 100%;
    max-width: 100%;
  }
}

.busqueda-barra {
  margin-bottom: 1rem;
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

#tabla-reg{
  width: 100%;
  min-width: 1400px;
  border-collapse: collapse;

}

.table .btn {
    width: auto !important;
}

#tabla-reg th,
#tabla-reg td {
    white-space: nowrap;
}

.dataTables_wrapper {
    width: 100%;
}

.dataTables_scrollBody {
    overflow-x: auto !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: flex;
    align-items: center;
}

/* Separacion entre label y control */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label{
    margin-bottom: 0;
}

/* Ajuste fino de inpouts y selects */
.dataTables_wrapper select,
.dataTables_wrapper input[type="search"] {
    height: 38px;
}

/* Para celular */
@media (max-width: 768px) {
    .table.dataTable {
        min-width: 1200px;
    }
}

/* Transiciones del wizard */
.step {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Stepper */
.stepper-container {
    user-select: none;
}

.step-item {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    background: #dee2e6;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    line-height: 36px;
    font-weight: bold;
    margin: 0 auto;
}

.step-label {
    font-size: 0.8rem;
    margin-top: 5px;
    color: #6c757d;
}

.step-line {
    height: 2px;
    background: #dee2e6;
    flex: 1;
    margin: 0 5px;
}

.step-item.active .step-circle,
.step-item.completed .step-circle {
    background: #acfb77;
    color: #fff;
}

.step-item.completed .step-circle {
    background: #198754;
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: #000;
}

.step-line.completed {
    background: #198754;
}

.step-item.active {
    background: #7bbfe6ee;
    color: #030303;
}

.step-item.completed {
    background: #bcefc0;
    color: #030303;
}

/* Barra de progreso */
.progress-bar {
    transition: width 0.4s ease;
}

input[type="text"] {
    text-transform: uppercase;
}

.no-uppercase {
    text-transform: none !important;
}

input[type="email"] {
    text-transform: uppercase;
}

.modal-footer .btn {
    width: auto;    /* para forzar el tamaño de los botones en el modal  */
}

.hidden {
    display: none !important;
}

/* Inputs y textareas en solo lectura */
input[readonly],
textarea[readonly] {
    background-color: #e9ecef;   /* mismo gris que Bootstrap */
    color: #495057;
    cursor: not-allowed;
    opacity: 1;                  /* evita look deslavado */
}

/* Evitar foco visual confuso */
input[readonly]:focus,
textarea[readonly]:focus {
    box-shadow: none;
    border-color: #ced4da;
    outline: none;
}

/* Esto es para colorear los estatus de baja o Modificacion de la tabla */
tr.row-baja > td {
    background-color: #f8d7da !important;
    color: #842029 !important;
}

.row-activo {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.row-empresa-baja td{
    background:#f8d7da !important;
    color:#842029 !important;
}

.row-sucursal-baja td{
    background:#fde2e4 !important;
    color:#7f1d1d !important;
}

.modal-info-custom {
    background: linear-gradient(135deg, #e7eda6, #cce46f);
    color: rgb(3, 3, 3);
    border-radius: 15px;
}

.modal-info-custom .modal-header,
.modal-info-custom .modal-footer {
    border: none;
}


/* Contenedor de check box de sucursales */
.sucursales-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sucursal-item {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f8f9fa;

    font-size: 13px;
    cursor: pointer;

    width: calc(33% - 8px); /* para tener 3 check box por linea */
}

/* checkbox más pequeño */
.sucursal-item input {
    transform: scale(0.9);
    margin: 0;
}

/* efecto visual seleccionado */
.sucursal-item input:checked + span {
    font-weight: 500;
    color: #0d6efd;
}

.sucursal-item:hover {
    background: #e9ecef;
}

.perfil-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f3f5;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 4px 8px;          /* más compacto */
    font-size: 13px;           /* texto pequeño */
    color: #2c3e50;
    white-space: nowrap;       /* evita saltos */
}

.perfil-chip input[type="checkbox"] {
    transform: scale(0.85);    /* checkbox más pequeño */
}

.perfil-chip span {
    display: inline;
    font-weight: 500;
}

.perfil-chip .btnEliminarPerfil {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 14px;
    padding: 0 4px;
    line-height: 1;
    cursor: pointer;
}

.perfil-chip .btnEliminarPerfil:hover {
    color: #dc3545; /* rojo suave al hover */
}


.perfil-chip:has(input:checked) {   /* Se marca cuando se seleccione */
    background: #e7f1ff;
    border-color: #b6d4fe;
    color: #0d6efd;
}

.nowrap {
    white-space: nowrap;
}

.tablaEstudios {
    min-width: 800px;
}

.tablaEstudios input {
    min-width: 300px;
}

.tablaEstudios thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

.modal-footer {
    background: white;
    z-index: 10;
}

.login-card button {
    width: 100%;
}

.modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* ============================================================
   Fix modales tipo wizard (Nuevo Estudio, Nuevo Servicio,
   Nueva Compania, Nueva Sucursal, y el resto de los modales
   "Nuevo ..." que comparten el mismo id #modalNuevo/#formWizard).

   El body y el footer de estos modales estan dentro de un <form>,
   que queda como hijo intermedio de .modal-content. Bootstrap
   espera que .modal-header, .modal-body y .modal-footer sean
   hijos DIRECTOS de .modal-content (que es flex-column) para que
   el body pueda encogerse/hacer scroll y el footer quede siempre
   visible. Como el <form> no participaba de ese layout flex (y
   ademas .modal-body de arriba fija un alto en base a 100vh sin
   considerar el alto real del header + stepper + footer), en
   pantallas chicas o con zoom el modal terminaba siendo mas alto
   que la ventana: el footer con los botones "Siguiente"/"Guardar"
   quedaba fuera del viewport y no habia forma de hacer scroll
   para alcanzarlo.

   Al convertir el <form> en flex-column, el body ahora sí ocupa
   el espacio restante real y hace scroll internamente, mientras
   que el header, el stepper y el footer quedan siempre visibles.
   ============================================================ */
#modalNuevo #formWizard {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0; /* permite que el body se encoja y haga scroll en vez de desbordar */
}

#modalNuevo .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none; /* anula el max-height fijo de la regla general de arriba */
    overflow-y: auto;
}

#modalNuevo .modal-footer {
    flex-shrink: 0;
}


/* Son colores para pintar las celdas de la agenda */ 

.bg-verde-suave {
    background-color: #d4edda !important;
    color: #155724 !important;
}

.bg-amarillo-suave {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

.bg-rojo-suave {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

.bg-azul-suave {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
}

#modalNuevo .select2-container {
    width: 100% !important;
}

/* ============================================================
   Modales de feria en celular (#modalNuevo, wizard de captura)
   Requiere <meta name="viewport"> en la vista.
   ============================================================ */
@media (max-width: 767.98px) {

    /* El dialogo ocupa casi toda la pantalla */
    #modalNuevo .modal-dialog {
        margin: .5rem;
        max-width: none;
        height: calc(100dvh - 1rem);
    }

    #modalNuevo .modal-content {
        height: 100%;
        max-height: 100%;
    }

    #modalNuevo .modal-header {
        padding: .6rem .9rem;
    }

    #modalNuevo .modal-title {
        font-size: 1.1rem;
    }

    /* Stepper compacto: menos relleno y texto que no se desborda */
    #modalNuevo .stepper-container {
        padding: 0 .9rem;
    }

    #modalNuevo .step-item {
        padding: 4px 2px;
        font-size: 11px;
        margin: 0 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #modalNuevo .modal-body {
        padding: .75rem .9rem;
        -webkit-overflow-scrolling: touch;
    }

    /* 16px evita el zoom automatico de iOS al enfocar un campo,
       y la altura facilita el toque con el dedo */
    #modalNuevo .form-control,
    #modalNuevo .form-select {
        font-size: 16px;
        min-height: 44px;
    }

    #modalNuevo textarea.form-control {
        min-height: 80px;
    }

    #modalNuevo .etiquetaL {
        font-size: .85rem;
        margin-bottom: .15rem;
    }

    /* Un campo por renglon con separacion entre ellos */
    #modalNuevo .row > [class*="col-"] {
        margin-bottom: .6rem;
    }

    /* Sucursales: una por renglon en vez de 3 */
    #modalNuevo .sucursal-item {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Footer siempre visible, botones grandes y repartidos */
    #modalNuevo .modal-footer {
        padding: .6rem .9rem;
        gap: .5rem;
        flex-wrap: nowrap;
    }

    #modalNuevo .modal-footer .btn {
        flex: 1 1 0;
        margin: 0;
        min-height: 44px;
        width: auto;
    }

    /* Pantalla de confirmacion: etiquetas y valores en una columna */
    #modalNuevo #summaryContent > * {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Modal de informacion */
    #modalInfo .modal-dialog {
        margin: .5rem;
    }
}

/* Celulares muy angostos */
@media (max-width: 380px) {
    #modalNuevo .step-item {
        font-size: 10px;
    }
}
