/* =========================================================
   SICS - Hoja de Estilos Personalizada (Enterprise Grade)
   ========================================================= */

/* GLOBAL RESETS (Aplicados a vistas modernas) */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f9ff;
    color: #1e293b;
    overflow-x: hidden;
}

/* ==========================================================================
   APP SHELL LAYOUT (Sidebar Colapsable + Header)
   ========================================================================== */
#app-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: #ffffff;
    color: #1e293b;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

#sidebar.collapsed {
    min-width: 70px;
    max-width: 70px;
}

#sidebar .sidebar-header {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #f1f5f9;
    background: #ffffff;
    padding: 0 10px;
}

#sidebar.collapsed .sidebar-text,
#sidebar.collapsed .badge {
    display: none !important;
}

#sidebar.collapsed .sidebar-header .logo-large {
    display: none;
}

#sidebar:not(.collapsed) .sidebar-header .logo-mini {
    display: none;
}

#sidebar .menu-list {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 15px;
}

#sidebar.collapsed .accordion-button::after {
    display: none;
}

#sidebar.collapsed .accordion-button {
    justify-content: center;
    padding: 10px 0;
}

#sidebar.collapsed .accordion-body {
    padding: 5px 0;
}

#sidebar.collapsed .accordion-body a {
    justify-content: center;
    padding: 8px 0;
}

#sidebar.collapsed .icono-modulo {
    margin-right: 0 !important;
    font-size: 20px;
}

#content-wrapper {
    min-width: 0;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Toggle Button */
.btn-toggle-sidebar {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.15);
}

[x-cloak] {
    display: none !important;
}

/* =========================================================
   LOGIN & UTILERÍAS COMUNES
   ========================================================= */

/* Contenedor principal responsive */
.login-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    min-height: 100dvh;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* =========================================================
   FORMULARIOS Y CONTROLES (Inputs Modernos)
   ========================================================= */

/* Estilo sutil para el input con icono a la izquierda */
.input-group-text.icon-bg-white {
    background-color: #ffffff;
    border-right: none;
    color: #94a3b8;
}

.form-control.input-no-border-left {
    border-left: none;
}

.form-control.input-no-border-left:focus {
    box-shadow: none;
    /* Quitamos la sombra nativa para evitar corte */
    border-color: #dee2e6;
}

/* Efecto de foco envolvente para el grupo de inputs moderno */
.input-group-modern:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
    border-radius: 0.375rem;
}

.input-group-modern:focus-within .input-group-text,
.input-group-modern:focus-within .form-control {
    border-color: #86b7fe;
}

/* =========================================================
   BOTONES
   ========================================================= */

/* Botón primario corporativo */
.btn-primary-custom {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

.btn-primary-custom:disabled {
    background-color: #94a3b8;
    border-color: #94a3b8;
}

/* =========================================================
   COMPONENTES HEADER GLOBAL DE SICS (index.php)
   ========================================================= */

img.img-logo {
    max-height: 70px;
    margin-top: -7px;
    margin-bottom: -10px;
    box-shadow: 1px -8px 20px 1px #175aa1;
    border-radius: 0 0 12px 12px;
    margin-right: 20px;
}

h3.sics-title {
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px #000;
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 20px;
    background-color: #0e4788;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 1px -8px 20px 1px #175aa1;
    display: inline-block;
}

#loader-wrapper {
    z-index: 10000;
}

body.loaded #loader-wrapper,
body.loaded #overlay {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
    pointer-events: none;
}

/* =========================================================
   COMPATIBILIDAD BOOTSTRAP 3.4 (.btn-default)
   ========================================================= */
.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.btn-default:focus,
.btn-default.focus {
    color: #333;
    background-color: #e6e6e6;
    border-color: #8c8c8c;
}

.btn-default:hover {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

.btn-default:active,
.btn-default.active,
.open>.dropdown-toggle.btn-default {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

/* =========================================================
   COMPATIBILIDAD BOOTSTRAP (.btn-xs y .btn-sm)
   ========================================================= */
.btn-xs,
.btn-group-xs>.btn,
.btn-sm,
.btn-group-sm>.btn {
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 4px;
}

/* =========================================================
   MODERN TRACKER (Trazabilidad Global)
   ========================================================= */
.modern-tracker {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 10px 0;
    margin-bottom: 1rem;
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
}

.modern-tracker-step {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 5px;
    flex: 1 1 0%;
    min-width: 0;
    word-break: break-word;
}

/* Step Connector */
.step-connector {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 4px;
    background-color: #e2e8f0;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.modern-tracker-step.completed .step-connector {
    background-color: #198754;
}

.modern-tracker-step.last-visible .step-connector {
    display: none !important;
}

.tracker-icon-container {
    position: relative;
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 4px;
    background: transparent;
}

.tracker-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    background-color: #fff;
}

.modern-tracker-step.completed .tracker-icon {
    background-color: #198754;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
}

.modern-tracker-step.completed .tracker-title-text {
    color: #198754;
}

.modern-tracker-step.in-progress .tracker-icon {
    background-color: #f59e0b;
    color: #fff;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.4);
}

.modern-tracker-step.in-progress .tracker-title-text {
    color: #d97706;
}

.tracker-title-text {
    /* text-decoration: underline dashed; */
}

.modern-tracker-step.pending .tracker-icon {
    background-color: #f8fafc;
    color: #94a3b8;
    border: 2px solid #e2e8f0;
}

.modern-tracker-step.pending .tracker-title-text {
    color: #94a3b8;
}

.tracker-title {
    font-size: 0.80rem;
    font-weight: 600;
    color: #334155;
    display: block;
    line-height: 1.1;
}

/* =========================================================
   ADJUNTOS DROPDOWN (Global en Grillas)
   ========================================================= */
.table-moderna td.text-center .btn-group { position: relative; } 
.adjuntos-dropdown { 
    right: 0 !important; 
    left: auto !important; 
    margin-top: 8px !important; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important; 
    border-radius: 12px !important; 
    padding: 0 !important; 
    overflow: hidden; 
    animation: fadeInDropdown 0.2s ease-out; 
} 
.dropdown-item-adjunto:hover { 
    background-color: #f8fafc !important; 
    padding-left: 18px !important; 
}
.btn-adjuntos-trigger {
    border-radius: 20px; 
    border: 1px solid #e2e8f0; 
    background: #ffffff; 
    color: #334155; 
    font-size: 12px; 
    font-weight: 600; 
    padding: 5px 14px; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.03); 
    transition: all 0.2s ease;
}
.btn-adjuntos-trigger:hover { 
    background-color: #f1f5f9 !important; 
    border-color: #cbd5e1 !important; 
    transform: translateY(-1px); 
}
@keyframes fadeInDropdown { 
    from { opacity: 0; transform: translateY(-8px); } 
    to { opacity: 1; transform: translateY(0); } 
}