:root {
    /* Paleta Evolutio inspirada en su identidad corporativa */
    --bg: #f2f7f9;
    --surface: #ffffff;
    --surface-soft: #f6fafc;
    --text: #15313d;
    --muted: #667d87;
    --line: #d9e7ec;
    --primary: #0b82ad;
    --primary-dark: #076889;
    --primary-soft: #e5f5fb;
    --accent: #f56624;
    --accent-dark: #d94e13;
    --accent-soft: #fff0e8;
    --nav: #07384c;
    --danger: #c2413b;
    --warning: #c47b12;
    --info: #0b82ad;
    --shadow: 0 14px 40px rgba(7, 56, 76, .09);
    --radius: 20px;
    --radius-sm: 13px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 270px;
    background: var(--nav);
    color: #f5fbfd;
    padding: 28px 20px;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px 28px; }
.brand-mark {
    width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, var(--primary), #28add7);
    color: #fff; font-weight: 900; font-size: 22px;
    box-shadow: 0 8px 24px rgba(11, 130, 173, .26);
}
.brand strong { display: block; font-size: 19px; letter-spacing: -.02em; }
.brand span { display: block; font-size: 12px; color: #a8c3ce; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 13px;
    color: #bfd7e0; font-weight: 650;
    transition: .2s ease;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: #0b5874; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { width: 22px; text-align: center; font-size: 18px; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary); color: #fff; font-weight: 800;
}
.user-chip-copy { min-width: 0; }
.user-chip-copy strong, .user-chip-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-copy strong { font-size: 14px; }
.user-chip-copy span { color: #a8c3ce; font-size: 12px; }
.logout-link { display: block; margin-top: 14px; color: #a8c3ce; font-size: 13px; }
.logout-link:hover { color: #fff; }

.main-area { margin-left: 270px; min-width: 0; flex: 1; }
.topbar {
    min-height: 92px; padding: 20px 34px;
    display: flex; align-items: center; gap: 18px; justify-content: space-between;
    background: rgba(242, 247, 249, .92); backdrop-filter: blur(14px);
    position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(205, 224, 232, .9);
}
.topbar h1 { margin: 1px 0 0; font-size: clamp(22px, 3vw, 31px); letter-spacing: -.04em; }
.topbar-eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.topbar-user { color: var(--muted); font-size: 14px; font-weight: 650; }
.menu-button { display: none; border: 0; background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.content { padding: 28px 34px 60px; max-width: 1500px; margin: 0 auto; }

.page-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.page-intro h2 { margin: 0 0 5px; font-size: 21px; letter-spacing: -.025em; }
.page-intro p { margin: 0; color: var(--muted); }

.btn {
    border: 0; border-radius: 12px; padding: 11px 17px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 760; transition: .18s ease; min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px rgba(245,102,36,.23); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-danger { background: #feeceb; color: var(--danger); }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: 13px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px;
}
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title h3 { margin: 0; font-size: 17px; }
.card-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.metric-card { position: relative; overflow: hidden; min-height: 145px; }
.metric-card::after { content: ''; position: absolute; width: 95px; height: 95px; border-radius: 50%; right: -25px; bottom: -28px; background: var(--primary-soft); }
.metric-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-value { display: block; font-size: 34px; font-weight: 900; letter-spacing: -.05em; margin: 12px 0 3px; }
.metric-caption { color: var(--muted); font-size: 12px; }

.alert { padding: 14px 16px; border-radius: 13px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; font-weight: 650; }
.alert button { border: 0; background: transparent; font-size: 21px; color: inherit; }
.alert-success { background: #e7f7ef; color: #176b4d; }
.alert-warning { background: #fff4dc; color: #8f5d0c; }
.alert-danger { background: #feeceb; color: #a83833; }
.alert-info { background: #e9f4fb; color: #2d6489; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { display: grid; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label { color: #294753; font-size: 13px; font-weight: 760; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%; border: 1px solid #d4e4ea; background: #fff; color: var(--text);
    border-radius: 12px; padding: 11px 13px; outline: none; min-height: 45px;
    transition: border .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; min-height: 96px; }

.currency-input {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 45px;
    border: 1px solid #d4e4ea;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: border .18s ease, box-shadow .18s ease;
}
.currency-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11,130,173,.12);
}
.currency-prefix {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    min-width: 43px;
    padding: 0 12px;
    border-right: 1px solid #dbe8ed;
    background: var(--surface-soft);
    color: #294753;
    font-weight: 850;
}
.currency-input input[type="text"] {
    min-width: 0;
    min-height: 43px;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    background: transparent;
}
.service-config .currency-input { min-height: 39px; }
.service-config .currency-input input[type="text"] { min-height: 37px; }
.service-config .currency-prefix { min-width: 38px; padding: 0 10px; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11,130,173,.12); }
.help-text { color: var(--muted); font-size: 12px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.step-indicator { display: flex; align-items: center; gap: 9px; color: #91a5ad; font-size: 13px; font-weight: 740; }
.step-indicator::before { content: attr(data-step-indicator); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e3edf1; color: #6c838d; }
.step-indicator.active { color: var(--text); }
.step-indicator.active::before { background: var(--primary); color: #fff; }
.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

.category-section { margin-top: 22px; }
.category-heading { margin-bottom: 12px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.category-heading h3 { margin: 0; font-size: 18px; }
.category-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 850px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.service-card {
    position: relative; border: 1px solid var(--line); border-radius: 17px; background: #fff;
    padding: 17px; transition: .2s ease; cursor: pointer; overflow: hidden;
}
.service-card:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(7,56,76,.09); }
.service-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,130,173,.11); background: #f8fdff; }
.service-check { position: absolute; top: 15px; right: 15px; width: 23px; height: 23px; accent-color: var(--accent); }
.service-card h4 { margin: 0 34px 7px 0; font-size: 15px; letter-spacing: -.015em; }
.service-card > p { margin: 0; color: var(--muted); font-size: 12.5px; min-height: 55px; }
.service-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.meta-pill { background: var(--surface-soft); color: #58717b; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 750; }
.service-config { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 13px; display: grid; gap: 10px; }
.service-config .form-grid { gap: 10px; }
.service-config label { font-size: 11px; }
.service-config input, .service-config select { min-height: 39px; padding: 8px 10px; font-size: 13px; }
.custom-service-row { display: grid; grid-template-columns: 1.1fr 1.5fr .7fr auto; gap: 10px; align-items: end; border: 1px solid var(--line); padding: 14px; border-radius: 14px; background: var(--surface-soft); margin-top: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #edf3f5; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: #f7fbfc; }
td { font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
.table-primary { font-weight: 800; }
.table-secondary { color: var(--muted); font-size: 12px; margin-top: 3px; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-muted { background: #edf1ef; color: #65736b; }
.badge-info { background: #e6f2fa; color: #2f6f9f; }
.badge-warning { background: #fff1d3; color: #9a650e; }
.badge-danger { background: #fde8e7; color: #a93a35; }
.badge-success { background: #e4f7ed; color: #176d4d; }
.badge-dark { background: #e3e7e5; color: #34423a; }

.progress { width: 100%; height: 8px; border-radius: 999px; background: #e4eef2; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #29acd5 72%, var(--accent)); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { min-width: 90px; }
.progress-number { color: var(--muted); font-size: 11px; font-weight: 800; }

.client-header { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center; }
.client-title h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.client-title p { margin: 5px 0 0; color: var(--muted); }
.client-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.service-process-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.process-card { border: 1px solid var(--line); background: #fff; border-radius: 17px; padding: 18px; transition: .2s ease; }
.process-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.process-card-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.process-card h3 { margin: 0; font-size: 16px; }
.process-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.process-card .progress { margin: 16px 0 7px; }
.process-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 12px; color: var(--muted); }

.task-list { display: grid; gap: 10px; }
.task-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: start; border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: #fff; }
.task-number { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-weight: 850; font-size: 12px; }
.task-copy h4 { margin: 0; font-size: 14px; }
.task-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.task-actions { display: flex; gap: 7px; align-items: center; }
.task-actions select { min-width: 150px; min-height: 38px; padding: 7px 10px; font-size: 12px; }
.task-item.completed { background: #f5fbfd; border-color: #c9e3ed; }
.task-item.completed .task-copy h4 { text-decoration: line-through; color: #5d747e; }

.empty-state { text-align: center; padding: 45px 20px; border: 1px dashed #c8dae1; border-radius: var(--radius); background: rgba(255,255,255,.5); }
.empty-state strong { display: block; font-size: 18px; margin-bottom: 5px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }

.search-bar { display: flex; gap: 10px; align-items: center; }
.search-bar input { min-width: 260px; }
.section-spacer { margin-top: 22px; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.stack { display: grid; gap: 14px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 25px;
    background:
        radial-gradient(circle at 18% 18%, rgba(245,102,36,.22), transparent 29%),
        radial-gradient(circle at 82% 80%, rgba(11,130,173,.30), transparent 34%),
        linear-gradient(145deg, #052d3e, #07526f);
}
.login-card { width: min(100%, 430px); background: #fff; border-radius: 25px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 25px; }
.login-card h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.login-card p { margin: 5px 0 0; color: var(--muted); }
.login-card .form-group { margin-top: 14px; }
.login-card .btn { width: 100%; margin-top: 20px; }
.install-note { margin-top: 16px; padding: 12px; border-radius: 12px; background: var(--surface-soft); color: var(--muted); font-size: 12px; }

.sidebar-overlay { display: none; }

@media (max-width: 1150px) {
    .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .menu-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
    .menu-open .sidebar-overlay { display: block; }
    .main-area { margin-left: 0; }
    .menu-button { display: inline-grid; place-items: center; }
    .topbar { padding: 16px 20px; min-height: 80px; justify-content: flex-start; }
    .topbar-user { margin-left: auto; }
    .content { padding: 22px 20px 50px; }
    .form-grid, .grid-2, .service-process-grid { grid-template-columns: 1fr; }
    .client-header { grid-template-columns: 1fr; }
    .client-meta { justify-content: flex-start; }
}

@media (max-width: 620px) {
    .topbar-user { display: none; }
    .content { padding-inline: 14px; }
    .card { padding: 17px; border-radius: 17px; }
    .grid-4, .grid-3, .service-grid { grid-template-columns: 1fr; }
    .steps { gap: 4px; }
    .step-indicator { font-size: 0; }
    .step-indicator::after { content: attr(data-step-label); font-size: 11px; }
    .custom-service-row { grid-template-columns: 1fr; }
    .step-actions { flex-direction: column-reverse; }
    .step-actions .btn { width: 100%; }
    .search-bar { width: 100%; }
    .search-bar input { min-width: 0; flex: 1; }
    .task-item { grid-template-columns: auto 1fr; }
    .task-actions { grid-column: 1 / -1; }
    .task-actions select { width: 100%; }
}

/* Interesados, ficha completa y catálogo actualizado */
.search-help,
.lead-flow-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}
.search-help strong,
.lead-flow-note strong { white-space: nowrap; }
.search-help span,
.lead-flow-note span { color: var(--muted); font-size: 13px; }
.justify-center { justify-content: center; }
.form-card-narrow { max-width: 900px; }

.lead-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(250px, 1fr));
    gap: 14px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 8px;
}
.lead-column {
    min-width: 250px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.55);
    overflow: hidden;
}
.lead-column-head {
    min-height: 112px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.lead-column-head h3 { margin: 0; font-size: 15px; }
.lead-column-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.lead-column-body { padding: 10px; display: grid; gap: 10px; }
.lead-empty { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 12px; }
.lead-card {
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(7,56,76,.05);
}
.lead-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lead-card-head strong { display: block; font-size: 14px; }
.lead-card-head span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.icon-action {
    width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px;
    display: grid; place-items: center; background: var(--surface-soft); color: var(--muted);
}
.icon-action:hover { color: var(--primary); border-color: #a9d5e5; }
.lead-contact { display: grid; gap: 2px; margin: 12px 0; color: var(--muted); font-size: 11px; }
.lead-note { margin: 0 0 12px; padding: 9px 10px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.lead-status-form { display: grid; gap: 5px; margin-top: 12px; }
.lead-status-form label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); }
.lead-status-form select { min-height: 38px; padding: 7px 9px; font-size: 12px; }
.lead-convert { width: 100%; margin-top: 9px; }


.detail-list { display: grid; gap: 0; }
.detail-list > div { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list span { color: var(--muted); font-size: 12px; }
.detail-list strong { font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.partner-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.partner-card > div:first-child { display: grid; gap: 2px; }
.partner-card strong { font-size: 13px; }
.partner-card span { color: var(--muted); font-size: 11px; }
.partner-card.simple { display: block; }
.empty-state.compact { padding: 24px 15px; }

@media (max-width: 1250px) {
    .lead-board { grid-template-columns: repeat(4, 280px); }
}

@media (max-width: 860px) {
    .search-help,
    .lead-flow-note { align-items: flex-start; flex-direction: column; gap: 4px; }
    .lead-board { grid-template-columns: repeat(4, 270px); margin-inline: -4px; }
    .detail-list > div { grid-template-columns: 120px minmax(0,1fr); }
}

@media (max-width: 620px) {
    .lead-board { display: grid; grid-template-columns: 1fr; overflow: visible; }
    .lead-column { min-width: 0; }
    .lead-column-head { min-height: 0; }
    .partner-card { align-items: stretch; flex-direction: column; }
    .partner-card .flex { width: 100%; }
    .partner-card .flex .btn,
    .partner-card .flex form { flex: 1; }
    .partner-card .flex form .btn { width: 100%; }
    .detail-list > div { grid-template-columns: 1fr; gap: 3px; }
}

/* Tabla de interesados */
.lead-table { min-width: 1080px; }
.lead-table td:first-child { min-width: 220px; max-width: 340px; }
.lead-table td:nth-child(2) { min-width: 210px; }
.lead-table td:nth-child(3) { min-width: 125px; }
.lead-table td:nth-child(4) { min-width: 210px; }
.lead-table td:last-child { min-width: 390px; }
.lead-table-status { margin: 0; }
.lead-table-status select { min-width: 195px; min-height: 38px; padding: 7px 10px; font-size: 12px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }

@media (max-width: 620px) {
    .lead-table { min-width: 980px; }
}

/* Antecedentes dinámicos por servicio */
.steps-4 { grid-template-columns: repeat(4, 1fr); }
.requirements-card { padding: 0; overflow: hidden; }
.requirement-intro {
    display: flex; justify-content: space-between; align-items: center; gap: 18px;
    padding: 22px; background: linear-gradient(135deg, #f8fdff, #eaf7fc); border-bottom: 1px solid var(--line);
}
.requirement-intro strong { display: block; font-size: 18px; }
.requirement-intro p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.requirement-section { padding: 22px; border-bottom: 1px solid var(--line); }
.requirement-section:last-of-type { border-bottom: 0; }
.requirement-section-head { margin-bottom: 18px; }
.requirement-section-head > div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.requirement-section-head h3 { margin: 0; font-size: 18px; }
.requirement-section-head p { grid-column: 2; margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.requirement-number {
    grid-row: 1 / span 2; width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: 11px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 900;
}
.requirement-field input[type="file"], .person-form-card input[type="file"] {
    width: 100%; border: 1px dashed #b7d3df; background: #f9fcfd; border-radius: 12px; padding: 10px;
}
.conditional-fields { grid-column: 1 / -1; padding: 14px; background: var(--surface-soft); border: 1px dashed var(--line); border-radius: 14px; }
.people-group + .people-group { margin-top: 24px; }
.compact-heading { align-items: center; }
.compact-heading h4 { margin: 0; font-size: 16px; }
.compact-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.people-list { display: grid; gap: 14px; }
.person-form-card { border: 1px solid var(--line); border-radius: 17px; background: #f9fcfd; padding: 17px; }
.person-form-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.person-form-head strong, .person-form-head span { display: block; }
.person-form-head span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.section-spacer-sm { margin-top: 16px; }
.document-list { display: grid; gap: 9px; }
.document-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.document-row strong, .document-row span { display: block; }
.document-row span { color: var(--muted); font-size: 11px; }
.profile-badges { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0 0; }

@media (max-width: 900px) {
    .steps-4 { grid-template-columns: repeat(2, 1fr); }
    .requirement-intro { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
    .steps-4 { grid-template-columns: 1fr; }
    .requirement-section { padding: 17px; }
    .person-form-head { align-items: flex-start; }
}


/* Credenciales tributarias visibles para usuarios autenticados */
.credential-list { display: grid; gap: 13px; }
.credential-row { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr); gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.credential-row:last-child { border-bottom: 0; }
.credential-row label { font-size: 12px; font-weight: 800; color: var(--muted); }
.credential-value-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.credential-value-wrap input[readonly] { background: #f8fcfd; font-family: inherit; letter-spacing: .01em; }
@media (max-width: 620px) {
    .credential-row { grid-template-columns: 1fr; gap: 6px; }
    .credential-value-wrap { grid-template-columns: minmax(0, 1fr); }
    .credential-value-wrap .btn { width: 100%; }
}

/* Vista completa del cliente en modo solo lectura */
.readonly-page-head { border-color: #c6e0ea; background: linear-gradient(135deg, #fff, #f1faff); }
.info-readonly-section { overflow: hidden; }
.readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
}
.readonly-item {
    min-width: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 5px;
}
.readonly-item:nth-child(odd) { border-right: 1px solid var(--line); }
.readonly-label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.readonly-value { color: var(--ink); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.readonly-secret { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center; }
.readonly-secret strong { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fcfd; overflow-wrap: anywhere; font-size: 13px; }
.service-info-list { display: grid; gap: 14px; }
.service-info-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 9px 26px rgba(7,56,76,.055);
    overflow: hidden;
}
.service-info-card[open] { border-color: #9bd2e6; box-shadow: 0 13px 32px rgba(11,130,173,.10); }
.service-info-card summary {
    cursor: pointer;
    list-style: none;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    background: #fff;
}
.service-info-card summary::-webkit-details-marker { display: none; }
.service-info-card summary::after { content: '⌄'; font-size: 22px; color: var(--primary); transition: transform .18s ease; }
.service-info-card[open] summary::after { transform: rotate(180deg); }
.service-info-summary-main { display: flex; gap: 13px; align-items: flex-start; min-width: 0; flex: 1; }
.service-info-summary-main h3 { margin: 0; font-size: 16px; }
.service-info-summary-main p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.service-info-summary-meta { display: grid; justify-items: end; gap: 2px; min-width: 145px; }
.service-info-summary-meta strong { font-size: 14px; }
.service-info-summary-meta span { color: var(--muted); font-size: 11px; }
.service-info-summary-meta b { margin-top: 4px; color: var(--primary); font-size: 11px; }
.service-info-body { padding: 0 20px 20px; border-top: 1px solid var(--line); background: #f8fcfd; }
.service-profile-block { padding-top: 19px; }
.service-profile-block + .service-profile-block { margin-top: 18px; border-top: 1px dashed var(--line); }
.service-profile-title { margin-bottom: 13px; }
.readonly-subsection + .readonly-subsection { margin-top: 18px; }
.readonly-subsection h4 { margin: 0 0 9px; font-size: 14px; }
.readonly-empty { margin: 0; padding: 13px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; background: #fff; }
.readonly-people { display: grid; gap: 12px; }
.readonly-person-card { border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 14px; }
.readonly-person-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.readonly-person-head strong, .readonly-person-head span { display: block; }
.readonly-person-head > div > span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.readonly-docs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.readonly-docs.compact-docs { margin-top: 11px; }
.readonly-doc {
    min-width: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
}
.readonly-doc:hover { border-color: #94d0e5; background: #f3fbfe; }
.readonly-doc > span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 900; }
.readonly-doc strong, .readonly-doc small { display: block; overflow-wrap: anywhere; }
.readonly-doc strong { font-size: 12px; }
.readonly-doc small { margin-top: 2px; color: var(--muted); font-size: 10px; }

@media (max-width: 760px) {
    .readonly-grid { grid-template-columns: 1fr; }
    .readonly-item:nth-child(odd) { border-right: 0; }
    .service-info-card summary { align-items: flex-start; flex-wrap: wrap; }
    .service-info-summary-main { flex-basis: calc(100% - 38px); }
    .service-info-summary-meta { width: calc(100% - 38px); margin-left: 0; justify-items: start; }
    .readonly-docs { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .service-info-card summary { padding: 15px; }
    .service-info-body { padding: 0 15px 15px; }
    .readonly-secret { grid-template-columns: 1fr; }
    .readonly-secret .btn { width: 100%; }
}


/* Acentos visuales de la identidad Evolutio */
.brand-mark { position: relative; }
.brand-mark::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--nav);
}
.avatar { background: linear-gradient(145deg, var(--accent), #ff884e); }
.topbar { box-shadow: inset 0 -2px 0 rgba(245,102,36,.08); }
.topbar-eyebrow { color: var(--primary-dark); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.nav-icon { color: #6fc6e4; }
.nav-link.active .nav-icon { color: #fff; }
.service-card.selected::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.metric-card:nth-child(even)::after { background: var(--accent-soft); }
.category-heading h3, .card-title h3 { color: #17485a; }
.currency-prefix { color: var(--primary-dark); background: var(--primary-soft); }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); }
.service-info-summary-meta b { color: var(--accent-dark); }
.login-card { border-top: 5px solid var(--accent); }


/* Seguimiento comercial avanzado */
.lead-form { max-width: 1220px; }
.lead-service-list { display: grid; gap: 12px; }
.lead-service-row {
    display: grid;
    grid-template-columns: minmax(170px,1fr) minmax(220px,1.15fr) minmax(145px,.72fr) minmax(165px,.82fr) minmax(155px,.72fr) auto;
    gap: 12px;
    align-items: end;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-soft);
}
.lead-service-remove { margin-bottom: 1px; }
.lead-filters {
    display: grid;
    grid-template-columns: minmax(220px,1.25fr) repeat(3,minmax(180px,1fr)) auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
}
.lead-filter-actions { display: flex; gap: 8px; }
.lead-metrics .card-flat { min-height: 108px; display: flex; flex-direction: column; justify-content: center; }
.metric-money { font-size: clamp(23px,3vw,36px); }
.lead-table-expanded { min-width: 1540px; }
.lead-table-expanded td:nth-child(1) { min-width: 235px; }
.lead-table-expanded td:nth-child(2) { min-width: 190px; }
.lead-table-expanded td:nth-child(3) { min-width: 260px; max-width: 330px; }
.lead-table-expanded td:nth-child(4) { min-width: 165px; }
.lead-table-expanded td:nth-child(5) { min-width: 290px; }
.lead-table-expanded td:nth-child(6) { min-width: 180px; }
.lead-table-expanded td:last-child { min-width: 260px; }
.lead-service-summary { line-height: 1.45; max-width: 320px; }
.follow-up-overdue { color: #b33934; font-weight: 800; }
.conversion-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.conversion-card h3 { margin: 0 0 5px; }
.conversion-card p { margin: 0; color: var(--muted); }
input[readonly] { background: #f3f7f8; color: #5f737b; }

@media (max-width: 1100px) {
    .lead-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .lead-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .lead-service-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .lead-service-remove { justify-self: start; }
}

@media (max-width: 620px) {
    .lead-filters, .lead-service-row { grid-template-columns: 1fr; }
    .lead-filter-actions { flex-direction: column-reverse; }
    .lead-filter-actions .btn, .lead-service-remove { width: 100%; }
    .conversion-card { align-items: stretch; flex-direction: column; }
    .conversion-card form .btn { width: 100%; }
}

/* Seguimiento obligatorio al cambiar el estado comercial. */
.help-text.is-emphasized {
    color: var(--orange-700, #d94f13);
    font-weight: 700;
}
.contact-actions {
    align-items: center;
}

.install-reset-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid rgba(246, 95, 27, .35);
    border-radius: 14px;
    background: rgba(246, 95, 27, .08);
    font-size: 13px;
    line-height: 1.45;
}
.install-reset-confirmation input {
    width: auto;
    margin-top: 2px;
    accent-color: #f65f1b;
}

/* Agregar varios servicios desde la ficha del cliente. */
.client-service-row {
    grid-template-columns: minmax(165px,.95fr) minmax(210px,1.15fr) minmax(140px,.72fr) minmax(160px,.8fr) minmax(150px,.72fr) minmax(145px,.72fr) auto;
}
.client-service-confirmation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.client-service-confirmation strong {
    display: block;
    color: #17485a;
    font-size: 16px;
}
.client-service-confirmation p {
    margin: 5px 0 0;
    color: var(--muted);
}
.client-service-confirmation .step-actions {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}
@media (max-width: 1180px) {
    .client-service-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .client-service-row .lead-service-remove { justify-self: start; }
}
@media (max-width: 720px) {
    .client-service-row { grid-template-columns: 1fr; }
    .client-service-confirmation { align-items: stretch; flex-direction: column; }
    .client-service-confirmation .step-actions { flex-direction: column-reverse; }
    .client-service-confirmation .btn { width: 100%; }
}

/* Instalador con actualización segura y reinstalación opcional. */
.install-card-wide { width: min(680px, calc(100vw - 32px)); }
.install-option-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}
.install-option-card h2 { margin: 0 0 6px; font-size: 18px; color: #17485a; }
.install-option-card p { margin: 0 0 16px; color: var(--muted); }
.install-option-danger { border-color: rgba(196,55,50,.24); background: rgba(196,55,50,.035); }

/* Resumen comercial */
.commercial-heading { margin-bottom: 18px; }
.commercial-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
    padding: 18px;
}
.commercial-date-range { grid-column: span 2; }
.commercial-date-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.commercial-date-fields span { color: var(--muted); font-size: 12px; text-align: center; }
.commercial-filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.commercial-active-filter {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid #ffd8c4; background: var(--accent-soft); color: #873a17;
    border-radius: 13px; padding: 12px 15px; font-size: 13px;
}
.commercial-active-filter a { font-weight: 800; color: var(--accent-dark); }

.commercial-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.commercial-metric-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 17px;
    box-shadow: 0 8px 28px rgba(7,56,76,.065); padding: 16px; min-width: 0;
}
.commercial-metric-head { display: flex; align-items: center; gap: 10px; min-height: 43px; }
.commercial-metric-head > div { min-width: 0; }
.commercial-metric-head strong, .commercial-metric-head small { display: block; }
.commercial-metric-head strong { font-size: 12px; line-height: 1.25; }
.commercial-metric-head small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.commercial-metric-icon, .priority-icon {
    width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center;
    border-radius: 12px; font-weight: 900; font-size: 18px; background: #edf7fb; color: var(--primary);
}
.commercial-metric-card.tone-green .commercial-metric-icon, .priority-icon.tone-green { background: #e8f8ee; color: #18814b; }
.commercial-metric-card.tone-orange .commercial-metric-icon { background: #fff2e8; color: var(--accent-dark); }
.commercial-metric-card.tone-purple .commercial-metric-icon, .priority-icon.tone-purple { background: #f2ebff; color: #7137c7; }
.commercial-metric-card.tone-red .commercial-metric-icon, .priority-icon.tone-red { background: #ffedf0; color: #c42d4b; }
.commercial-metric-card.tone-gray .commercial-metric-icon { background: #edf2f4; color: #44616c; }
.priority-icon.tone-blue { background: #e8f6fc; color: var(--primary); }
.commercial-metric-values { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin: 14px 0 10px; }
.commercial-metric-values > strong { font-size: 27px; line-height: 1; letter-spacing: -.05em; }
.commercial-metric-values > b { font-size: 12px; text-align: right; color: #173d4b; overflow-wrap: anywhere; }
.commercial-change { display: block; font-size: 9.5px; font-weight: 750; }
.commercial-change.positive { color: #22834e; }
.commercial-change.negative { color: #c4473f; }
.commercial-change.neutral { color: var(--muted); }

.commercial-priority { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); padding: 0; overflow: hidden; }
.commercial-priority-title, .commercial-priority-item { padding: 17px 18px; display: flex; align-items: center; gap: 11px; min-width: 0; }
.commercial-priority-title { color: var(--primary-dark); }
.commercial-priority-title > span { font-size: 21px; }
.commercial-priority-title strong, .commercial-priority-title small,
.commercial-priority-item strong, .commercial-priority-item b, .commercial-priority-item small { display: block; }
.commercial-priority-title strong { font-size: 13px; }
.commercial-priority-title small, .commercial-priority-item small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.commercial-priority-item { border-left: 1px solid var(--line); transition: background .18s ease; }
.commercial-priority-item:hover { background: var(--surface-soft); }
.commercial-priority-item strong { font-size: 21px; line-height: 1; }
.commercial-priority-item b { font-size: 11px; margin-top: 2px; }

.commercial-result-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.commercial-result-card { background: #07384c; color: #fff; border-radius: 16px; padding: 17px; min-height: 112px; }
.commercial-result-card:nth-child(even) { background: #0b5874; }
.commercial-result-card span, .commercial-result-card strong, .commercial-result-card small { display: block; }
.commercial-result-card span { color: #bed6df; font-size: 11px; font-weight: 750; }
.commercial-result-card strong { font-size: 23px; margin: 9px 0 5px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.commercial-result-card small { color: #a9c8d3; font-size: 10px; }

.commercial-analysis-grid { align-items: start; }
.commercial-panel { min-height: 390px; }
.commercial-ranking-list { display: grid; gap: 16px; }
.commercial-ranking-row { display: grid; grid-template-columns: minmax(125px, .9fr) minmax(165px, 1.2fr); gap: 6px 14px; align-items: end; }
.commercial-ranking-label strong, .commercial-ranking-label span { display: block; }
.commercial-ranking-label strong { font-size: 12.5px; }
.commercial-ranking-label span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.commercial-ranking-values { display: flex; justify-content: flex-end; gap: 11px; flex-wrap: wrap; font-size: 10px; text-align: right; }
.commercial-ranking-values span { color: var(--muted); }
.commercial-ranking-values b { color: var(--primary-dark); }
.commercial-bar { grid-column: 1 / -1; height: 9px; overflow: hidden; border-radius: 999px; background: #e8f0f3; }
.commercial-bar span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #35add3); }
.commercial-bar-accent span { background: linear-gradient(90deg, var(--accent), #ff9b60); }
.commercial-bar-danger span { background: linear-gradient(90deg, #d64a53, #f09a9e); }

.commercial-funnel-panel { overflow: hidden; }
.commercial-funnel { display: grid; gap: 8px; justify-items: center; }
.commercial-funnel-stage {
    min-height: 46px; border-radius: 11px; padding: 9px 17px;
    display: flex; justify-content: space-between; align-items: center; gap: 15px;
    background: var(--primary); color: #fff; transition: width .2s ease;
}
.commercial-funnel-stage:nth-child(2) { background: #168eb6; }
.commercial-funnel-stage:nth-child(3) { background: #2ca6ca; }
.commercial-funnel-stage:nth-child(4) { background: #f28a50; }
.commercial-funnel-stage:nth-child(5) { background: var(--accent); }
.commercial-funnel-stage:nth-child(6) { background: #25875a; }
.commercial-funnel-stage span { font-size: 12px; font-weight: 750; }
.commercial-funnel-stage strong { font-size: 18px; }

.commercial-detail-panel { padding-bottom: 18px; }
.commercial-detail-table { width: 100%; border-collapse: collapse; min-width: 1120px; }
.commercial-detail-table th, .commercial-detail-table td { padding: 13px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 12px; }
.commercial-detail-table th { background: var(--surface-soft); color: #46636e; font-size: 10px; text-transform: uppercase; letter-spacing: .045em; }
.commercial-service-text { max-width: 260px; line-height: 1.45; }

@media (max-width: 1320px) {
    .commercial-metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .commercial-priority { grid-template-columns: repeat(4,1fr); }
    .commercial-priority-title { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
    .commercial-priority-item:first-of-type { border-left: 0; }
    .commercial-filters { grid-template-columns: repeat(4,minmax(150px,1fr)); }
}
@media (max-width: 1050px) {
    .commercial-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .commercial-date-range { grid-column: span 2; }
    .commercial-result-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .commercial-metric-grid, .commercial-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .commercial-priority { grid-template-columns: repeat(2,1fr); }
    .commercial-priority-item:nth-of-type(odd) { border-left: 0; }
    .commercial-priority-item { border-top: 1px solid var(--line); }
    .commercial-analysis-grid { grid-template-columns: 1fr; }
    .commercial-panel { min-height: 0; }
}
@media (max-width: 560px) {
    .commercial-filters, .commercial-metric-grid, .commercial-result-grid, .commercial-priority { grid-template-columns: 1fr; }
    .commercial-date-range { grid-column: auto; }
    .commercial-date-fields { grid-template-columns: 1fr; }
    .commercial-date-fields span { display: none; }
    .commercial-filter-actions { flex-direction: column-reverse; }
    .commercial-filter-actions .btn { width: 100%; }
    .commercial-priority-title { grid-column: auto; }
    .commercial-priority-item { border-left: 0; border-top: 1px solid var(--line); }
    .commercial-ranking-row { grid-template-columns: 1fr; }
    .commercial-ranking-values { justify-content: flex-start; text-align: left; }
    .commercial-metric-values { align-items: start; flex-direction: column; }
    .commercial-metric-values > b { text-align: left; }
}

/* Resumen operativo */
.operational-heading { margin-bottom: 18px; }
.operational-filters {
    display: grid;
    grid-template-columns: minmax(290px, 1.45fr) minmax(190px, 1fr) minmax(190px, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
}
.operational-date-range { min-width: 0; }
.operational-filter-actions { display: flex; gap: 9px; align-items: end; }
.operational-filter-actions .btn { white-space: nowrap; }
.operational-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.operational-metric-card {
    display: block;
    min-width: 0;
    min-height: 196px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: 0 8px 28px rgba(7,56,76,.065);
    transition: transform .18s ease, box-shadow .18s ease;
}
a.operational-metric-card:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(7,56,76,.1); }
.operational-metric-card.tone-green .commercial-metric-icon { background: #e8f8ee; color: #18814b; }
.operational-metric-card.tone-orange .commercial-metric-icon { background: #fff2e8; color: var(--accent-dark); }
.operational-metric-card.tone-purple .commercial-metric-icon { background: #f2ebff; color: #7137c7; }
.operational-dual-value { display: grid; grid-template-columns: .8fr 1.2fr; margin: 15px 0 12px; }
.operational-dual-value > div { min-width: 0; }
.operational-dual-value > div + div { border-left: 1px solid var(--line); padding-left: 13px; text-align: right; }
.operational-dual-value span, .operational-dual-value strong { display: block; }
.operational-dual-value span { color: var(--muted); font-size: 9.5px; margin-bottom: 5px; }
.operational-dual-value strong { font-size: 21px; line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
.operational-dual-value > div:first-child strong { font-size: 27px; }
.operational-single-value { margin: 19px 0 14px; display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.operational-single-value strong { font-size: 31px; line-height: 1; letter-spacing: -.05em; }
.operational-single-value span { padding: 5px 8px; border-radius: 999px; background: #fff0e8; color: var(--accent-dark); font-size: 10px; font-weight: 800; }
.operational-card-foot { color: var(--muted); font-size: 10px; }
.operational-last-movement { display: flex; flex-direction: column; }
.operational-movement-copy { display: grid; gap: 3px; margin: 15px 0 13px; }
.operational-movement-copy strong { font-size: 14px; }
.operational-movement-copy span { color: var(--primary-dark); font-size: 11px; font-weight: 750; }
.operational-movement-copy small { color: var(--muted); font-size: 10px; }
.operational-last-movement .btn { margin-top: auto; }
.operational-table-grid { grid-template-columns: .92fr 1.08fr; }
.operational-list-card { min-width: 0; padding-bottom: 14px; }
.operational-table-scroll { overflow-x: auto; }
.operational-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.operational-table th, .operational-table td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 11px; }
.operational-table th { color: #55717b; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.operational-table tr:last-child td { border-bottom: 0; }
.operational-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.operational-service-line { display: block; max-width: 250px; line-height: 1.35; }
.operational-money-positive { color: #18814b; white-space: nowrap; }
.operational-chart-grid { align-items: stretch; }
.operational-chart-card { min-width: 0; min-height: 390px; }
.operational-projection-layout { display: grid; grid-template-columns: minmax(0, 1fr) 155px; gap: 20px; align-items: stretch; min-height: 285px; }
.operational-bars { display: flex; gap: 10px; align-items: end; min-width: 0; padding: 15px 0 4px; border-bottom: 1px solid var(--line); }
.operational-bar-column { min-width: 0; flex: 1; height: 250px; display: grid; grid-template-rows: 30px 1fr 24px; align-items: end; text-align: center; }
.operational-bar-value { min-height: 28px; color: var(--primary-dark); font-size: 8.5px; font-weight: 750; overflow-wrap: anywhere; }
.operational-bar-track { height: 185px; display: flex; align-items: end; justify-content: center; border-radius: 8px 8px 0 0; background: linear-gradient(to top, rgba(11,130,173,.04), transparent); }
.operational-bar-track span { width: min(38px, 70%); display: block; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #55b7e5, var(--primary)); min-height: 4px; }
.operational-bar-column small { color: var(--muted); font-size: 9px; }
.operational-projection-summary { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.operational-projection-summary span, .operational-projection-summary strong, .operational-projection-summary small { display: block; }
.operational-projection-summary span { color: var(--muted); font-size: 10px; }
.operational-projection-summary strong { margin: 6px 0 2px; font-size: 20px; color: var(--primary-dark); overflow-wrap: anywhere; }
.operational-projection-summary small { color: var(--muted); font-size: 9px; }
.operational-projection-summary hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.operational-donut-layout { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.2fr); align-items: center; gap: 28px; min-height: 285px; }
.operational-donut { width: min(230px, 100%); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; margin: auto; }
.operational-donut::before { content: ''; position: absolute; }
.operational-donut > div { width: 58%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; padding: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.operational-donut strong, .operational-donut span { display: block; }
.operational-donut strong { font-size: 18px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.operational-donut span { color: var(--muted); font-size: 9px; margin-top: 2px; }
.operational-donut-legend { display: grid; gap: 3px; }
.operational-donut-legend > div { display: grid; grid-template-columns: 9px minmax(110px, 1fr) auto 34px; gap: 9px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.operational-donut-legend > div:last-child { border-bottom: 0; }
.operational-donut-legend i { width: 8px; height: 8px; border-radius: 50%; }
.operational-donut-legend span { color: var(--text); }
.operational-donut-legend strong { color: var(--primary-dark); white-space: nowrap; }
.operational-donut-legend small { color: var(--muted); text-align: right; }

@media (max-width: 1380px) {
    .operational-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .operational-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .operational-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 1050px) {
    .operational-table-grid, .operational-chart-grid { grid-template-columns: 1fr; }
    .operational-filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .operational-date-range { grid-column: span 2; }
}
@media (max-width: 760px) {
    .operational-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operational-projection-layout, .operational-donut-layout { grid-template-columns: 1fr; }
    .operational-projection-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 15px; }
    .operational-projection-summary hr { display: none; }
    .operational-donut { width: 205px; }
}
@media (max-width: 560px) {
    .operational-filters, .operational-metric-grid { grid-template-columns: 1fr; }
    .operational-date-range { grid-column: auto; }
    .operational-filter-actions { flex-direction: column-reverse; }
    .operational-filter-actions .btn { width: 100%; }
    .operational-dual-value { grid-template-columns: 1fr 1fr; }
    .operational-chart-card { padding: 16px; }
    .operational-bars { gap: 5px; }
    .operational-bar-value { font-size: 7px; }
    .operational-donut-legend > div { grid-template-columns: 9px minmax(90px, 1fr) auto 30px; gap: 6px; }
}


/* Clientes, estado OT y paginación */
.client-filters {
    display: grid;
    grid-template-columns: minmax(250px, 1.4fr) repeat(5, minmax(145px, .8fr));
    gap: 12px;
    align-items: end;
}
.client-search-field { min-width: 0; }
.client-filter-actions { display: flex; gap: 8px; align-items: end; grid-column: 1 / -1; justify-content: flex-end; }
.client-summary-grid { gap: 12px; }
.client-summary-card { display: block; min-height: 118px; transition: transform .18s ease, box-shadow .18s ease; }
a.client-summary-card:hover { transform: translateY(-2px); box-shadow: 0 11px 26px rgba(7,56,76,.09); }
.client-summary-card.tone-orange { border-color: #f5d8c5; background: #fffaf6; }
.client-summary-card.tone-green { border-color: #caead8; background: #f7fcf9; }
.client-summary-card.tone-blue { border-color: #cae7f2; background: #f7fcfe; }
.client-table { min-width: 1160px; }
.client-table th, .client-table td { vertical-align: middle; }
.client-ot-badge { display: inline-flex; margin-top: 7px; }
.client-ot-form { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.client-ot-form label { color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.client-ot-form select { min-height: 34px; padding: 5px 28px 5px 8px; border-radius: 8px; font-size: 11px; }
.pagination-bar {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: #fff;
}
.pagination-meta { color: var(--muted); font-size: 11px; }
.page-size-form label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.page-size-form select { min-height: 34px; padding: 5px 28px 5px 9px; font-size: 11px; }
.pagination-pages { display: flex; align-items: center; gap: 5px; }
.pagination-link {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}
.pagination-link:hover { border-color: #9fcddd; background: var(--primary-soft); }
.pagination-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-link.disabled { opacity: .38; pointer-events: none; }

@media (max-width: 1280px) {
    .client-filters { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .client-search-field { grid-column: span 2; }
}
@media (max-width: 760px) {
    .client-filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .client-search-field { grid-column: span 2; }
    .pagination-bar { grid-template-columns: 1fr; gap: 10px; }
    .pagination-pages { justify-content: flex-start; flex-wrap: wrap; }
    .client-ot-form { width: 100%; justify-content: space-between; }
}
@media (max-width: 560px) {
    .client-filters { grid-template-columns: 1fr; }
    .client-search-field { grid-column: auto; }
    .client-filter-actions { flex-direction: column-reverse; }
    .client-filter-actions .btn { width: 100%; }
}

/* Ajuste tabla de interesados: acciones visibles y columnas compactas */
.lead-table-expanded {
    min-width: 1180px;
    table-layout: fixed;
}
.lead-table-expanded th,
.lead-table-expanded td {
    padding-left: 12px;
    padding-right: 12px;
    overflow-wrap: anywhere;
}
.lead-table-expanded th:nth-child(1),
.lead-table-expanded td:nth-child(1) {
    width: 18%;
    min-width: 0;
    max-width: none;
}
.lead-table-expanded th:nth-child(2),
.lead-table-expanded td:nth-child(2) {
    width: 10%;
    min-width: 0;
}
.lead-table-expanded th:nth-child(3),
.lead-table-expanded td:nth-child(3) {
    width: 18%;
    min-width: 0;
    max-width: none;
}
.lead-table-expanded th:nth-child(4),
.lead-table-expanded td:nth-child(4) {
    width: 12%;
    min-width: 0;
}
.lead-table-expanded th:nth-child(5),
.lead-table-expanded td:nth-child(5) {
    width: 20%;
    min-width: 0;
}
.lead-table-expanded th:nth-child(6),
.lead-table-expanded td:nth-child(6) {
    width: 15%;
    min-width: 0;
}
.lead-table-expanded th:nth-child(7),
.lead-table-expanded td:nth-child(7) {
    width: 7%;
    min-width: 82px;
    text-align: center;
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
    box-shadow: -10px 0 16px -17px rgba(11, 55, 72, .65);
}
.lead-table-expanded th:nth-child(7) {
    z-index: 4;
    background: #f7fbfc;
}
.lead-table-expanded td:nth-child(5) .badge {
    white-space: normal;
    line-height: 1.25;
    text-align: center;
    justify-content: center;
    max-width: 100%;
}
.lead-table-expanded .contact-actions {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
}
.lead-table-expanded td:last-child .table-actions {
    justify-content: center;
    flex-wrap: nowrap;
}
.lead-table-expanded td:last-child .btn {
    padding-inline: 12px;
}
.lead-table-expanded .lead-service-summary {
    max-width: none;
}

@media (max-width: 1250px) {
    .lead-table-expanded {
        min-width: 1080px;
    }
    .lead-table-expanded th,
    .lead-table-expanded td {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Gestión compacta de usuarios */
.user-role-form { display: flex; align-items: center; gap: 8px; min-width: 230px; }
.user-role-form select { min-width: 125px; padding-top: 8px; padding-bottom: 8px; }
.user-action-stack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-action-stack form { margin: 0; }
.user-current-badge { margin-top: 6px; }
.users-table th:last-child, .users-table td:last-child { min-width: 190px; }
@media (max-width: 760px) {
    .user-role-form { min-width: 0; flex-wrap: wrap; }
    .users-table th:last-child, .users-table td:last-child { min-width: 150px; }
}


.service-option-field[hidden],
.service-tariff-field[hidden],
.service-pricing-note[hidden] { display: none !important; }

.service-pricing-note {
    grid-column: 1 / -1;
    padding: 9px 11px;
    border: 1px solid #f5d8c5;
    border-radius: 10px;
    background: #fff8f3;
    color: #9d4b20;
    font-size: 11px;
    line-height: 1.45;
}
.service-value-help { display: block; margin-top: 5px; }
[data-currency-prefix] { min-width: 46px; justify-content: center; }
.pricing-summary-note {
    margin: 8px 4px 0;
    color: var(--muted);
}


/* Selector de servicios compacto: tarifa más legible y acción mínima. */
.lead-service-row,
.client-service-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.lead-service-row > .form-group,
.client-service-row > .form-group {
    flex: 1 1 180px;
    min-width: 0;
}
.lead-service-row > .form-group:nth-child(1),
.client-service-row > .form-group:nth-child(1) {
    flex-basis: 210px;
}
.lead-service-row > .form-group:nth-child(2),
.client-service-row > .form-group:nth-child(2) {
    flex: 1.2 1 260px;
}
.lead-service-row > .service-option-field,
.client-service-row > .service-option-field {
    flex: .85 1 170px;
}
.lead-service-row > .service-tariff-field,
.client-service-row > .service-tariff-field {
    flex: 1.35 1 255px;
}
.lead-service-row > .service-pricing-note,
.client-service-row > .service-pricing-note {
    flex: 1 0 100%;
}
.lead-service-remove,
.client-service-row .lead-service-remove {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    margin: 0;
    border-radius: 12px;
}
.lead-service-remove svg {
    width: 18px;
    height: 18px;
    display: block;
}
.service-value-help { display: none !important; }

@media (max-width: 620px) {
    .lead-service-row > .form-group,
    .client-service-row > .form-group {
        flex: 1 0 100%;
    }
    .lead-service-remove,
    .client-service-row .lead-service-remove {
        width: 42px;
        min-width: 42px;
        flex-basis: 42px;
        justify-self: auto;
        align-self: flex-end;
        margin-left: auto;
    }
}
