/* ============================================
   MÓDULO PLANEACIÓN IA
   ============================================ */
.planeacion-ia-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    max-width: 1000px;
    margin: 20px auto;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.planeacion-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5986 100%);
    color: #fff;
    padding: 20px 25px;
}
.planeacion-header h2 { margin: 0 0 5px 0; font-size: 22px; }
.planeacion-header p { margin: 0; font-size: 14px; opacity: 0.9; }

.planeacion-input-area {
    padding: 25px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.planeacion-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s;
}
.planeacion-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.planeacion-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.char-counter {
    font-size: 12px;
    color: #94a3b8;
}

.btn-generar-ia {
    background: #e07a3a; /* Naranja corporativo */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(224, 122, 58, 0.3);
}
.btn-generar-ia:hover { background: #c96a2e; transform: translateY(-1px); }
.btn-generar-ia:active { transform: translateY(0); }
.btn-generar-ia:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }

/* ÁREA DE RESULTADOS */
.planeacion-resultado-area {
    padding: 0;
}

.resultado-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.resultado-toolbar h3 { margin: 0; font-size: 16px; color: #1e3a5f; }

.btn-copiar-ia {
    background: transparent;
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    transition: all 0.2s;
}
.btn-copiar-ia:hover { background: #e2e8f0; }

/* ============================================
   CONTENEDOR DEL HTML GENERADO POR GEMINI
   ============================================ */
.contenido-ia-generado {
    padding: 30px;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: auto; /* Seguro contra tablas anchas */
}

/* Limpiar y estilizar el HTML que escupe la IA */
.contenido-ia-generado h3 {
    color: #1e3a5f;
    border-bottom: 2px solid #e07a3a;
    padding-bottom: 8px;
    margin-top: 30px;
}
.contenido-ia-generado h4 {
    color: #333;
}

.contenido-ia-generado table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}
.contenido-ia-generado th, 
.contenido-ia-generado td {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
}
.contenido-ia-generado th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

/* Estilo base para los botones de imprimir inyectados por JS */
.btn-imprimir-orden {
    background: #1e3a5f;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin: 15px 0;
    display: block;
    width: 100%;
    text-align: center;
    transition: background 0.2s;
}
.btn-imprimir-orden:hover { background: #2d5986; }