:root {
  --ink: #1f3648;
  --muted: #627d91;
  --line: #d9e8f2;
  --canvas: #f4f9fc;
  --surface: #ffffff;
  --nav: #214b68;
  --nav-muted: #d6e7f2;
  --primary: #59b8e7;
  --primary-dark: #328fbe;
  --primary-soft: #e6f5fc;
  --success: #47795b;
  --success-soft: #e8f2e9;
  --warning: #a7651d;
  --warning-soft: #fff1dd;
  --danger: #aa4d4a;
  --danger-soft: #fbe9e7;
  --shadow: 0 12px 30px rgba(37, 84, 113, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 85% -10%, #dff3ff 0, transparent 29rem), var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.58; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 240px minmax(0, 1fr); }
body.initial-setup .app-shell { grid-template-columns: minmax(0, 1fr); }
body.initial-setup .page-content { max-width: none; padding: 0; }
.sidebar[hidden], .topbar[hidden] { display: none !important; }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 1rem; color: var(--ink); border-right: 1px solid var(--line); background: #fff; box-shadow: 4px 0 18px rgba(37, 84, 113, 0.05); }
.brand { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.5rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-logo { justify-content: center; padding: 0.1rem 0.25rem; }
.brand-logo-crop, .quote-logo-crop { display: block; overflow: hidden; background: #fff; }
.brand-logo-crop { width: 190px; height: 190px; border-radius: 0.75rem; background: #080321; }
.brand-logo-crop img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; transform: none; }
.brand-mark { display: grid; width: 1.9rem; height: 1.9rem; place-items: center; border-radius: 0.65rem; color: #25729c; background: #ffffff; box-shadow: 0 4px 10px rgba(13, 58, 87, 0.16); }
.main-nav { display: grid; gap: 0.25rem; }
.nav-group { display: grid; gap: 0.16rem; margin: 0.2rem 0; padding: 0.45rem 0.38rem 0.38rem; border: 1px solid #e4edf3; border-radius: 0.8rem; background: #fbfdff; }
.nav-group-label { padding: 0 0.42rem 0.32rem; color: var(--ink); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.045em; text-transform: uppercase; }
.nav-link, .text-button { border: 0; color: #27719e; background: transparent; text-align: left; }
.nav-link { padding: 0.75rem 0.8rem; border-radius: 0.7rem; transition: 160ms ease; }
.nav-sublink { padding: 0.58rem 0.62rem 0.58rem 1rem; font-size: 0.84rem; }
.nav-link:hover, .nav-link.active { color: #17668f; background: var(--primary-soft); transform: translateX(2px); }
.new-quote-button { width: 100%; }
.sidebar-footer { display: grid; gap: 0.8rem; margin-top: auto; padding: 0 0.5rem; }
.demo-chip, .status-chip { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.55rem; }
.demo-chip { color: #26688c; background: #e6f5fc; }
.text-button { padding: 0; font-size: 0.8rem; text-decoration: underline; }
.text-button:hover { color: var(--primary-dark); }

.main-content { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 4.5rem; padding: 0 2.25rem; border-bottom: 1px solid #cfeaf7; background: #e6f5fc; backdrop-filter: blur(10px); }
.breadcrumb { font-weight: 700; }
.user-picker { display: flex; align-items: center; gap: 0.65rem; color: var(--muted); font-size: 0.83rem; }
.user-picker select { max-width: 13rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 0.45rem; color: var(--ink); background: var(--surface); }
.topbar-session-actions { display: flex; align-items: center; gap: 0.8rem; margin-left: auto; }
.login-brand { display: block; width: min(100%, 280px); aspect-ratio: 1; overflow: hidden; margin: 0 auto 0.75rem; border-radius: 0.9rem; background: #080321; }
.login-brand img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; transform: none; }
.login-switch { justify-self: center; margin-top: 0.2rem; }
.page-content { max-width: 1360px; margin: 0 auto; padding: 2rem 2.25rem 3rem; }
.page-content.availability-page-wide { max-width: none; padding-right: 1rem; padding-left: 1rem; }
.setup-screen { display: grid; min-height: 100vh; place-items: center; padding: 1.5rem; }
.setup-card { display: grid; width: min(100%, 34rem); gap: 1rem; padding: 1.6rem; }
.login-card-simple { width: min(100%, 27rem); gap: 1.25rem; padding: 2rem; }
.setup-card h1 { margin-bottom: -0.55rem; }
.setup-kicker { color: var(--primary); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.setup-card .form-grid { margin-top: 0.35rem; }
.setup-card button { grid-column: 1 / -1; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.35rem; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.035em; }
h2 { margin-bottom: 0.4rem; font-size: 1.1rem; }
h3 { margin-bottom: 0.25rem; font-size: 0.98rem; }
.page-subtitle, .small-muted { color: var(--muted); }
.page-subtitle { margin-bottom: 0; }
.small-muted { margin-bottom: 0; font-size: 0.83rem; }

.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 0.7rem; padding: 0.65rem 0.9rem; font-weight: 750; transition: 160ms ease; }
.primary-button { color: #fff; background: linear-gradient(135deg, #76cbed, var(--primary)); box-shadow: 0 7px 16px rgba(49, 149, 195, 0.24); }
.primary-button:hover { background: linear-gradient(135deg, #59b8e7, var(--primary-dark)); box-shadow: 0 9px 19px rgba(41, 126, 169, 0.28); transform: translateY(-1px); }
.secondary-button { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.secondary-button:hover { border-color: #bdddec; background: #f1faff; }
.danger-button { color: var(--danger); border: 1px solid #f6caca; background: var(--danger-soft); }
.danger-button:hover { border-color: #ef9a9a; background: #fff0f0; transform: translateY(-1px); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.coordination-row .button-row { flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 0.45rem; }
.coordination-row .button-row button { min-height: 2.25rem; padding: 0.5rem 0.75rem; white-space: nowrap; }
.coordination-row .button-row .danger-button { display: inline-flex; align-items: center; justify-content: center; }
.dashboard-header-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 0.65rem; }
.dashboard-executive-picker { display: grid; gap: 0.28rem; color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.dashboard-executive-picker select { min-height: 2.35rem; min-width: 12.5rem; padding: 0.42rem 0.55rem; border: 1px solid var(--line); border-radius: 0.45rem; color: var(--ink); background: var(--surface); font: inherit; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card { border: 1px solid var(--line); border-radius: 1rem; background: rgba(255, 253, 249, 0.94); box-shadow: var(--shadow); }
.stat-card { padding: 1rem; }
.stat-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.stat-value { margin: 0.45rem 0 0.2rem; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.04em; }
.stat-context { color: var(--muted); font-size: 0.78rem; }
.revenue-stat-value { font-size: 1.2rem; letter-spacing: -0.025em; }
.revenue-month-picker { display: grid; gap: 0.28rem; margin: 0.65rem 0 0.45rem; color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.revenue-month-picker input { min-height: 2rem; padding: 0.32rem 0.45rem; border: 1px solid var(--line); border-radius: 0.4rem; color: var(--ink); background: var(--surface); font: inherit; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(19rem, 0.8fr); gap: 1rem; }
.card-section { padding: 1.2rem; }
.pipeline { display: grid; gap: 1rem; margin-top: 1rem; }
.pipeline-row { display: grid; grid-template-columns: 7.2rem minmax(4rem, 1fr) 1.8rem; gap: 0.7rem; align-items: center; font-size: 0.85rem; }
.pipeline-track { height: 0.6rem; overflow: hidden; border-radius: 999px; background: #e8f3f9; }
.pipeline-fill { height: 100%; border-radius: inherit; background: var(--primary); }
.pipeline-row:nth-child(2) .pipeline-fill { background: #4b7ba3; }
.pipeline-row:nth-child(3) .pipeline-fill { background: #b67828; }
.pipeline-row:nth-child(4) .pipeline-fill { background: var(--success); }
.pipeline-row:nth-child(5) .pipeline-fill { background: var(--danger); }
.revenue-service-list { display: grid; margin-top: 1rem; border-top: 1px solid var(--line); }
.revenue-service-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.72rem 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.revenue-service-row strong { white-space: nowrap; }
.timeline { display: grid; gap: 0.9rem; margin-top: 1rem; }
.timeline-item { display: grid; grid-template-columns: 0.65rem 1fr; gap: 0.65rem; }
.timeline-dot { width: 0.6rem; height: 0.6rem; margin-top: 0.33rem; border-radius: 50%; background: var(--primary); }
.timeline-item:nth-child(2) .timeline-dot { background: #b67828; }
.timeline-item:nth-child(3) .timeline-dot { background: var(--success); }

.filters { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1rem; }
.filters input, .filters select, .form-field input, .form-field select, .form-field textarea, .line-input { min-height: 2.45rem; padding: 0.52rem 0.65rem; border: 1px solid var(--line); border-radius: 0.6rem; color: var(--ink); background: var(--surface); transition: 160ms ease; }
.filters input:focus, .filters select:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus, .line-input:focus, .line-control input:focus, .line-control select:focus { outline: none; border-color: #79c8eb; box-shadow: 0 0 0 3px rgba(89, 184, 231, 0.16); }
.filters input { min-width: min(100%, 18rem); }
.table-wrap { overflow-x: auto; }
body:has([data-nav="events"].active) .table-wrap { overflow-x: visible; }
body:has([data-nav="events"].active) .table-wrap table { table-layout: fixed; }
body:has([data-nav="events"].active) .table-wrap th,
body:has([data-nav="events"].active) .table-wrap td { white-space: normal; overflow-wrap: anywhere; }
body:has([data-nav="events"].active) .table-wrap .small-button { white-space: normal; }
@media (min-width: 900px) {
  body:has([data-nav="quotes"].active) .table-wrap { overflow-x: clip; }
  body:has([data-nav="quotes"].active) .table-wrap table { table-layout: fixed; }
  body:has([data-nav="quotes"].active) .table-wrap th,
  body:has([data-nav="quotes"].active) .table-wrap td { white-space: normal; overflow-wrap: anywhere; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(1) { width: 10%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(2) { width: 8%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(3) { width: 24%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(4) { width: 13%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(5) { width: 12%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(6) { width: 9%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(7) { width: 9%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(8) { width: 8%; }
  body:has([data-nav="quotes"].active) .table-wrap th:nth-child(9) { width: 7%; }
  body:has([data-nav="quotes"].active) .table-wrap .small-button { padding-inline: 0.42rem; white-space: nowrap; }
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.8rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.02em; text-transform: uppercase; }
td { font-size: 0.88rem; }
.table-card { overflow: hidden; }
.table-card table th:first-child, .table-card table td:first-child { padding-left: 1.2rem; }
.table-card table th:last-child, .table-card table td:last-child { padding-right: 1.2rem; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.row-title { font-weight: 750; }
.row-subtitle { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.78rem; white-space: normal; }
.newhotel-reservation-code { display: block; color: #17668f; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.newhotel-reservation-code + .newhotel-reservation-code { margin-top: 0.2rem; }
.status-borrador { color: #535c66; background: #eef0f2; }
.status-enviada { color: #0c5c81; background: var(--primary-soft); }
.status-negociacion { color: var(--warning); background: var(--warning-soft); }
.status-aceptada { color: var(--success); background: var(--success-soft); }
.status-rechazada, .status-vencida { color: var(--danger); background: var(--danger-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }
.small-button { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 0.4rem; color: var(--ink); background: var(--surface); font-size: 0.78rem; font-weight: 700; }
.small-button:hover { background: var(--canvas); }

.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.client-card { min-width: 0; padding: 1.1rem; }
.client-card-header { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.client-card h2 { margin: 0; font-size: 1rem; }
.client-details { display: grid; gap: 0.38rem; margin: 1rem 0; color: var(--muted); font-size: 0.84rem; }
.client-contact-list { display: grid; gap: 0.5rem; margin: 0.75rem 0; }
.prospect-observation-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.client-contact-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0.5rem 0.75rem; align-items: center; padding: 0.6rem; border: 1px solid var(--line); border-radius: 0.7rem; background: #f8fbfd; font-size: 0.76rem; }
.client-contact-row > * { min-width: 0; overflow-wrap: anywhere; }
.client-contact-row div { display: grid; gap: 0.12rem; }
.client-contact-row small { color: var(--muted); }
.client-contact-row em { justify-self: start; font-style: normal; color: var(--cyan-dark); font-weight: 700; }
.client-footer { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }
.results-note { margin: -0.15rem 0 1rem; color: var(--muted); font-size: 0.84rem; }

.prospecting-filters { align-items: end; }
.prospecting-filters .prospect-date-picker input { width: 9.5rem; min-width: 9.5rem; }
.prospect-filter-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.prospect-filter-actions button { min-height: 2.35rem; white-space: nowrap; }
.prospect-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.prospect-card { display: grid; gap: 0.85rem; padding: 1.1rem; }
.prospect-card-header { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.prospect-kicker, .prospect-potential > span { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.prospect-card h2 { margin: 0.25rem 0 0; font-size: 1rem; }
.prospect-card .small-muted { margin: 0.25rem 0 0; }
.prospect-date { flex: 0 0 auto; padding: 0.32rem 0.5rem; border-radius: 999px; color: #1c6d94; background: var(--primary-soft); font-size: 0.75rem; font-weight: 750; white-space: nowrap; }
.prospect-contact-details { margin: 0; }
.prospect-potential { display: grid; gap: 0.35rem; padding: 0.75rem; border: 1px solid #cfeaf7; border-radius: 0.7rem; background: #f4fbff; }
.prospect-potential p { margin: 0; color: var(--ink); font-size: 0.84rem; line-height: 1.45; white-space: pre-line; }
.prospect-actions { border-color: #d7e0e5; background: #fbfcfd; }
.prospect-box-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.prospect-box-heading > span { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.prospect-box-heading time { color: var(--blue-strong); font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.prospect-history { display: grid; gap: 0.55rem; padding-top: 0.15rem; }
.prospect-history-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.prospect-history-header > span { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.prospect-observation { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.65rem; padding: 0.6rem 0; border-top: 1px solid #dce7ec; }
.prospect-observation time { color: var(--blue-strong); font-size: 0.75rem; font-weight: 800; }
.prospect-observation p { margin: 0; color: var(--ink); font-size: 0.82rem; line-height: 1.4; white-space: pre-line; }
.prospect-observation small { grid-column: 2; color: var(--muted); }
.prospect-card-clickable { cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.prospect-card-clickable:hover, .prospect-card-clickable:focus-visible { transform: translateY(-2px); border-color: #88cbe8; box-shadow: 0 12px 28px rgba(24, 91, 124, 0.13); outline: none; }
.prospect-history-modal { width: min(760px, calc(100vw - 2rem)); }
.prospect-history-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.prospect-history-summary > div { padding: 0.9rem; border: 1px solid #cfe1e9; border-radius: 0.75rem; background: #f7fbfd; }
.prospect-history-summary span { color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.prospect-history-summary p { margin: 0.4rem 0 0; line-height: 1.5; white-space: pre-line; }
.prospect-history-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; }
.prospect-history-detail-header h3 { margin: 0; }
.prospect-history-detail { display: grid; max-height: 45vh; overflow: auto; padding-right: 0.25rem; }
.prospect-observation-detail { grid-template-columns: 130px 1fr; padding: 0.85rem 0; }
@media (max-width: 640px) { .prospect-history-summary { grid-template-columns: 1fr; } }
.prospect-card .client-footer { margin-top: 0.05rem; }

.followup-list { display: grid; gap: 0.8rem; }
.followup-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.15rem; }
.followup-main { display: grid; gap: 0.35rem; }
.due-today { color: var(--danger); font-size: 0.8rem; font-weight: 800; }
.due-upcoming { color: var(--warning); font-size: 0.8rem; font-weight: 800; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr); gap: 1rem; align-items: start; }
.permission-list { display: grid; gap: 0.7rem; margin-top: 1rem; }
.permission-item { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.65rem; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.permission-item:last-child { padding-bottom: 0; border-bottom: 0; }
.permission-granted { color: var(--success); font-weight: 700; }
.permission-limited { color: var(--warning); font-weight: 700; }
.permission-none { color: var(--muted); font-weight: 700; }

.quote-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(19rem, 0.65fr); gap: 1rem; align-items: start; }
.quote-main { display: grid; min-width: 0; gap: 1rem; }
.quote-editor-card, .summary-card, .terms-card, .history-card { min-width: 0; padding: 1.2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.form-field { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-width: 0; }
.form-field textarea { min-height: 7.5rem; resize: vertical; line-height: 1.45; }
.form-field.full { grid-column: 1 / -1; }
.prospect-existing-toggle { display: flex; grid-column: 1 / -1; align-items: center; gap: 0.55rem; width: fit-content; color: var(--primary-dark); font-size: 0.84rem; font-weight: 800; cursor: pointer; }
.prospect-existing-toggle input { width: 1rem; height: 1rem; accent-color: var(--primary); }
.summary-card { position: sticky; top: 1rem; }
.summary-caption { margin: 0.15rem 0 0.75rem; color: var(--muted); font-size: 0.78rem; }
.summary-service-list { display: grid; margin-bottom: 1rem; border-top: 1px solid var(--line); }
.summary-service-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.65rem; align-items: center; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.summary-service-item > div { display: grid; min-width: 0; gap: 0.18rem; }
.summary-service-item strong { font-size: 0.82rem; }
.summary-service-item span { color: var(--muted); font-size: 0.74rem; line-height: 1.35; }
.summary-service-total { white-space: nowrap; font-size: 0.82rem; }
.summary-lines { display: grid; gap: 0.65rem; margin-top: 1rem; }
.summary-line { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.88rem; }
.summary-total { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 1.1rem; font-weight: 800; }
.summary-actions { display: grid; gap: 0.6rem; margin-top: 1.2rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.8rem; }
.line-table th, .line-table td { padding: 0.55rem 0.35rem; }
.line-input { width: 100%; min-width: 5.5rem; min-height: 2.1rem; padding: 0.35rem 0.45rem; }
.line-input.item { min-width: 10rem; }
.line-input.category { min-width: 8.5rem; }
.service-lines { display: grid; gap: 0.8rem; }
.service-line { min-width: 0; padding: 0.9rem; border: 1px solid #d9e8f2; border-radius: 0.8rem; background: #f7fcff; }
.event-service-line { background: #fbfeff; }
.event-type-chip { display: inline-flex; width: fit-content; margin-bottom: 0.35rem; padding: 0.28rem 0.55rem; border-radius: 999px; color: #17668f; background: var(--primary-soft); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
.availability-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.2rem; }
.availability-toolbar label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.78rem; font-weight: 750; }
.availability-toolbar input { min-height: 2.45rem; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 0.6rem; color: var(--ink); background: #fff; font: inherit; }
.availability-legend { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.availability-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.availability-legend i { width: 0.7rem; height: 0.7rem; border-radius: 50%; }
.legend-available { background: #dfe8ee; }
.legend-tentative { background: #e6a11a; }
.legend-confirmed { background: #17834f; }
.legend-combined { border: 2px solid #6842b8; background: #fff; }
.availability-plan-card { overflow: hidden; padding: 0; }
.availability-plan-wrap { width: 100%; overflow: hidden; }
.availability-plan { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.availability-plan th, .availability-plan td { border-right: 1px solid #dbe6ed; border-bottom: 1px solid #dbe6ed; }
.availability-plan thead th { position: sticky; top: 0; z-index: 2; width: auto; min-width: 0; padding: 0.42rem 0.05rem; color: #fff; background: var(--nav); text-align: center; font-size: 0.66rem; }
.availability-plan thead .availability-month-band th:not(.availability-corner) { padding: 0.52rem 0.2rem; border-right: 2px solid #a9c9db; color: #fff; background: #17668f; font-size: 0.78rem; letter-spacing: 0.02em; text-transform: capitalize; }
.availability-plan thead th span, .availability-plan thead th small { display: block; }
.availability-plan thead th small { display: none; }
.availability-plan .availability-corner { left: 0; z-index: 4; width: 6.8rem; min-width: 6.8rem; text-align: left; padding-left: 0.58rem; }
.availability-room { position: sticky; left: 0; z-index: 3; width: 6.8rem; min-width: 6.8rem; padding: 0.62rem 0.55rem; color: var(--ink); background: #f2f7fa; text-align: left; font-size: 0.72rem; white-space: nowrap; }
.availability-cell { width: auto; min-width: 0; height: 4.25rem; padding: 0.09rem; vertical-align: top; background: #fff; }
.availability-empty { background: #fbfdfe; }
.availability-booking { display: grid; width: 100%; min-width: 0; gap: 0; margin-bottom: 0.1rem; padding: 0.2rem 0.04rem; border: 1px solid transparent; border-radius: 0.28rem; text-align: center; }
.availability-booking strong { overflow: hidden; font-size: 0.56rem; line-height: 1; text-overflow: clip; white-space: nowrap; }
.availability-booking span, .availability-booking small { display: none; }
.availability-tentative { border-color: #e2bd5d; color: #745000; background: #fff1b8; }
.availability-confirmed { border-color: #17834f; color: #fff; background: #17834f; }
.availability-combined { box-shadow: inset 0 -3px #6842b8; }
.confirm-event-button { color: #fff; border: 1px solid #17834f; background: #17834f; }
.confirm-event-button:hover { border-color: #0f633b; background: #0f633b; transform: translateY(-1px); }
.service-line-header { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.85rem; }
.service-line-header > div { display: grid; gap: 0.1rem; }
.service-line-kicker, .service-line-total span { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.service-line-total { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 0.45rem; }
.service-line-total strong { white-space: nowrap; }
.service-line-header .service-line-actions { display: flex; align-items: center; gap: 0.75rem; }
.service-tax-toggle { display: flex; align-items: center; gap: 0.38rem; color: var(--muted); font-size: 0.76rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.service-tax-toggle input { accent-color: var(--primary); }
.service-line-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.line-control { display: grid; min-width: 0; gap: 0.35rem; color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.line-control input, .line-control select { width: 100%; min-width: 0; min-height: 2.35rem; padding: 0.48rem 0.55rem; border: 1px solid var(--line); border-radius: 0.45rem; color: var(--ink); background: var(--surface); }
.price-input { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.5rem, auto); gap: 0.4rem; }
.price-input select { padding-inline: 0.4rem; font-size: 0.78rem; }
.event-rate-caption { display: flex; align-items: center; justify-content: center; min-height: 2.35rem; padding: 0.4rem 0.55rem; border: 1px solid #d9e8f2; border-radius: 0.45rem; color: #27719e; background: #edf8fd; font-size: 0.76rem; font-weight: 800; white-space: nowrap; }
.line-control-wide { grid-column: span 2; }
.line-control-rate { grid-column: span 2; }
.remove-line { color: var(--danger); border: 0; background: transparent; font-size: 1rem; }
.conditions { display: grid; gap: 0.8rem; }
.template-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.template-admin-card { display: grid; align-content: start; gap: 0.75rem; padding: 1rem; border: 1px solid var(--line); border-radius: 0.65rem; background: var(--surface); }
.template-admin-card h3 { margin: 0; }
.template-admin-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.template-admin-card-header .danger-button { flex: 0 0 auto; }
.template-admin-card textarea { min-height: 8rem; resize: vertical; line-height: 1.4; }
.manual-controls { display: grid; grid-template-columns: minmax(16rem, 1.35fr) minmax(14rem, 0.65fr); gap: 1rem; margin-bottom: 1rem; }
.manual-topic-list { display: grid; gap: 0.8rem; }
.manual-topic { overflow: hidden; background: #fff; }
.manual-topic[hidden] { display: none; }
.manual-topic summary { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: 0.85rem; align-items: center; padding: 1rem 1.15rem; cursor: pointer; list-style: none; }
.manual-topic summary::-webkit-details-marker { display: none; }
.manual-topic summary:hover { background: #f7fcff; }
.manual-topic summary > span:nth-child(2) { display: grid; gap: 0.2rem; }
.manual-topic summary strong { color: var(--ink); }
.manual-topic summary small { color: var(--muted); line-height: 1.35; }
.manual-topic-number { display: grid; width: 2.25rem; height: 2.25rem; place-items: center; border-radius: 0.7rem; color: #fff; background: var(--primary); font-weight: 850; }
.manual-topic-toggle { color: #27719e; font-size: 0.78rem; font-weight: 750; }
.manual-topic[open] .manual-topic-toggle { font-size: 0; }
.manual-topic[open] .manual-topic-toggle::after { content: "Cerrar"; font-size: 0.78rem; }
.manual-topic-content { display: grid; gap: 1rem; padding: 0 1.15rem 1.15rem 4.25rem; border-top: 1px solid var(--line); }
.manual-topic-content ol { display: grid; gap: 0.55rem; margin: 1rem 0 0; padding-left: 1.2rem; color: var(--ink); line-height: 1.5; }
.manual-topic-content li::marker { color: var(--primary-dark); font-weight: 800; }
.manual-topic-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: start; padding: 0.8rem; border: 1px solid #f0d69b; border-radius: 0.7rem; color: #76531a; background: #fff8e9; font-size: 0.82rem; line-height: 1.4; }
.stat-alert { border-color: rgba(190, 59, 59, 0.35); }
.stat-alert .stat-value { color: #a62f2f; }
.stat-today { border-color: rgba(208, 144, 34, 0.4); }
.condition-row { display: flex; align-items: flex-start; gap: 0.6rem; color: var(--ink); font-size: 0.88rem; }
.condition-row input { margin-top: 0.2rem; }
.history-list { display: grid; gap: 0.8rem; }
.history-entry { display: grid; grid-template-columns: 0.6rem 1fr; gap: 0.65rem; }
.history-entry::before { display: block; width: 0.55rem; height: 0.55rem; margin-top: 0.35rem; border-radius: 50%; content: ""; background: var(--primary); }
.history-entry time { color: var(--muted); font-size: 0.76rem; }
.catalog-card { margin-top: 1.25rem; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 1rem; background: rgba(17, 29, 42, 0.48); }
.modal { width: min(100%, 34rem); max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.25rem; border-radius: 0.75rem; background: var(--surface); box-shadow: 0 24px 60px rgba(16, 24, 40, 0.22); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.close-button { border: 0; color: var(--muted); background: transparent; font-size: 1.25rem; }
.modal .form-grid { margin-bottom: 1rem; }
.legacy-import-modal { width: min(100%, 40rem); }
.legacy-import-note { display: grid; gap: 0.2rem; margin-bottom: 0.8rem; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: 0.65rem; background: var(--blue-very-light); color: var(--ink); font-size: 0.88rem; }
.legacy-import-note span { color: var(--muted); }
.legacy-import-steps { margin: 0 0 0.8rem; padding-left: 1.25rem; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.legacy-downloads { margin-bottom: 0.95rem; }
.legacy-downloads .small-button { text-decoration: none; }
.quote-preview { width: min(100%, 52rem); max-height: calc(100vh - 2rem); overflow: auto; }
.quote-preview-header { align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.quote-logo-crop { flex: 0 0 auto; width: 220px; height: 99px; border-radius: 0.55rem; }
.quote-logo-crop img { display: block; width: 293px; max-width: none; transform: translate(-55px, -73px); }
.quote-preview-heading { min-width: 0; margin-right: auto; }
.quote-preview-heading h2 { margin-bottom: 0.2rem; }
.quote-preview-heading .small-muted { margin-bottom: 0; }
.preview-kicker { color: var(--primary); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.preview-client { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; padding: 0.85rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--canvas); }
.event-preview-details { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.preview-client > div { display: grid; min-width: 0; gap: 0.2rem; }
.preview-client span, .preview-client small { color: var(--muted); font-size: 0.75rem; }
.preview-client strong, .preview-client small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-section { margin-top: 1.2rem; }
.preview-section h3 { margin-bottom: 0.55rem; font-size: 0.92rem; }
.preview-lines { border-top: 1px solid var(--line); }
.preview-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.preview-line > div { display: grid; min-width: 0; gap: 0.2rem; }
.preview-line span { color: var(--muted); font-size: 0.78rem; }
.preview-conditions { display: grid; gap: 0.45rem; margin: 0; padding-left: 1.15rem; color: var(--muted); font-size: 0.82rem; }
.preview-totals { display: grid; gap: 0.55rem; width: min(100%, 20rem); margin: 1.25rem 0 0 auto; }
.preview-totals > div { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.86rem; }
.preview-grand-total { padding-top: 0.75rem; border-top: 1px solid var(--line); color: var(--ink) !important; font-size: 1.08rem !important; font-weight: 800; }
.preview-actions { justify-content: flex-end; margin-top: 1rem; }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 10; max-width: min(25rem, calc(100vw - 2rem)); padding: 0.8rem 1rem; border-radius: 0.5rem; color: #fff; background: var(--nav); opacity: 0; pointer-events: none; transform: translateY(0.5rem); transition: 160ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-grid, .prospect-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1250px) {
  .quote-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}
@media (max-width: 760px) {
  .manual-controls { grid-template-columns: 1fr; }
  .manual-topic summary { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .manual-topic-toggle { display: none; }
  .manual-topic-content { padding-left: 1.15rem; }
  .availability-toolbar { align-items: stretch; flex-direction: column; }
  .client-contact-row { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { gap: 0.8rem; padding: 0.85rem 1rem; }
  .main-nav { display: flex; align-items: flex-start; overflow-x: auto; }
  .nav-group { display: flex; flex: 0 0 auto; align-items: center; padding: 0.18rem; }
  .nav-group-label { display: none; }
  .nav-link { white-space: nowrap; }
  .new-quote-button, .sidebar-footer { display: none; }
  .topbar { padding: 0 1rem; }
  .page-content { padding: 1.4rem 1rem 2rem; }
  .dashboard-grid, .quote-layout, .admin-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .followup-card { align-items: flex-start; flex-direction: column; }
  .service-line-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-preview-header { flex-wrap: wrap; }
  .preview-client { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stats-grid, .client-grid, .prospect-grid, .form-grid { grid-template-columns: 1fr; }
  .service-line-grid { grid-template-columns: 1fr; }
  .line-control-wide, .line-control-rate { grid-column: auto; }
  .service-line-header { align-items: flex-start; flex-direction: column; }
  .service-line-header .service-line-actions { flex-wrap: wrap; }
  .page-header { flex-direction: column; }
  .dashboard-header-actions { align-items: stretch; width: 100%; }
  .dashboard-executive-picker { flex: 1; }
  .dashboard-executive-picker select { width: 100%; min-width: 0; }
  .brand-logo-crop { width: 160px; height: 72px; }
  .brand-logo-crop img { width: 213px; transform: translate(-40px, -53px); }
  .quote-logo-crop { width: 190px; height: 86px; }
  .quote-logo-crop img { width: 253px; transform: translate(-48px, -63px); }
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 0.75rem; }
  .user-picker { width: 100%; justify-content: space-between; }
  .user-picker select { max-width: 65%; }
  .topbar-session-actions { width: 100%; justify-content: flex-end; }
  .pipeline-row { grid-template-columns: 6.2rem minmax(3rem, 1fr) 1.3rem; }
}
.coordination-card {
  border-color: #bfd7eb;
  background: linear-gradient(180deg, #f8fcff 0%, #fff 100%);
}

.coordination-block {
  margin-top: 20px;
}

.coordination-block h3 {
  margin: 0 0 10px;
  color: #173f67;
  font-size: 14px;
}

.coordination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
}

.coordination-row > div {
  display: grid;
  gap: 4px;
}

.coordination-row span {
  color: #64748b;
  font-size: 12px;
}

.coordination-row .coordination-state {
  color: #0f6b55;
  font-weight: 700;
}

.coordination-error {
  color: #b42318;
  font-weight: 700;
}

.event-summary-stack {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}
.confirmation-list { display: grid; gap: 14px; }
.confirmation-list-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; }
.confirmation-list-card h2 { margin: 5px 0; font-size: 18px; }
.confirmation-card-meta { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.confirmation-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.confirmation-main { display: grid; gap: 20px; min-width: 0; }
.confirmation-summary { position: sticky; top: 20px; }
.confirmation-item { padding: 18px; }
.confirmation-item-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.confirmation-item-total { display: flex; justify-content: flex-end; gap: 20px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #dce6ed; }
.confirmation-tax-toggle > span:last-child { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #cddce6; border-radius: 8px; background: #fff; }
@media (max-width: 1250px) { .confirmation-layout { grid-template-columns: 1fr; } .confirmation-summary { position: static; } }
@media (max-width: 900px) { .confirmation-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .confirmation-list-card, .confirmation-card-meta { align-items: flex-start; flex-direction: column; } .confirmation-item-grid { grid-template-columns: 1fr; } }
.accepted-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.quote-celebration { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: rgba(8, 31, 48, 0.66); backdrop-filter: blur(4px); animation: celebration-fade-in 180ms ease-out; }
.quote-celebration-card { position: relative; width: min(560px, 92vw); overflow: hidden; border: 4px solid #fff; border-radius: 24px; background: #071f30; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4); }
.quote-celebration-video { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #071f30; }
.quote-celebration-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #173b51; font-size: 26px; line-height: 1; cursor: pointer; }
.quote-celebration-sound { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 11px 18px; border: 0; border-radius: 999px; background: #53bee6; color: #08283b; font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
@keyframes celebration-fade-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .quote-celebration { animation: none; } }
.accepted-summary-grid div { display: grid; gap: 6px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.accepted-summary-grid span { color: #64748b; font-size: 12px; font-weight: 700; text-transform: uppercase; }
@media (max-width: 760px) { .accepted-summary-grid { grid-template-columns: 1fr 1fr; } }
