:root {
  --app-navy: #0b3d5c;
  --app-blue: #1261a0;
  --app-orange: #f28c28;
  --app-bg: #f4f7fa;
  --font-smaller: .72rem;
  --font-small: .8rem;
  --font-regular: 1rem;
  --font-large: 1rem;
  --font-larger: 1.15rem;
}

body {
  min-height: 100vh;
  color: #263746;
  background: var(--app-bg) !important;
}

.app-navbar {
  background: linear-gradient(120deg, var(--app-navy), #12618a);
}

.app-container {
  max-width: 1440px;
}

.brand-mark {
  display: inline-flex;
  width: 1.8rem;
  height: 1.8rem;
  align-items: center;
  justify-content: center;
  border-radius: .55rem;
  background: var(--app-orange);
  color: #fff;
  font-weight: 800;
}

.brand-mark-lg {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  font-size: 1.5rem;
}

.eyebrow {
  color: var(--app-blue);
  font-size: var(--font-smaller);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.min-vh-75 {
  min-height: 75vh;
}

/* Centra la tarjeta de acceso respecto a toda el área pública. */
.login-page {
	display: flex;
	min-height: calc(100vh - 4.5rem);
	align-items: center;
	justify-content: center;
}

.login-panel {
	width: min(100%, 26rem);
}

.card {
  border-radius: .9rem;
}

.table > :not(caption) > * > * {
  padding: 1rem;
}

.table thead th {
  color: #607181;
  font-size: var(--font-smaller);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.btn-primary {
  --bs-btn-bg: var(--app-blue);
  --bs-btn-border-color: var(--app-blue);
  --bs-btn-hover-bg: var(--app-navy);
  --bs-btn-hover-border-color: var(--app-navy);
}

.form-control, .form-select {
  border-radius: .55rem;
}

.form-label {
  color: #455a6b;
  font-size: var(--font-regular);
  font-weight: 600;
}

.quote-builder-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
}

.quote-builder-actions {
	display: flex;
	align-items: center;
	gap: .75rem;
}

.section-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	padding: .35rem .75rem;
	background: #e9eef3;
	color: #526575;
	font-size: var(--font-small);
	font-weight: 700;
}

.quote-progress {
	display: flex;
	gap: .5rem;
	overflow-x: auto;
	padding-bottom: .25rem;
}

.quote-progress-step {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .65rem .9rem;
	border: 1px solid #dbe4eb;
	border-radius: 999px;
	color: #607181;
	font-size: var(--font-small);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.quote-progress-step:hover,
.quote-progress-step.is-active { border-color: var(--app-blue); color: var(--app-blue); background: #eef6fc; }
.quote-progress-step span,
.section-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.65rem;
	height: 1.65rem;
	border-radius: 50%;
	background: #e6edf3;
	color: var(--app-blue);
	font-size: var(--font-smaller);
	font-weight: 800;
}

.builder-card,
.quote-summary-card {
	border: 1px solid #e1e9ef;
	border-radius: 1rem;
	background: #fff;
	box-shadow: 0 .35rem 1.4rem rgba(38, 55, 70, .06);
}

.builder-card { padding: 1.5rem; }
.builder-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.builder-card-heading > div:first-child { display: flex; gap: .8rem; }
.builder-card-heading .section-number { flex: 0 0 auto; margin-top: .1rem; }
.section-check { color: #259653; font-size: var(--font-larger); font-weight: 800; }
.section-count { padding: .25rem .6rem; }
.builder-form .form-control, .builder-form .form-select, .add-service-form .form-control, .add-service-form .form-select { background-color: #fbfcfd; }
.client-search-box, .add-service-form { padding: 1rem; border: 1px solid #e1e9ef; border-radius: .8rem; background: #f8fafc; }
.client-combobox { position: relative; }
.client-combobox.is-accepted .client-search-group { display: none; }
.client-clear-button { background: #fff; color: #607181; font-size: var(--font-larger); line-height: 1; }
.client-select-source { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.client-search-group { position: relative; }
.client-results { position: absolute; z-index: 20; top: 5.4rem; right: 1rem; left: 1rem; overflow-y: auto; max-height: 16rem; border: 1px solid #cbd8e2; border-radius: .65rem; background: #fff; box-shadow: 0 .5rem 1.2rem rgba(38, 55, 70, .14); }
.client-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .9rem; border: 0; border-bottom: 1px solid #edf1f4; background: #fff; color: #263746; text-align: left; }
.client-option:last-child { border-bottom: 0; }
.client-option:hover, .client-option:focus { background: #eef6fc; color: var(--app-blue); outline: 0; }
.client-option-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.client-option-id { flex: 0 0 auto; color: #607181; font-size: var(--font-small); }
.client-empty { padding: 1rem; color: #607181; font-size: var(--font-small); }
.client-created-result { padding-top: .75rem; }
.input-group-text { background: #fff; color: var(--app-blue); }
.advanced-fields { border-top: 1px solid #e6edf2; }
.advanced-fields summary, .service-edit summary, .add-commercial summary { cursor: pointer; color: var(--app-blue); font-size: var(--font-small); font-weight: 700; }
.advanced-fields summary { padding-top: .9rem; }
.service-row { padding: 1rem 0; border-bottom: 1px solid #edf1f4; }
.service-row:last-child { border-bottom: 0; }
.service-row-main { display: flex; align-items: center; gap: .75rem; }
.service-index { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .55rem; background: #eef6fc; color: var(--app-blue); font-size: var(--font-small); font-weight: 800; }
.service-total { white-space: nowrap; font-size: var(--font-regular); }
.service-edit { margin-left: 2.75rem; padding-top: .55rem; }
.empty-services { padding: 2rem 1rem; text-align: center; border: 1px dashed #cbd8e2; border-radius: .8rem; color: #526575; }
.empty-services-icon { display: block; margin-bottom: .4rem; color: var(--app-blue); font-size: 2rem; line-height: 1; }
.commercial-sections { display: grid; gap: .65rem; }
.commercial-section { border: 1px solid #e1e9ef; border-radius: .75rem; }
.commercial-section > summary { display: flex; align-items: center; justify-content: space-between; padding: 1rem; cursor: pointer; color: #263746; font-weight: 700; list-style: none; }
.commercial-section > summary::-webkit-details-marker, .add-commercial > summary::-webkit-details-marker { display: none; }
.commercial-section > summary::after { content: '+'; color: var(--app-blue); font-size: 1.2rem; }
.commercial-section[open] > summary::after { content: '−'; }
.commercial-section-body { padding: 0 1rem 1rem; }
.commercial-item { padding: .8rem 0; border-bottom: 1px solid #edf1f4; }
.commercial-item p { margin: .25rem 0 .5rem; color: #526575; font-size: var(--font-regular); }
.add-commercial { padding-top: .8rem; }
.quote-summary-card { position: sticky; top: 1.25rem; padding: 1.5rem; }
.summary-kicker { margin-bottom: .55rem; color: var(--app-blue); font-size: var(--font-smaller); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quote-totals-summary dl { font-size: var(--font-regular); }
.quote-totals-summary dt, .quote-totals-summary dd { padding: .4rem 0; }
.quote-totals-summary dt.border-top, .quote-totals-summary dd.border-top { margin-top: .5rem; padding-top: 1rem; font-size: var(--font-larger); }
.quote-totals-panel { padding: .8rem .95rem; }
.quote-totals-panel .quote-totals-summary dt,
.quote-totals-panel .quote-totals-summary dd { padding: .22rem 0; }
.quote-totals-panel .quote-totals-summary dt.border-top,
.quote-totals-panel .quote-totals-summary dd.border-top { margin-top: .35rem; padding-top: .6rem; }
.quote-totals-panel .quote-totals-summary dd { font-size: var(--font-regular); }
.quote-totals-panel .quote-totals-summary dt.border-top,
.quote-totals-panel .quote-totals-summary dd.border-top { font-size: var(--font-regular); }
.summary-next-step { display: flex; gap: .75rem; padding-top: 1rem; border-top: 1px solid #e6edf2; }
.summary-next-step .section-number { flex: 0 0 auto; }

@media (max-width: 767.98px) {
	.quote-builder-header { align-items: flex-start; flex-direction: column; }
	.quote-builder-actions { width: 100%; justify-content: space-between; }
	.builder-card { padding: 1rem; }
	.quote-summary-card { position: static; }
}

/* Shell y panel de trabajo de cotizaciones. */
.app-body { min-height: 100vh; background: #f5f7fb; }
.app-sidebar { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; display: flex; width: 220px; flex-direction: column; overflow: hidden; padding: 1.25rem .8rem; background: #fff; border-right: 1px solid #e3e8ef; }
.app-brand { display: flex; align-items: center; gap: .65rem; padding: .1rem .55rem 1.4rem; color: #163b60; text-decoration: none; }
.app-brand strong { display: block; font-size: var(--font-large); letter-spacing: .04em; }
.app-brand small { display: block; color: #3881bc; font-size: .55rem; letter-spacing: .08em; }
.sidebar-new-quote { display: block; margin: .2rem 0 1.25rem; padding: .7rem .8rem; border-radius: .45rem; background: var(--app-blue); color: #fff; font-size: var(--font-small); font-weight: 700; text-align: center; text-decoration: none; box-shadow: 0 .2rem .5rem rgba(18, 97, 160, .2); }
.sidebar-new-quote:hover { background: var(--app-navy); color: #fff; }
.sidebar-nav-scroll { min-height: 0; overflow-y: auto; scrollbar-color: #cbd8e2 transparent; scrollbar-width: thin; }
.sidebar-nav { display: flex; flex-direction: column; gap: .18rem; }
.sidebar-nav a { display: flex; align-items: center; gap: .65rem; padding: .52rem .65rem; border-radius: .4rem; color: #53677b; font-size: var(--font-small); text-decoration: none; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #edf5fc; color: var(--app-blue); font-weight: 700; }
.sidebar-group-title { padding: .4rem .65rem .25rem; color: #9aa9b7; font-size: var(--font-smaller); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding: 1rem .65rem 0; border-top: 1px solid #edf1f4; }
.sidebar-user { display: block; color: #263746; font-size: var(--font-small); font-weight: 700; }
.sidebar-user small { display: block; color: #8a9aa8; font-size: var(--font-smaller); font-weight: 400; }
.sidebar-logout { margin-top: .8rem; padding: 0; border: 0; background: transparent; color: #687a89; font-size: var(--font-small); }
.app-main { min-width: 0; margin-left: 220px; }
.app-main-public { width: 100%; margin-left: 0; }
.app-topbar { position: sticky; top: 0; z-index: 60; display: flex; min-height: 4.1rem; align-items: center; gap: 1rem; padding: .55rem 2rem; border-bottom: 1px solid rgba(255, 255, 255, .12); background: #191970; color: #f4f7fa; }
.mobile-menu-button { display: none; }
.topbar-heading { display: flex; min-width: 10rem; flex-direction: column; justify-content: center; line-height: 1.1; }
.topbar-context { overflow: hidden; color: rgba(255, 255, 255, .62); font-size: var(--font-smaller); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title { overflow: hidden; margin: .18rem 0 0; color: #fff; font-size: var(--font-regular); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.topbar-center { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; justify-content: center; gap: .55rem; }
.topbar-user { margin-left: auto; color: rgba(255, 255, 255, .85); font-size: var(--font-small); }
.mobile-menu-button { color: rgba(255, 255, 255, .85); }
.topbar-primary-action, .topbar-back-action { flex: 0 0 auto; white-space: nowrap; }
.topbar-back-action { border-color: rgba(255, 255, 255, .55); color: #fff; }
.topbar-back-action:hover, .topbar-back-action:focus-visible { border-color: #fff; background: rgba(255, 255, 255, .12); color: #fff; }
.app-content { max-width: 1480px; margin: 0 auto; padding: 1.5rem 2rem 3rem; }
.app-toast-stack {
	position: fixed;
	z-index: 1090;
	top: 4.75rem;
	right: 1rem;
	display: flex;
	width: min(25rem, calc(100vw - 2rem));
	flex-direction: column;
	gap: .65rem;
	pointer-events: none;
}
.app-toast {
	width: 100%;
	box-shadow: 0 .85rem 1.8rem rgba(22, 59, 96, .22);
	pointer-events: auto;
}
.app-toast .toast-header {
	font-size: var(--font-small);
	font-weight: 700;
}
.app-toast .toast-body {
	font-size: var(--font-small);
}
.editor-topbar-actions { display: flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; margin: 0 auto; gap: 1rem; flex-wrap: nowrap; }
.editor-topbar-meta { display: flex; align-items: center; gap: .8rem; min-width: 0; color: #738292; font-size: var(--font-smaller); }
.editor-topbar-buttons { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: .55rem; }
.editor-topbar-buttons > * { flex: 0 0 auto; min-width: 0; }
.editor-topbar-buttons .btn { width: auto; justify-content: center; padding: .48rem .9rem; border-radius: .6rem; font-weight: 700; white-space: nowrap; box-shadow: 0 .08rem .25rem rgba(0, 0, 0, .12); }
.editor-topbar-buttons .btn-outline-primary,
.editor-topbar-buttons .btn-outline-secondary,
.editor-topbar-buttons .btn-outline-danger {
	border-color: rgba(206, 220, 232, .96);
	background: rgba(255, 255, 255, .95);
	color: #18446b;
}
.editor-topbar-buttons .btn-outline-primary:hover,
.editor-topbar-buttons .btn-outline-primary:focus-visible,
.editor-topbar-buttons .btn-outline-secondary:hover,
.editor-topbar-buttons .btn-outline-secondary:focus-visible,
.editor-topbar-buttons .btn-outline-danger:hover,
.editor-topbar-buttons .btn-outline-danger:focus-visible {
	border-color: rgba(173, 194, 214, .98);
	background: #eef5fb;
	color: #12395b;
}
.editor-topbar-buttons .btn-success {
	border-color: #2b9b5d;
	background: #2b9b5d;
	color: #fff;
}
.editor-topbar-buttons .btn-success:hover,
.editor-topbar-buttons .btn-success:focus-visible {
	border-color: #238151;
	background: #238151;
	color: #fff;
}
.editor-topbar-buttons .btn-outline-danger {
	border-color: rgba(233, 190, 195, .98);
	color: #9d2f39;
}
.editor-topbar-buttons .btn-outline-danger:hover,
.editor-topbar-buttons .btn-outline-danger:focus-visible {
	border-color: rgba(214, 154, 161, .98);
	background: #fff5f6;
	color: #89212b;
}
.editor-topbar-buttons form { margin: 0; }
.last-saved { white-space: nowrap; }
.saved-dot { color: #35a566; font-size: var(--font-smaller); }
.quote-main-form { margin: 0; }
.quote-top-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.quote-subpanels { display: grid; gap: 1.35rem; }
.quote-details-panel > .quote-subpanels {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid #e5ebf0;
}
.quote-details-panel > .quote-subpanels .quote-subpanel {
	font-size: var(--font-regular);
}
.quote-details-panel > .quote-subpanels .selected-client-card {
	font-size: var(--font-regular);
}
.quote-details-panel > .quote-subpanels .selected-client-card strong {
	font-size: var(--font-regular);
}
.quote-subpanel { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.quote-subpanel + .quote-subpanel { padding-top: 1.35rem; border-top: 1px solid #e5ebf0; }
.create-client-button { flex: 0 0 auto; }
.quote-details-body { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e5ebf0; }
.quote-metadata-grid { display: grid; grid-template-columns: 20% 20% 30% 20%; column-gap: .5rem; justify-content: space-between; }
.quote-metadata-widget { display: flex; min-width: 0; flex-direction: column; align-items: stretch; gap: .3rem; padding: .45rem .6rem; border: 1px solid #dce8f2; border-radius: .55rem; background: #f7fbfe; }
.quote-metadata-label { display: block; margin: 0; color: #607181; font-size: var(--font-smaller); font-weight: 700; white-space: nowrap; }
.quote-metadata-value.quote-number-draft { color: #c0392b; }
.quote-metadata-value { min-width: 0; margin: 0; overflow: hidden; color: #244d73; font-size: var(--font-regular); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.quote-metadata-number { justify-content: flex-start; text-align: right; }
.quote-metadata-city .form-control { min-width: 0; }
.quote-metadata-widget .form-control,
.quote-metadata-widget .form-select { width: 100%; }
.quote-currency-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; align-items: end; }
.quote-currency-rate[hidden] { display: none; }
.quote-currency-rate .invalid-feedback { display: block; }
.embedded-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.embedded-heading h2 { margin: 0; color: #163b60; font-size: var(--font-small); font-weight: 800; }
.panel-card { margin-bottom: 0rem; padding: 1rem 1.2rem; border: 4px solid #e2e8ef; border-radius: .65rem; background: #fff; box-shadow: 0 .15rem .5rem rgba(38, 55, 70, .7); }
.panel-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.panel-card-heading h2 { margin: 0; color: #163b60; font-size: var(--font-regular); font-weight: 800; }
.panel-icon { color: #6b86a0; font-size: 1rem; }
.panel-subtitle, .panel-hint { margin: .25rem 0 0; color: #8593a0; font-size: var(--font-smaller); }
.client-panel { padding: 0; border: 0; background: transparent; }
.selected-client-card { display: flex; flex-direction: column; gap: .15rem; margin-top: .65rem; padding: .65rem .8rem; border: 1px solid #dce8f2; border-radius: .45rem; background: #f7fbfe; color: #657789; font-size: var(--font-small); }
.selected-client-card strong { color: #244d73; font-size: var(--font-small); }
.selected-client-card .d-flex .btn { width: auto; white-space: nowrap; }
.validity-hint { margin: .5rem 0 0; color: #768697; font-size: var(--font-smaller); text-align: right; }
.operation-panel { padding-bottom: .75rem; }
.services-panel { margin-top: 1.25rem; padding-bottom: .8rem; }
.services-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: .65rem; border: 1px solid #e3eaf0; border-radius: .45rem; background: #f8fafc; }
.service-add-form { display: flex; min-width: 0; flex: 1; align-items: flex-end; gap: .75rem; }
.service-add-form fieldset { min-width: 0; flex: 1; }
.service-picker { position: relative; }
.service-combobox,
.condition-combobox { position: relative; }
.service-select-source { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.service-results,
.condition-results { position: absolute; z-index: 20; top: 100%; right: 0; left: 0; max-height: 15rem; overflow-y: auto; border: 1px solid #cbd8e2; border-radius: .45rem; background: #fff; box-shadow: 0 .5rem 1.2rem rgba(38, 55, 70, .14); }
.service-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .75rem; border: 0; border-bottom: 1px solid #edf1f4; background: #fff; color: #263746; text-align: left; }
.service-option:last-child { border-bottom: 0; }
.service-option:hover, .service-option:focus { background: #eef6fc; color: var(--app-blue); outline: 0; }
.service-option small { flex: 0 0 auto; color: #718292; font-size: var(--font-smaller); }
.service-empty { padding: .8rem; color: #718292; font-size: var(--font-small); }
.service-draft-fields { display: grid; grid-template-columns: 1fr 1.5fr .8fr .8fr 1fr .8fr .8fr; gap: .55rem; margin-top: .65rem; }
.service-draft-fields label, .service-card-fields label { display: block; margin-bottom: .2rem; color: #607181; font-size: var(--font-smaller); font-weight: 700; }
.service-draft-fields .form-control, .service-card-fields .form-control { padding: .4rem .5rem; font-size: var(--font-small); }
.service-draft-description { grid-column: 1 / 5; }
.service-toolbar-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: .55rem; }
.service-list-wrap { margin-top: .8rem; }

/* Panel Incluidos y No includos */
.condition-add-form { display: flex; align-items: flex-end; gap: .75rem; padding: .65rem; border: 1px solid #e3eaf0; border-radius: .45rem; background: #f8fafc; }
.condition-picker { position: relative; min-width: 0; flex: 1;  }

.condition-picker .form-label { margin-bottom: .25rem; font-size: var(--font-smaller);  }
.condition-add-actions { display: flex; flex: 0 0 auto; align-items: flex-end; gap: .55rem; }
.condition-free-form { right: 0; width: min(520px, calc(100vw - 3rem)); }
.condition-list-wrap { overflow-x: auto; margin-top: .8rem; }
.condition-table { min-width: 620px; }
.condition-table th:nth-child(1) { width: 2.5rem; }
.condition-table th:nth-child(2) { width: 20%; }
.condition-table th:nth-child(4) { width: 9rem; }
.condition-table textarea.table-input { resize: vertical; }
.condition-subpanel-compact .condition-table { min-width: 0; table-layout: fixed; }
.condition-subpanel-compact .condition-table th:nth-child(2),
.condition-subpanel-compact .condition-table td:nth-child(2) { width: 80%; }
.condition-subpanel-compact .condition-table th:nth-child(3),
.condition-subpanel-compact .condition-table td:nth-child(3) { width: 25%; }
.condition-subpanel-compact .condition-time-table th:nth-child(2),
.condition-subpanel-compact .condition-time-table td:nth-child(2) { width: 20%; }
.condition-subpanel-compact .condition-time-table th:nth-child(3),
.condition-subpanel-compact .condition-time-table td:nth-child(3) { width: 80%; }
.condition-time-table { table-layout: fixed; }
.condition-time-table .table-input { width: 100%; }
.service-list { display: grid; gap: .65rem; }
.quote-service-card { padding: .8rem; border: 1px solid #e1e9ef; border-radius: .55rem; background: #fff; }
.service-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .65rem; }
.service-card-title { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.service-card-title > div { min-width: 0; }
.service-card-title strong { display: block; overflow: hidden; color: #244d73; text-overflow: ellipsis; white-space: nowrap; }
.service-card-title small { display: block; margin-top: .1rem; color: #81909d; font-size: var(--font-smaller); }
.service-card-actions { display: flex; flex: 0 0 auto; gap: .15rem; }
.service-card-actions form { margin: 0; }
.service-action { display: inline-flex; width: 1.65rem; height: 1.65rem; align-items: center; justify-content: center; padding: 0; border: 1px solid #dbe5ec; border-radius: .3rem; background: #fff; color: #557087; font-size: var(--font-regular); line-height: 1; }
.service-action:hover, .service-action:focus { border-color: var(--app-blue); background: #eef6fc; color: var(--app-blue); }
.service-action-delete { color: #c94b55; }
.service-card-fields { display: grid; grid-template-columns: 1fr 1.5fr .8fr .8fr 1fr .8fr .8fr auto; align-items: end; gap: .55rem; }
.service-card-name { min-width: 0; }
.service-card-description { grid-column: 1 / 5; }
.service-card-total { display: flex; min-width: 7.5rem; flex-direction: column; align-items: flex-end; gap: .15rem; color: #718292; font-size: var(--font-regular); }
.service-card-total strong { color: #244d73; font-size: var(--font-regular); }
.service-action-edit { margin-top: .15rem; color: #278653; }
.service-catalog-search { position: relative; min-width: 0; }
.service-catalog-search input { padding-right: 2rem; }
.service-catalog-search span { position: absolute; top: .45rem; right: .65rem; color: #7b8b9a; }
.service-catalog-select { min-width: 0; }
.service-catalog-select .mb-3 { margin-bottom: 0 !important; }
.service-catalog-select select { width: 100%; }
.service-quantity { width: 92px; }
.service-unit { width: 115px; }
.service-add-bar .form-label { margin-bottom: .25rem; font-size: var(--font-smaller); }
.service-add-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: .55rem; }
.free-item-details { flex: 0 0 auto; }
.free-item-details > summary { list-style: none; }
.free-item-details > summary::-webkit-details-marker { display: none; }
.free-item-form { position: absolute; z-index: 10; right: 2rem; width: min(720px, calc(100% - 4rem)); margin-top: .5rem; padding: 1rem; border: 1px solid #dbe5ed; border-radius: .5rem; background: #fff; box-shadow: 0 .5rem 1.2rem rgba(38, 55, 70, .14); }
.free-item-actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .8rem; }
.service-table-wrap { overflow-x: auto; margin-top: .8rem; }
.quote-items-table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; font-size: var(--font-smaller); }
.service-items-table { table-layout: fixed; }
.quote-items-table.service-items-table th,
.quote-items-table.service-items-table td { padding-right: .25rem; padding-left: .25rem; }
.quote-items-table th { padding: .55rem .4rem; border-bottom: 1px solid #dce5ec; color: #5c7083; font-size: var(--font-smaller); font-weight: 800; white-space: nowrap; }
.quote-items-table td { padding: .45rem .3rem; border-bottom: 1px solid #edf1f4; vertical-align: middle; }
.quote-items-table tr:last-child td { border-bottom: 0; }
.item-number { width: 28px; color: #7890a3; text-align: center; }
.item-name { font-size: var(--font-regular); }

/* Conditions tables */
.table-input { width: 100%; min-width: 55px; padding: .4rem .45rem; border: 1px solid #dce5ec; border-radius: .3rem; color: #314a61; font-size: var(--font-regular); }
.table-input:focus { border-color: var(--app-blue); outline: 0; box-shadow: 0 0 0 .15rem rgba(18, 97, 160, .12); }
.code-input { min-width: 75px; }
.service-items-table .table-input { min-width: 0; }
.service-items-table .description-input { min-width: 0; }
.service-items-table .number-input { min-width: 0; text-align: right; }
.item-description { display: block; max-width: 180px; margin: .2rem .25rem 0; overflow: hidden; color: #8a99a7; text-overflow: ellipsis; white-space: nowrap; }
.item-total { color: #223f5d; font-size: var(--font-regular); font-weight: 800; white-space: nowrap; }
.item-converted { font-size: var(--font-regular); }
.item-actions { text-align: right; white-space: nowrap; }
.item-actions-group { display: flex; justify-content: flex-end; gap: .15rem; }
.item-actions-group form { display: block !important; }
.table-action { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; padding: 0; border: 1px solid #dbe5ec; border-radius: .35rem; background: #fff; box-shadow: 0 1px 2px rgba(38, 55, 70, .05); font-weight: 800; }
.table-action svg { width: 1.05rem; height: 1.05rem; fill: currentColor; pointer-events: none; }
.table-action.save { color: #238e57; }
.table-action.edit, .table-action.move { color: #416b8b; }
.table-action.delete { color: #df4d53; font-size: 1.1rem; }
.table-action:hover, .table-action:focus-visible { border-color: var(--app-blue); background: #eef6fc; color: var(--app-blue); outline: 0; }
.service-catalog-dialog { width: min(760px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; overflow: auto; border: 0; border-radius: .75rem; box-shadow: 0 1rem 3rem rgba(22, 59, 96, .25); }
.service-catalog-dialog::backdrop { background: rgba(21, 39, 55, .45); }
.service-catalog-dialog form { padding: 1rem 1.25rem 1.25rem; }
.object-catalog-dialog .object-dialog-body {
	padding: 1.25rem 1.5rem 1.5rem;
}
.object-catalog-dialog .object-dialog-body form {
	padding: 0;
}
.object-catalog-dialog .object-dialog-body form > .mb-3 {
	margin-inline: 0;
	margin-bottom: 1rem !important;
}
.object-catalog-dialog .object-dialog-body form .form-control {
	width: 100%;
}
.service-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid #e4eaf0; }
.service-dialog-heading h2 { margin: 0; color: #163b60; font-size: 1.05rem; }
.service-dialog-heading p { margin: .2rem 0 0; color: #7a8b99; font-size: .78rem; }
.service-dialog-close { width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: .35rem; background: transparent; color: #687a89; font-size: 1.4rem; line-height: 1; }
.service-dialog-close:hover { background: #edf5fc; color: var(--app-blue); }
.service-dialog-actions { display: flex; justify-content: flex-end; gap: .55rem; padding-top: .9rem; border-top: 1px solid #e4eaf0; }
.object-catalog-dialog .object-dialog-body .service-dialog-actions {
	margin-top: 1.25rem;
	padding-bottom: .1rem;
}
.client-catalog-dialog { width: min(920px, calc(100% - 2rem)); }

/* Introducción y Despedida */
.commercial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.commercial-grid .commercial-section { margin-bottom: 1rem; border: 1px solid #e2e8ef; border-radius: .65rem; background: #fff; }
.commercial-grid .commercial-section > summary { padding: .8rem .95rem; font-size: var(--font-small); }
.commercial-grid .commercial-section-body { padding: 0 .95rem .8rem; }
.commercial-grid .commercial-item { padding: .55rem 0; font-size: var(--font-smaller); }
.commercial-grid .commercial-item p { font-size: var(--font-smaller); }
.quote-footer-cancel { padding: 1rem 0 0; }
.document-section-heading { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .9rem; }
.document-section-heading h2 { margin: 0; color: #163b60; font-size: var(--font-large); font-weight: 800; }
.document-section-heading p { margin: .2rem 0 0; color: #8493a1; font-size: var(--font-smaller); }
.document-section-number { display: inline-flex; width: 1.65rem; height: 1.65rem; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 50%; background: #eaf2f8; color: var(--app-blue); font-size: var(--font-smaller); font-weight: 800; }
.quote-details-panel .content-field {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: .25rem;
	margin-bottom: .85rem;
}
.quote-details-panel .content-field .errorlist { margin: 0; }
.quote-details-panel .content-field label { display: block; margin-bottom: .25rem; color: #607181; font-size: var(--font-smaller); font-weight: 700; }
.quote-details-panel textarea[name="texto_introductorio"],
.quote-details-panel textarea[name="texto_cierre"],
.quote-considerations-panel textarea[name="facturacion"],
.quote-considerations-panel textarea[name="seguros"],
.quote-considerations-panel textarea[name="stand_by"],
.quote-considerations-panel textarea[name="vigencia"],
.quote-considerations-panel textarea[name="condiciones_aceptacion"] {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid #ced8e1;
	border-radius: .55rem;
	background: #fff;
	color: #263746;
	font-size: var(--font-regular);
	line-height: 1.5;
	padding: .55rem .75rem;
}
.quote-details-panel textarea[name="texto_introductorio"],
.quote-details-panel textarea[name="texto_cierre"],
.quote-details-panel textarea[name="notas_visibles"] { height: 4.75rem; min-height: 4.75rem; max-height: 4.75rem; resize: none; }
.quote-considerations-panel textarea[name="facturacion"],
.quote-considerations-panel textarea[name="seguros"],
.quote-considerations-panel textarea[name="stand_by"],
.quote-considerations-panel textarea[name="vigencia"] { height: 3.5rem; min-height: 1.5rem; resize: vertical; }
.quote-considerations-panel textarea[name="condiciones_aceptacion"] { height: 3.5rem; min-height: 1.5rem; resize: vertical; }
.commercial-flow { margin: 1.5rem 0 1rem; }
.commercial-heading { margin: .35rem 0 .7rem; }
.commercial-global-panel {
	border: 1px solid #e2e8ef;
	border-radius: .75rem;
	background: #fff;
	box-shadow: 0 .15rem .5rem rgba(38, 55, 70, .7);
}
.commercial-global-heading {
	margin: 0;
	padding: .9rem 1rem .7rem;
}
.commercial-global-panel > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .9rem 1rem;
	cursor: pointer;
	color: #163b60;
	font-size: var(--font-regular);
	font-weight: 800;
	list-style: none;
}
.commercial-global-panel > summary::-webkit-details-marker { display: none; }
.commercial-global-panel > summary::after { content: '+'; color: var(--app-blue); font-size: 1.2rem; }
.commercial-global-panel[open] > summary::after { content: '−'; }
.commercial-global-body { padding: 0 1rem 1rem; }
.commercial-dual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.commercial-subpanel {
	border: 1px solid #e2e8ef;
	border-radius: .65rem;
	background: #fff;
}
.commercial-subpanel-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	padding: .85rem 1rem .65rem;
}
.commercial-subpanel-heading h3 {
	margin: 0;
	color: #163b60;
	font-size: var(--font-small);
	font-weight: 800;
}
.commercial-subpanel-body { padding: 0 1rem 1rem; }
.commercial-payment-panel { margin-top: 1rem; }
.commercial-subpanel .condition-add-form { background: #f8fafc; }
.commercial-subpanel .condition-list-wrap { margin-top: .8rem; }

@media (max-width: 991.98px) {
	.app-sidebar { display: none; }
	.app-main { margin-left: 0; }
	.app-topbar { gap: .6rem; padding: .5rem 1rem; }
	.mobile-menu-button { display: inline-block; }
	.mobile-menu-button { border: 0; background: transparent; font-size: 1.2rem; }
	.topbar-center { justify-content: center; }
	.topbar-heading { min-width: 0; flex: 0 1 12rem; }
	.app-content { padding: 1rem; }
	.app-toast-stack { top: 4.25rem; right: .75rem; width: min(25rem, calc(100vw - 1.5rem)); }
	.commercial-grid, .quote-top-grid { grid-template-columns: 1fr; }
	.quote-metadata-grid { grid-template-columns: 1fr; }
	.editor-topbar-actions { width: 100%; justify-content: center; gap: .6rem; flex-wrap: wrap; }
	.editor-topbar-meta { justify-content: center; align-items: center; text-align: center; }
	.service-draft-fields, .service-card-fields { grid-template-columns: repeat(4, 1fr); }
	.service-draft-description, .service-card-description { grid-column: 1 / 4; }
	.commercial-dual-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
	.app-topbar { align-items: flex-start; flex-wrap: wrap; }
	.topbar-heading { flex: 1 1 calc(100% - 3rem); }
	.topbar-center { flex: 1 1 100%; justify-content: center; }
	.topbar-user { display: none; }
	.topbar-center .editor-topbar-actions { margin-left: 0; }
	.app-toast-stack { left: .5rem; right: .5rem; width: auto; }
	.services-toolbar { align-items: stretch; flex-direction: column; }
	.service-add-form { width: 100%; align-items: stretch; flex-direction: column; }
	.service-toolbar-actions { width: 100%; justify-content: flex-start; }
	.service-draft-fields, .service-card-fields { grid-template-columns: 1fr 1fr; }
	.service-draft-description, .service-card-description { grid-column: 1 / -1; }
	.service-quantity, .service-unit { width: 100%; }
	.free-item-form { right: 1rem; width: calc(100% - 2rem); }
	.editor-topbar-buttons { width: 100%; flex-wrap: wrap; }
	.editor-topbar-buttons > * { min-width: 100%; }
}
