/**
 * Budget Tab CSS — Estilos para la pestaña de presupuesto en el diseñador.
 *
 * H211 (Sprint 41): Pestaña "Presupuesto" en sidebar del diseñador.
 *
 * @package TodoFotovoltaica
 * @since   0.1.0
 */

/* ── Panel de presupuesto ── */
.tfv-budget-panel {
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    margin-bottom: 16px;
}

.tfv-budget-panel .tfv-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a5276;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1c40f;
}

/* ── Búsqueda de productos ── */
.tfv-budget-search {
    margin-bottom: 12px;
}

.tfv-budget-search label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.tfv-search-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tfv-search-filter {
    width: 110px;
    font-size: 11px;
}

.tfv-search-input {
    flex: 1;
    font-size: 11px;
}

.tfv-search-results {
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fafafa;
    max-height: 250px;
    overflow-y: auto;
}

.tfv-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tfv-search-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 11px;
}

.tfv-search-result-item:hover {
    background: #e8f4fd;
}

.tfv-search-result-item:last-child {
    border-bottom: none;
}

.tfv-result-type {
    background: #1a5276;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tfv-result-desc {
    flex: 1;
    color: #333;
}

.tfv-result-price {
    font-weight: 600;
    color: #27ae60;
    white-space: nowrap;
}

.tfv-result-add {
    color: #2980b9;
    font-weight: 600;
    font-size: 10px;
    cursor: pointer;
}

.tfv-result-add:hover {
    text-decoration: underline;
}

.tfv-search-loading,
.tfv-search-empty,
.tfv-search-error {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: #888;
}

.tfv-search-error {
    color: #e74c3c;
}

/* ── Añadir manual ── */
.tfv-budget-manual {
    margin-bottom: 10px;
}

.tfv-budget-manual details {
    font-size: 11px;
}

.tfv-budget-manual summary {
    cursor: pointer;
    font-weight: 600;
    color: #2980b9;
    padding: 4px 0;
}

.tfv-manual-form {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #eee;
}

.tfv-manual-input {
    width: 100%;
    margin-bottom: 6px;
    font-size: 11px;
}

.tfv-manual-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tfv-manual-qty {
    width: 60px;
    font-size: 11px;
}

.tfv-manual-price {
    flex: 1;
    font-size: 11px;
}

/* ── Acciones rápidas ── */
.tfv-budget-quick {
    margin-bottom: 10px;
}

.tfv-budget-quick .button {
    font-size: 10px;
}

/* ── Tabla de items ── */
.tfv-budget-items-table {
    font-size: 11px;
    margin: 8px 0;
}

.tfv-budget-items-table th {
    background: #1a5276;
    color: #fff;
    padding: 6px 8px;
    font-size: 10px;
    text-align: left;
}

.tfv-budget-items-table td {
    padding: 6px 8px;
    vertical-align: middle;
}

.tfv-budget-items-table .tfv-item-qty,
.tfv-budget-items-table .tfv-item-price {
    font-size: 11px;
}

.tfv-item-type {
    font-size: 14px;
}

.tfv-item-total {
    font-weight: 600;
    color: #27ae60;
}

.tfv-item-remove {
    color: #e74c3c;
    font-size: 12px !important;
    padding: 0 6px !important;
    line-height: 22px !important;
}

.tfv-budget-empty {
    text-align: center;
    color: #999;
    font-size: 11px;
    padding: 20px;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

/* ── Totales ── */
.tfv-budget-totals {
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
}

.tfv-total-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
    color: #555;
}

.tfv-total-grand {
    border-top: 2px solid #1a5276;
    margin-top: 6px;
    padding-top: 6px;
    font-size: 14px;
    color: #1a5276;
}

/* ── Botones de acción ── */
.tfv-budget-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.tfv-budget-actions .button {
    font-size: 11px;
}
