/* Layout Master-Detail */
.config-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
}

/* Page Header */
.page-header h1 { margin-bottom: 0.5rem; color: #1e293b; }
.page-header p { color: #64748b; margin-top: 0; }

/* Sidebar (Produtos) */
.sidebar-products {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.sidebar-content {
    overflow-y: auto;
    flex: 1;
}

.product-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #334155;
}

.product-item:hover {
    background: #f8fafc;
    padding-left: 1.5rem; /* Efeito de slide */
}

.product-item.active {
    background: #f3e8ff;
    border-left: 4px solid #9333ea;
    color: #6b21a8;
    font-weight: 600;
}

/* Painel Direito (Planos) */
.plans-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    min-height: 400px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.panel-header h2 { margin: 0; color: #1e293b; font-size: 1.5rem; }
.panel-header span { color: #64748b; font-size: 0.9rem; }

/* Empty State */
.empty-state {
    text-align: center;
    color: #94a3b8;
    margin-top: 4rem;
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* Card de Plano */
.plan-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    border-color: #9333ea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.1);
}

.plan-info h4 { margin: 0 0 0.25rem 0; color: #1e293b; font-size: 1.1rem; }
.plan-info small { color: #64748b; font-size: 0.85rem; }

.plan-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.plan-price { 
    font-weight: 700; 
    color: #16a34a; 
    font-size: 1.1rem; 
    background: #dcfce7;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Botões Customizados */
.btn-purple { 
    background-color: #9333ea; 
    color: white; 
    border: none; 
    padding: 0.6rem 1.2rem; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600;
    transition: background 0.2s;
}
.btn-purple:hover { background-color: #7e22ce; }

.btn-add-mini {
    background: white; 
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.75rem; 
    padding: 4px 10px;
    font-weight: 600;
    color: #475569;
}
.btn-add-mini:hover { background: #f1f5f9; color: #9333ea; border-color: #9333ea; }

.btn-delete {
    background: transparent;
    border: 1px solid #fee2e2;
    color: #ef4444;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
}
.btn-delete:hover { background: #fee2e2; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    background: white; width: 100%; max-width: 450px; padding: 2rem;
    border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    transform: scale(0.95); transition: transform 0.2s;
}
.modal-overlay.active .modal-content { transform: scale(1); }

.modal-subtitle { color: #64748b; font-size: 0.9rem; margin-top: -0.5rem; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; color: #334155; }
.form-group input, .form-group textarea {
    width: 100%; padding: 0.75rem; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 0.95rem;
}
.form-group input:focus { border-color: #9333ea; outline: none; }

.form-row { display: flex; gap: 1rem; }
.half { flex: 1; }

.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; pt: 1rem; border-top: 1px solid #f1f5f9; }

/* Loading */
.loading-spinner { text-align: center; padding: 2rem; color: #94a3b8; }