/* ═══════════════════════════════════════════
   AF App Presupuestos — Form
   Form fields, lines table, totals, filters, checkbox.
   Depende de: af-app-plugins, variables.css, _layout.css
   ═══════════════════════════════════════════ */

/* ── Form fields ── */
.af-presupuestos-field-group {
	margin-bottom: clamp(12px, 1.5vw + 4px, 18px);
}

.af-presupuestos-field-group label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--af-gray-700, #4a5568);
	margin-bottom: 6px;
}

.af-presupuestos-field-group input,
.af-presupuestos-field-group select,
.af-presupuestos-field-group textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 0;
	font-size: 16px;
	background: #f9fbff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	min-height: 44px;
}

.af-presupuestos-field-group input:focus,
.af-presupuestos-field-group select:focus,
.af-presupuestos-field-group textarea:focus {
	border-color: var(--af-primary, #09aeb8);
	box-shadow: 0 0 0 3px rgba(9, 174, 184, 0.18);
	background: #ffffff;
	outline: none;
}

.af-presupuestos-field-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(12px, 1.5vw + 4px, 20px);
}

.af-presupuestos-field-row--3 {
	grid-template-columns: 1fr;
}

/* ── Lines table ── */
.af-presupuestos-lines-table-wrap {
	overflow-x: auto;
	margin-bottom: clamp(12px, 1.5vw, 18px);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0;
	background: #ffffff;
	padding: 12px;
}

.af-presupuestos-lines-table {
	width: 100%;
	border-collapse: collapse;
}

.af-presupuestos-lines-table th {
	padding: 8px 10px;
	text-align: left;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--af-gray-500, #718096);
	border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.af-presupuestos-lines-table td {
	padding: 6px 4px;
	vertical-align: middle;
}

.af-presupuestos-lines-table input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 0;
	font-size: 16px;
	background: #f9fbff;
	min-height: 40px;
}

.af-presupuestos-lines-table input:focus {
	border-color: var(--af-primary, #09aeb8);
	box-shadow: 0 0 0 3px rgba(9, 174, 184, 0.18);
	background: #fff;
	outline: none;
}

.af-col-desc { width: 35%; }
.af-col-qty { width: 8%; }
.af-col-price { width: 12%; }
.af-col-discount { width: 8%; }
.af-col-tax { width: 8%; }
.af-col-total { width: 12%; }
.af-col-actions { width: 5%; }
.af-col-num { text-align: right; }

.af-input-num {
	text-align: right;
}

.af-line-total {
	font-weight: 600;
	text-align: right;
	white-space: nowrap;
	font-size: 14px;
}

.af-presupuestos-remove-line {
	background: transparent;
	border: 1px solid rgba(15, 23, 42, 0.12);
	color: var(--af-danger, #e53e3e);
	font-size: 1rem;
	cursor: pointer;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0;
	transition: all 0.15s ease;
}

.af-presupuestos-remove-line:hover {
	background: #fff5f5;
	border-color: var(--af-danger, #e53e3e);
}

.af-presupuestos-add-line {
	margin-top: 8px;
}

/* ── Totals (paso 3 y detalle) ── */
.af-presupuestos-totals {
	max-width: 100%;
	margin-left: auto;
	margin-top: clamp(14px, 1.5vw + 4px, 22px);
	margin-bottom: clamp(16px, 2vw, 24px);
	padding: 14px 16px;
	background: rgba(248, 250, 252, 0.9);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0;
}

.af-presupuestos-totals__row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 15px;
}

.af-presupuestos-totals__row--grand {
	font-size: 1.125rem;
	font-weight: 700;
	border-top: 2px solid var(--af-gray-800, #2d3748);
	padding-top: 8px;
	margin-top: 4px;
}

/* ── Filters (historial) ── */
.af-presupuestos-filters {
	margin-bottom: clamp(12px, 1.5vw, 18px);
}

.af-presupuestos-filter {
	padding: 10px 14px;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 0;
	font-size: 16px;
	background: #f9fbff;
	min-height: 44px;
}

/* ─── Checkbox opcional: guardar contacto / servicios ────────── */
.af-presupuestos-field-group--checkbox label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
	font-size: 14px;
	cursor: pointer;
	margin-bottom: 0;
	color: var(--af-gray-700, #334155);
}
.af-presupuestos-field-group--checkbox input[type="checkbox"] {
	width: auto;
	min-width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: var(--af-primary, #09aeb8);
}
.af-presupuestos-help {
	margin: 6px 0 0 28px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--af-gray-500, #64748b);
}
