/* ProyectosPlus v2 - CSS Principal */

/* Fuente más grande en contenido del módulo */
.pp-container {
    padding: 15px;
    font-size: 14px;
}

.pp-container p,
.pp-container td,
.pp-container th,
.pp-container label,
.pp-container input,
.pp-container select,
.pp-container textarea,
.pp-container .pp-card-desc,
.pp-container .pp-alert {
    font-size: 14px;
}

.pp-container h1 { font-size: 22px; }
.pp-container h2 { font-size: 18px; }
.pp-container h3 { font-size: 16px; }
.pp-container h4 { font-size: 15px; }

/* Título */
.pp-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.pp-title h1 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botones */
.pp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.pp-btn-primary { background: #3498db; color: #fff; }
.pp-btn-primary:hover { background: #2980b9; color: #fff; }

.pp-btn-success { background: #27ae60; color: #fff; }
.pp-btn-success:hover { background: #219a52; color: #fff; }

.pp-btn-danger { background: #e74c3c; color: #fff; }
.pp-btn-danger:hover { background: #c0392b; color: #fff; }

.pp-btn-secondary { background: #ecf0f1; color: #333; }
.pp-btn-secondary:hover { background: #d5dbdb; color: #333; }

.pp-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Cards */
.pp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.pp-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.pp-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52,152,219,0.15);
    transform: translateY(-2px);
}

.pp-card.selected {
    border-color: #3498db;
    background: #ebf5fb;
}

.pp-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    margin-bottom: 12px;
}

.pp-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.pp-card-desc {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.pp-card-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* Tablas */
.pp-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pp-table th {
    background: #f8f9fa;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pp-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.pp-table tr:hover {
    background: #f8f9fa;
}

.pp-table tr.clickable {
    cursor: pointer;
}

.pp-table tr.clickable:hover {
    background: #ebf5fb;
}

/* Badges */
.pp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.pp-badge-success { background: #d4edda; color: #155724; }
.pp-badge-warning { background: #fff3cd; color: #856404; }
.pp-badge-danger { background: #f8d7da; color: #721c24; }
.pp-badge-info { background: #d1ecf1; color: #0c5460; }

/* Alertas */
.pp-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pp-alert-success { background: #d4edda; color: #155724; border-left: 4px solid #27ae60; }
.pp-alert-error { background: #f8d7da; color: #721c24; border-left: 4px solid #e74c3c; }
.pp-alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #f39c12; }
.pp-alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid #3498db; }

/* Formularios */
.pp-form-group {
    margin-bottom: 18px;
}

.pp-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
}

.pp-form-group input[type="text"],
.pp-form-group input[type="number"],
.pp-form-group input[type="date"],
.pp-form-group input[type="email"],
.pp-form-group select,
.pp-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pp-form-group input:focus,
.pp-form-group select:focus,
.pp-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

.pp-form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.pp-form-row .pp-form-group {
    flex: 1;
    min-width: 200px;
}

.pp-required {
    color: #e74c3c;
}

/* Wizard */
.pp-wizard {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.pp-wizard-steps {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.pp-wizard-step {
    flex: 1;
    padding: 18px 15px;
    text-align: center;
    font-size: 13px;
    color: #888;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pp-wizard-step.active {
    background: #fff;
    color: #3498db;
    font-weight: 600;
}

.pp-wizard-step.completed {
    color: #27ae60;
}

.pp-wizard-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.pp-wizard-step.active .pp-wizard-step-number {
    background: #3498db;
}

.pp-wizard-step.completed .pp-wizard-step-number {
    background: #27ae60;
}

.pp-wizard-content {
    padding: 30px;
}

.pp-wizard-actions {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

/* Fases preview */
.pp-fases-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.pp-fase-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.pp-fase-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3498db;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.pp-fase-info {
    flex: 1;
}

.pp-fase-name {
    font-weight: 500;
    color: #2c3e50;
}

.pp-fase-meta {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

/* Summary */
.pp-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px 0;
}

.pp-summary-row {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid #e8e8e8;
}

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

.pp-summary-label {
    width: 150px;
    color: #666;
    font-size: 13px;
}

.pp-summary-value {
    flex: 1;
    color: #2c3e50;
}

/* Panel de fichas (derecha) */
.pp-panel-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.4) !important;
    z-index: 99998 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.pp-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pp-panel {
    position: fixed !important;
    top: 0 !important;
    right: -600px;
    width: 580px !important;
    height: 100% !important;
    max-height: 100vh !important;
    background: #fff !important;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15) !important;
    z-index: 99999 !important;
    transition: right 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.pp-panel.active {
    right: 0 !important;
}

.pp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    flex-shrink: 0;
}

.pp-panel-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pp-panel-header .pp-badge {
    font-size: 11px;
    padding: 3px 10px;
}

.pp-panel-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pp-panel-close:hover {
    background: rgba(255,255,255,0.25);
}

/* Pestañas del panel */
.pp-panel-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.pp-panel-tab {
    flex: 1;
    padding: 14px 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pp-panel-tab i {
    font-size: 16px;
}

.pp-panel-tab:hover {
    background: #fff;
    color: #3498db;
}

.pp-panel-tab.active {
    background: #fff;
    color: #3498db;
    border-bottom-color: #3498db;
}

.pp-panel-tab .pp-tab-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* Contenido del panel */
.pp-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.pp-panel-section {
    display: none;
    padding: 24px;
}

.pp-panel-section.active {
    display: block;
}

.pp-panel-section h4 {
    margin: 0 0 15px 0;
    font-size: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pp-panel-section h4 i {
    color: #3498db;
}

/* Info grid en panel */
.pp-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.pp-info-item {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.pp-info-item.full {
    grid-column: 1 / -1;
}

.pp-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 4px;
}

.pp-info-value {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

/* Acciones del panel */
.pp-panel-actions {
    padding: 15px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pp-panel-actions .pp-btn {
    flex: 1;
    justify-content: center;
}

/* Lista vacía en pestañas */
.pp-empty-tab {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.pp-empty-tab i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.pp-empty-tab p {
    margin: 0;
    font-size: 14px;
}

/* Loading */
.pp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #888;
}

.pp-loading i {
    font-size: 32px;
    animation: pp-spin 1s linear infinite;
}

@keyframes pp-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 700px) {
    .pp-panel {
        width: 100%;
        right: -100%;
    }
    
    .pp-panel-tab span {
        display: none;
    }
    
    .pp-info-grid {
        grid-template-columns: 1fr;
    }
}
