/* ========================================================
   DISEÑO MODERNO, RESPONSIVO Y MOBILE-FIRST (ARTESANAL COSTOS)
   ======================================================== */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

[data-bs-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding-bottom: 75px; /* Espacio para barra de navegación móvil */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Tarjetas Visuales y Contenedores */
.card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    overflow: hidden;
}

.card-custom:hover {
    box-shadow: var(--shadow-md);
}

.card-kpi {
    border-left: 4px solid var(--primary-color);
}
.card-kpi.success { border-left-color: var(--success-color); }
.card-kpi.warning { border-left-color: var(--warning-color); }
.card-kpi.danger { border-left-color: var(--danger-color); }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Botones Grandes y Amigables */
.btn-lg-custom {
    padding: 12px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}
.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Botón Flotante de Acción (FAB) */
.fab-btn {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: var(--shadow-lg);
    z-index: 1040;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fab-btn:hover {
    color: #ffffff;
    transform: scale(1.08) rotate(90deg);
}

/* Barra de Navegación Inferior Móvil */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-bottom-nav .nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease;
}

.mobile-bottom-nav .nav-item-mobile i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item-mobile.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Wizard / Pasos de Formulario */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    position: relative;
}
.wizard-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}
.step-item {
    position: relative;
    z-index: 2;
    background: var(--bg-card);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}
.step-item.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #ffffff;
}
.step-item.completed {
    border-color: var(--success-color);
    background: var(--success-color);
    color: #ffffff;
}

/* Adaptación de Tablas a Tarjetas en Pantallas Móviles */
@media (max-width: 767.98px) {
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards tbody tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        padding: 12px 16px;
        box-shadow: var(--shadow-sm);
    }
    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 6px 0;
    }
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
    }
}

/* Ocultar navegación móvil en pantallas grandes */
@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none;
    }
    body {
        padding-bottom: 30px;
    }
}
