
/* Shared modern module styles */
.crm-page-hero-soft {
    background: linear-gradient(135deg, #111827 0%, #1f2937 55%, #0f172a 100%);
    border-radius: 24px;
    padding: 1.6rem 1.7rem;
    color: #fff;
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.16);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.2rem;
}
.crm-page-hero-soft__eyebrow {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-weight: 700;
    margin-bottom: 0.55rem;
}
.crm-page-hero-soft__title {
    color: #fff;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    font-weight: 700;
    margin: 0 0 0.35rem;
}
.crm-page-hero-soft__text {
    color: rgba(255,255,255,0.76);
    margin: 0;
    max-width: 760px;
}
.crm-page-hero-soft__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    justify-content: flex-end;
}
.crm-page-mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: stretch;
    justify-content: flex-end;
}
.crm-page-mini-stat {
    min-width: 120px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    backdrop-filter: blur(10px);
}
.crm-page-mini-stat__label {
    display: block;
    font-size: 0.74rem;
    color: rgba(255,255,255,0.64);
    margin-bottom: 0.35rem;
}
.crm-page-mini-stat__value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}
.card-crm.crm-module-card,
.card-crm:not(.crm-filter-card):not(.crm-table-card) {
    border-radius: 24px;
    border: 1px solid #e5ebf3;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    background: #fff;
}
.crm-module-card .card-header,
.card-crm:not(.crm-filter-card):not(.crm-table-card) .card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #edf2f7;
    padding: 1.1rem 1.35rem;
}
.crm-module-card .card-body,
.card-crm:not(.crm-filter-card):not(.crm-table-card) .card-body {
    padding: 1.2rem 1.35rem 1.35rem;
}
.crm-card-title { display:flex; flex-direction:column; gap:0.15rem; }
.crm-card-title__title { font-size:1rem; font-weight:700; color:#0f172a; }
.crm-card-title__subtitle { font-size:0.84rem; color:#64748b; }
.crm-table-modern { border-collapse:separate; border-spacing:0; table-layout:auto; min-width:100%; }
.crm-table-modern thead th {
    background:#f8fafc; color:#64748b; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em;
    font-weight:700; border-bottom:1px solid #e6edf5; padding-top:0.95rem; padding-bottom:0.95rem;
}
.crm-table-modern thead th:first-child { border-top-left-radius:16px; }
.crm-table-modern thead th:last-child { border-top-right-radius:16px; }
.crm-table-modern tbody td { border-bottom:1px solid #edf2f7; padding-top:1rem; padding-bottom:1rem; color:#334155; background:#fff; }
.crm-table-modern tbody tr:hover td { background:#f8fbff; }
.crm-table-modern .badge { border-radius:999px !important; padding:0.42rem 0.7rem !important; font-weight:600 !important; }
.crm-cell-stack { display:flex; flex-direction:column; gap:0.2rem; min-width:0; }
.crm-cell-title { font-weight:700; color:#0f172a; }
.crm-cell-subtitle { color:#64748b; font-size:0.82rem; }
.crm-pill-soft { display:inline-flex; align-items:center; gap:0.35rem; border-radius:999px; padding:0.38rem 0.7rem; font-size:0.78rem; font-weight:600; background:#eff6ff; color:#1d4ed8; }
.crm-value-chip { display:inline-flex; align-items:center; border-radius:12px; padding:0.5rem 0.75rem; background:#f8fafc; border:1px solid #e5ebf3; color:#0f172a; font-weight:700; }
.crm-action-group { display:flex; flex-wrap:wrap; align-items:center; gap:0.45rem; }
.crm-action-group .btn, .crm-table-modern .btn.btn-sm { min-width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; padding:0 !important; border-radius:10px !important; }
.crm-action-group .btn i, .crm-table-modern .btn.btn-sm i { font-size:0.92rem !important; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { margin-bottom:0.9rem; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border:1px solid #d9e2ef; border-radius:12px; min-height:40px; padding:0.45rem 0.8rem; background:#fff; }
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius:10px !important; border:1px solid transparent !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { background:#0f172a !important; color:#fff !important; border-color:#0f172a !important; }
.modal-content { border-radius:24px; border:1px solid #e5ebf3; box-shadow:0 26px 50px rgba(15, 23, 42, 0.16); }
.modal-header { padding:1.1rem 1.3rem; background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); border-bottom:1px solid #edf2f7; }
.modal-body { padding:1.25rem 1.3rem; }
.modal-footer { padding:1rem 1.3rem; border-top:1px solid #edf2f7; }
.modal-section { background:#f8fafc; border:1px solid #e8edf5; border-radius:18px; padding:1rem; }
.modal-section-title, .form-section-title { font-size:0.78rem; text-transform:uppercase; letter-spacing:0.08em; font-weight:700; color:#64748b; }
.crm-empty-message { padding:2.2rem 1rem; text-align:center; color:#64748b; }
@media (max-width: 991px) {
    .crm-page-hero-soft { grid-template-columns:1fr; }
    .crm-page-hero-soft__actions, .crm-page-mini-stats { justify-content:flex-start; }
}

/* Forms and auth */
.crm-form-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.crm-form-card {
    background: #fff;
    border: 1px solid #e5ebf3;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}
.crm-form-card__header {
    padding: 1.05rem 1.25rem;
    border-bottom: 1px solid #edf2f7;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.crm-form-card__body {
    padding: 1.25rem;
}
.crm-form-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.crm-form-card__text {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.88rem;
}
.crm-form-helper {
    color: #64748b;
    font-size: 0.84rem;
}
.crm-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}
.crm-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}
.crm-check-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border: 1px solid #e5ebf3;
    border-radius: 18px;
    background: #f8fafc;
    min-height: 100%;
}
.crm-check-card .form-check-input {
    margin-top: 0.15rem;
}
.crm-check-card__title {
    color: #0f172a;
    font-weight: 700;
    line-height: 1.2;
}
.crm-check-card__text {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    margin-top: 0.2rem;
    line-height: 1.35;
}
.crm-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.crm-token {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.6rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
}
.crm-auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 0.9fr);
    background: linear-gradient(135deg, #0f172a 0%, #111827 52%, #1e293b 100%);
}
.crm-auth-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.crm-auth-hero__panel {
    max-width: 560px;
    color: #fff;
}
.crm-auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.86);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.1rem;
}
.crm-auth-title {
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1.02;
    font-weight: 800;
    margin: 0 0 0.9rem;
}
.crm-auth-text {
    color: rgba(255,255,255,0.72);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 1.6rem;
}
.crm-auth-bullets {
    display: grid;
    gap: 0.8rem;
}
.crm-auth-bullet {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: rgba(255,255,255,0.84);
}
.crm-auth-bullet i {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
}
.crm-auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(248,250,252,0.98) 100%);
}
.crm-auth-card {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid #e5ebf3;
    border-radius: 28px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}
.crm-auth-card__header {
    padding: 1.6rem 1.6rem 1rem;
}
.crm-auth-card__body {
    padding: 0 1.6rem 1.6rem;
}
.crm-auth-card__title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.35rem;
}
.crm-auth-card__text {
    color: #64748b;
    margin: 0;
}
.crm-auth-card .form-control {
    height: 48px;
    font-size: 0.95rem;
    border-radius: 14px;
}
.crm-auth-card .btn {
    min-height: 48px;
    border-radius: 14px;
    font-weight: 700;
}
@media (max-width: 991px) {
    .crm-auth-shell {
        grid-template-columns: 1fr;
    }
    .crm-auth-hero {
        padding: 2.25rem 1.5rem 0.75rem;
    }
    .crm-auth-form-wrap {
        padding: 1.5rem;
    }
}


/* Final migration helpers */
.crm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.crm-dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
    padding: 1.2rem;
    border: 1px solid #e5ebf3;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}
.crm-dashboard-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 1.2rem;
}
.crm-dashboard-card__title {
    color: #0f172a;
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}
.crm-dashboard-card__text {
    color: #64748b;
    margin: 0;
    line-height: 1.55;
}
.crm-dashboard-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.crm-dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
}
.crm-dashboard-link:hover {
    color: #1d4ed8;
}
.crm-dashboard-note {
    border: 1px dashed #d8e2ef;
    border-radius: 22px;
    padding: 1.25rem 1.35rem;
    background: #ffffff;
}
.crm-dashboard-note__title {
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.crm-dashboard-note__text {
    color: #64748b;
    margin: 0;
}
.modal-content .form-control,
.modal-content .form-select,
.crm-form-shell .form-control,
.crm-form-shell .form-select {
    min-height: 32px;
    border-radius: 14px;
    border-color: #d9e2ef;
    box-shadow: none !important;
}
.modal-content textarea.form-control,
.crm-form-shell textarea.form-control {
    min-height: auto;
}
.modal-content .form-control:focus,
.modal-content .form-select:focus,
.crm-form-shell .form-control:focus,
.crm-form-shell .form-select:focus {
    border-color: #94a3b8;
}
.modal-content .form-label,
.crm-form-shell .form-label {
    color: #334155;
    font-weight: 600;
    margin-bottom: 0.45rem;
}
.modal-footer .btn,
.crm-form-actions .btn,
.crm-page-hero-soft__actions .btn {
    border-radius: 14px !important;
    min-height: 42px;
    padding-inline: 1rem !important;
    font-weight: 600 !important;
}
.crm-modal-intro {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}
.crm-modal-intro__title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}
.crm-modal-intro__text {
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}
.crm-modal-grid {
    display: grid;
    gap: 1rem;
}
.crm-info-card,
.crm-summary-card,
.crm-preview-card {
    background: #f8fafc;
    border: 1px solid #e5ebf3;
    border-radius: 18px;
    padding: 1rem;
}
.crm-info-card__title,
.crm-summary-card__title,
.crm-preview-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}
.crm-info-card__text,
.crm-preview-card__text {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}
.crm-key-value {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
}
.crm-key-value__item {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 14px;
    padding: 0.8rem 0.9rem;
}
.crm-key-value__label {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    margin-bottom: 0.2rem;
}
.crm-key-value__value {
    display: block;
    color: #0f172a;
    font-weight: 700;
}
.crm-scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.crm-token-list--spaced { margin-top: 0; }
.crm-preview-frame {
    width: 100%;
    min-height: 500px;
    border: 1px solid #dbe4ef;
    border-radius: 18px;
    background: #fff;
}
.crm-readonly {
    background: #f8fafc !important;
}
.crm-modal-dialog-wide {
    max-width: 980px;
}
.crm-modal-scrollable-body {
    overflow-y: auto;
    flex: 1 1 auto;
}
.crm-form-range-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.crm-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.9rem;
}
.crm-metric {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 16px;
    padding: 0.9rem;
}
.crm-metric__label {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    margin-bottom: 0.22rem;
}
.crm-metric__value {
    display: block;
    color: #0f172a;
    font-weight: 700;
}
.crm-alert-soft {
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #991b1b;
    border-radius: 16px;
    padding: 0.9rem 1rem;
}
.crm-empty-card {
    border: 1px dashed #d9e2ef;
    border-radius: 18px;
    padding: 1rem;
    text-align: center;
    color: #64748b;
    background: #fff;
}
@media (max-width: 991px) {
    .crm-scenario-grid {
        grid-template-columns: 1fr;
    }
}

.modal-content .select2-container .select2-selection--single,
.crm-form-shell .select2-container .select2-selection--single,
.modal-content .select2-container .select2-selection--multiple,
.crm-form-shell .select2-container .select2-selection--multiple {
    min-height: 46px;
    border-radius: 14px !important;
    border: 1px solid #d9e2ef !important;
    display: flex;
    align-items: center;
}
.modal-content .select2-container--default .select2-selection--single .select2-selection__rendered,
.crm-form-shell .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 0.9rem;
    color: #334155;
}
.modal-content .select2-container--default .select2-selection--single .select2-selection__arrow,
.crm-form-shell .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
    right: 10px;
}


/* Ajustes visuales v8 */
.crm-page-hero-soft {
    padding: 1.75rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.crm-page-hero-soft__actions {
    align-items: center;
    justify-content: flex-end;
}

.crm-page-hero-soft__actions .btn,
.crm-page-hero__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.crm-module-card__header {
    padding: 1.15rem 1.35rem;
}

.dataTables_wrapper .row:last-child {
    margin-top: 1rem;
    align-items: center;
}

.dataTables_wrapper div.dataTables_info {
    color: #64748b;
    font-size: 0.85rem;
    padding-top: 0;
}

.dataTables_wrapper div.dataTables_paginate {
    margin-top: 0;
}

.dataTables_wrapper .pagination {
    gap: 0.4rem;
    align-items: center;
}

.dataTables_wrapper .page-item .page-link {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px !important;
    border: 1px solid #d9e2ef;
    color: #334155;
    background: #ffffff;
    box-shadow: none;
}

.dataTables_wrapper .page-item.active .page-link,
.dataTables_wrapper .page-item.active .page-link:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.dataTables_wrapper .page-item.disabled .page-link {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.dataTables_wrapper .page-item:not(.active):not(.disabled) .page-link:hover {
    color: #0f172a;
    background: #f8fafc;
    border-color: #cbd5e1;
}


/* Ajustes visuales v9 · Bloque A */
.crm-content-wrap {
    padding: 1.5rem 1.5rem 2rem;
}

.crm-page-hero-soft,
.crm-page-hero-leads {
    position: relative;
    overflow: hidden;
    min-height: 176px;
}

.crm-page-hero-soft::after,
.crm-page-hero-leads::after {
    content: "";
    position: absolute;
    inset: auto -70px -90px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.crm-page-hero-soft > *,
.crm-page-hero-leads > * {
    position: relative;
    z-index: 1;
}

.crm-page-hero-soft__text,
.crm-page-hero__text {
    line-height: 1.6;
}

.crm-page-hero-soft__actions,
.crm-page-hero__actions {
    align-self: start;
}

.crm-page-hero-soft__actions .btn,
.crm-page-hero__actions .btn {
    min-height: 46px;
    border-radius: 14px !important;
    padding-inline: 1.05rem !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.crm-page-hero-soft__actions .btn i,
.crm-page-hero__actions .btn i {
    font-size: 0.95rem;
}

.crm-page-mini-stat,
.crm-page-stat {
    min-width: 132px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.card-crm.crm-module-card,
.card-crm.crm-filter-card,
.card-crm.crm-table-card,
.crm-form-card {
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.065);
}

.crm-module-card__header,
.crm-table-card__header,
.crm-form-card__header {
    min-height: 76px;
}

.crm-card-title__title,
.crm-section-heading h5,
.crm-table-card__header h5 {
    letter-spacing: -0.01em;
}

.crm-card-title__subtitle,
.crm-section-heading p,
.crm-table-card__header p {
    line-height: 1.5;
}

.crm-module-card .table-responsive,
.crm-table-card .table-responsive {
    padding-bottom: 0.15rem;
}

.crm-table-modern,
.table-leads {
    margin-bottom: 0;
}

.crm-table-modern thead th,
.table-leads thead th {
    vertical-align: middle;
    white-space: nowrap;
}

.crm-table-modern tbody td,
.table-leads tbody td {
    vertical-align: middle;
}

.crm-table-modern tbody tr:last-child td,
.table-leads tbody tr:last-child td {
    border-bottom-color: transparent !important;
}

.crm-table-modern tbody td:first-child,
.table-leads tbody td:first-child {
    padding-left: 1rem;
}

.crm-table-modern tbody td:last-child,
.table-leads tbody td:last-child {
    padding-right: 1rem;
}

.crm-table-modern thead th:first-child,
.table-leads thead th:first-child {
    padding-left: 1rem;
}

.crm-table-modern thead th:last-child,
.table-leads thead th:last-child {
    padding-right: 1rem;
}

.crm-action-group,
.lead-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.crm-action-group .btn,
.crm-table-modern .btn.btn-sm,
.lead-actions .btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 12px !important;
    border-color: #d9e2ef;
    background: #fff;
    color: #334155;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.03);
}

.crm-action-group .btn:hover,
.crm-table-modern .btn.btn-sm:hover,
.lead-actions .btn:hover {
    color: #0f172a;
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.crm-action-group .btn.btn-outline-danger,
.crm-table-modern .btn.btn-outline-danger,
.lead-actions .btn.btn-outline-danger {
    color: #dc2626;
}

.crm-action-group .btn.btn-outline-danger:hover,
.crm-table-modern .btn.btn-outline-danger:hover,
.lead-actions .btn.btn-outline-danger:hover {
    background: #fff5f5;
    border-color: #fecaca;
}

.crm-cell-title,
.lead-contact-card__name {
    line-height: 1.35;
}

.crm-cell-subtitle,
.lead-contact-card__owner,
.lead-date-meta__time,
.lead-date-meta__id {
    line-height: 1.35;
}

.dataTables_wrapper.crm-datatable {
    padding-top: 0.15rem;
}

.dataTables_wrapper.crm-datatable .row:first-child {
    align-items: center;
    row-gap: 0.85rem;
    margin-bottom: 1rem;
}

.dataTables_wrapper.crm-datatable .dataTables_length,
.dataTables_wrapper.crm-datatable .dataTables_filter {
    margin-bottom: 0;
}

.dataTables_wrapper.crm-datatable .dataTables_length label,
.dataTables_wrapper.crm-datatable .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.dataTables_wrapper.crm-datatable .dataTables_filter {
    text-align: right;
}

.dataTables_wrapper.crm-datatable .dataTables_filter input,
.dataTables_wrapper.crm-datatable .dataTables_length select {
    margin-left: 0 !important;
    border-color: #d9e2ef;
    box-shadow: none !important;
}

.dataTables_wrapper.crm-datatable .dataTables_filter input {
    width: min(100%, 280px);
}

.dataTables_wrapper.crm-datatable .dataTables_length select {
    width: 84px;
    padding-right: 2rem;
}

.dataTables_wrapper.crm-datatable .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dataTables_wrapper.crm-datatable .dt-buttons .btn {
    min-height: 40px;
    border-radius: 12px !important;
    padding-inline: 0.85rem !important;
    font-weight: 600;
}

.dataTables_wrapper.crm-datatable .dataTables_processing {
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    background: #ffffff;
    color: #334155;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.10);
}

.dataTables_wrapper.crm-datatable .row:last-child {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eef2f7;
    align-items: center;
    row-gap: 0.85rem;
}

.dataTables_wrapper.crm-datatable div.dataTables_info {
    color: #64748b;
    font-size: 0.84rem;
}

.dataTables_wrapper.crm-datatable div.dataTables_paginate {
    margin-top: 0;
}

.dataTables_wrapper.crm-datatable .pagination {
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-end;
}

.dataTables_wrapper.crm-datatable .page-item .page-link {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px !important;
    border: 1px solid #d9e2ef;
    color: #334155;
    background: #ffffff;
}

.dataTables_wrapper.crm-datatable .page-item.active .page-link,
.dataTables_wrapper.crm-datatable .page-item.active .page-link:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.dataTables_wrapper.crm-datatable .page-item.disabled .page-link {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.dataTables_wrapper.crm-datatable .page-item:not(.active):not(.disabled) .page-link:hover {
    color: #0f172a;
    background: #f8fafc;
    border-color: #cbd5e1;
}

@media (max-width: 991px) {
    .crm-content-wrap {
        padding: 1.2rem 1rem 1.75rem;
    }

    .crm-page-hero-soft,
    .crm-page-hero-leads {
        min-height: auto;
    }

    .dataTables_wrapper.crm-datatable .dataTables_filter {
        text-align: left;
    }

    .dataTables_wrapper.crm-datatable .dataTables_filter input {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .crm-module-card__header,
    .crm-table-card__header,
    .crm-form-card__header {
        min-height: auto;
    }

    .crm-page-hero-soft__actions,
    .crm-page-hero__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .crm-page-hero-soft__actions .btn,
    .crm-page-hero__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .crm-table-modern thead th,
    .table-leads thead th,
    .crm-table-modern tbody td,
    .table-leads tbody td {
        white-space: nowrap;
    }

    .dataTables_wrapper.crm-datatable .dataTables_length label,
    .dataTables_wrapper.crm-datatable .dataTables_filter label {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
    }

    .dataTables_wrapper.crm-datatable .row:last-child {
        text-align: center;
    }

    .dataTables_wrapper.crm-datatable .pagination {
        justify-content: center;
    }
}

/* Ajustes visuales v10 · Bloque B */
.crm-form-shell--page {
    gap: 1.35rem;
}

.crm-form-card__body {
    padding: 1.35rem;
}

.crm-form-shell .form-label,
.crm-auth-card .form-label,
.modal-content .form-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
}

.crm-form-shell .form-control,
.crm-form-shell .form-select,
.crm-auth-card .form-control,
.modal-content .form-control,
.modal-content .form-select {
    min-height: 32px;
    border-radius: 14px;
    border: 1px solid #d9e2ef;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.crm-form-shell textarea.form-control,
.modal-content textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.crm-form-shell .form-control:focus,
.crm-form-shell .form-select:focus,
.crm-auth-card .form-control:focus,
.modal-content .form-control:focus,
.modal-content .form-select:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14) !important;
}

.crm-form-shell .form-check-input,
.modal-content .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
}

.crm-form-shell .invalid-feedback,
.modal-content .invalid-feedback {
    font-size: 0.8rem;
}

.crm-form-shell .alert,
.crm-auth-card .alert,
.crm-alert-stack .alert {
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 0.95rem 1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.crm-form-shell .alert-danger,
.crm-auth-card .alert-danger,
.crm-alert-stack .alert-danger {
    background: #fff5f5;
    border-color: #fecaca;
    color: #991b1b;
}

.crm-form-shell .alert-success,
.crm-alert-stack .alert-success {
    background: #effcf5;
    border-color: #bbf7d0;
    color: #166534;
}

.crm-form-shell .alert-warning,
.crm-alert-stack .alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.crm-alert-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.crm-alert-stack .alert {
    margin-bottom: 0;
}

.crm-form-actions--sticky {
    position: sticky;
    bottom: 0.75rem;
    z-index: 5;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(217, 226, 239, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.crm-form-actions--compact {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    justify-content: flex-start;
}

.crm-form-actions--compact .btn {
    min-width: 0;
}

.crm-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.crm-modal-actions .btn {
    min-width: 138px;
    justify-content: center;
}

.crm-template-modal-dialog,
.crm-template-preview-dialog {
    --bs-modal-width: min(1160px, calc(100vw - 2rem));
}

.crm-template-modal,
.crm-template-preview-modal,
.crm-sim-modal {
    border-radius: 28px;
    border: 1px solid #e6edf5;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
}

.crm-template-modal__header,
.crm-sim-modal__header,
.crm-template-preview-modal .modal-header {
    padding: 1.45rem 1.6rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.crm-template-modal__body,
.crm-template-preview-modal__body,
.crm-sim-modal__body {
    padding: 0 1.6rem 1.4rem;
}

.crm-template-modal__footer,
.crm-sim-modal__footer {
    padding: 0 1.6rem 1.4rem;
    border-top: 1px solid #edf2f7;
}

.crm-template-modal .crm-check-grid {
    grid-template-columns: minmax(0, 1fr);
}

.crm-template-modal textarea.form-control {
    min-height: 360px;
}

.crm-preview-frame {
    min-height: min(68vh, 680px);
}

.crm-btn-emphasis {
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.18);
}

.crm-page-hero-soft__actions,
.crm-page-hero__actions {
    row-gap: 0.75rem;
}

@media (max-width: 991.98px) {
    .crm-content-wrap {
        padding: 1.15rem 1rem 1.6rem;
    }

    .crm-form-card__body,
    .crm-template-modal__body,
    .crm-template-preview-modal__body,
    .crm-sim-modal__body {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .crm-template-modal__header,
    .crm-sim-modal__header,
    .crm-template-preview-modal .modal-header,
    .crm-template-modal__footer,
    .crm-sim-modal__footer {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .crm-form-actions--sticky {
        bottom: 0;
        border-radius: 18px;
    }
}

@media (max-width: 767.98px) {
    .crm-content-wrap {
        padding: 1rem 0.85rem 1.4rem;
    }

    .crm-page-hero-soft,
    .crm-page-hero-leads,
    .crm-page-hero {
        min-height: auto;
        padding: 1.2rem;
    }

    .crm-page-hero-soft__actions,
    .crm-page-hero__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .crm-page-hero-soft__actions .btn,
    .crm-page-hero__actions .btn,
    .crm-form-actions .btn,
    .crm-modal-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .crm-form-actions--sticky {
        position: static;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .crm-template-modal__body,
    .crm-template-preview-modal__body,
    .crm-sim-modal__body,
    .crm-form-card__body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .crm-template-modal__header,
    .crm-sim-modal__header,
    .crm-template-preview-modal .modal-header,
    .crm-template-modal__footer,
    .crm-sim-modal__footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .crm-template-modal textarea.form-control {
        min-height: 280px;
    }

    .crm-preview-frame {
        min-height: 56vh;
    }
}


/* v11 hero unification */
.crm-page-hero-soft,
.crm-page-hero-leads,
.crm-page-hero {
    background: linear-gradient(135deg, #111827 0%, #1e293b 48%, #0f172a 100%);
    border-radius: 24px;
    padding: 1.75rem;
    color: #fff;
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
}

.crm-page-hero-soft::after,
.crm-page-hero-leads::after,
.crm-page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(59,130,246,0.16), transparent 34%);
    pointer-events: none;
}

.crm-page-hero-soft > *,
.crm-page-hero-leads > *,
.crm-page-hero > * {
    position: relative;
    z-index: 1;
}

.crm-page-hero-soft {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
}

.crm-page-hero-soft__eyebrow,
.crm-page-hero__eyebrow {
    color: rgba(255,255,255,0.62);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.crm-page-hero-soft__title,
.crm-page-hero__title {
    color: #fff;
    font-size: clamp(1.7rem, 2.8vw, 2.3rem);
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.crm-page-hero-soft__text,
.crm-page-hero__text {
    color: rgba(255,255,255,0.74);
    margin: 0;
    max-width: 760px;
}

.crm-page-hero-soft__actions,
.crm-page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    justify-content: flex-end;
}

.crm-page-hero-soft__actions .btn,
.crm-page-hero__actions .btn,
.crm-page-hero-soft__actions .btn.btn-primary,
.crm-page-hero__actions .btn.btn-primary,
.crm-page-hero-soft__actions .btn.btn-outline-secondary,
.crm-page-hero__actions .btn.btn-outline-secondary {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.crm-page-hero-soft__actions .btn i,
.crm-page-hero__actions .btn i {
    margin: 0 !important;
    font-size: 1rem;
}

.crm-page-hero-soft__actions .btn .crm-hero-btn-label,
.crm-page-hero__actions .btn .crm-hero-btn-label {
    display: none;
}

@media (max-width: 991px) {
    .crm-page-hero-soft,
    .crm-page-hero-leads,
    .crm-page-hero {
        grid-template-columns: 1fr;
        padding: 1.35rem;
    }

    .crm-page-hero-soft__actions,
    .crm-page-hero__actions {
        justify-content: flex-start;
    }
}


/* Compact page headers */
.crm-page-hero-soft,
.crm-page-hero-leads,
.crm-page-hero {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0;
    box-shadow: none !important;
    border-radius: 22px;
    min-height: auto;
    padding: 1.1rem 1.35rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.crm-page-hero-soft::after,
.crm-page-hero-leads::after,
.crm-page-hero::after {
    display: none !important;
}

.crm-page-hero-soft > :first-child,
.crm-page-hero-leads > :first-child,
.crm-page-hero > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.crm-page-hero-soft__eyebrow,
.crm-page-hero__eyebrow,
.crm-page-hero-soft__text,
.crm-page-hero__text,
.crm-page-mini-stats,
.crm-page-hero__stats {
    display: none !important;
}

.crm-page-hero-soft__title,
.crm-page-hero__title {
    color: #0f172a !important;
    font-size: clamp(1.45rem, 2vw, 2rem);
    line-height: 1.15;
    margin: 0 !important;
}

.crm-page-hero-soft__actions,
.crm-page-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.crm-page-hero-soft__actions .btn,
.crm-page-hero__actions .btn,
.crm-page-hero-soft__actions a.btn,
.crm-page-hero__actions a.btn {
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0 !important;
    border-radius: 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}

.crm-page-hero-soft__actions .btn.btn-primary,
.crm-page-hero__actions .btn.btn-primary,
.crm-page-hero-soft__actions a.btn.btn-primary,
.crm-page-hero__actions a.btn.btn-primary {
    background: #0f172a;
    border-color: #0f172a;
}

.crm-page-hero-soft__actions .btn.btn-outline-secondary,
.crm-page-hero__actions .btn.btn-outline-secondary,
.crm-page-hero-soft__actions a.btn.btn-outline-secondary,
.crm-page-hero__actions a.btn.btn-outline-secondary {
    background: #ffffff;
    border-color: #d7dee8;
    color: #334155;
}

.crm-page-hero-soft__actions .btn.crm-hero-keep-label,
.crm-page-hero__actions .btn.crm-hero-keep-label,
.crm-page-hero-soft__actions a.btn.crm-hero-keep-label,
.crm-page-hero__actions a.btn.crm-hero-keep-label {
    width: auto;
    min-width: 46px;
    padding: 0.7rem 0.95rem !important;
    gap: 0.4rem;
}

.crm-page-hero-soft__actions .btn i,
.crm-page-hero__actions .btn i {
    margin: 0 !important;
}

@media (max-width: 991.98px) {
    .crm-page-hero-soft,
    .crm-page-hero-leads,
    .crm-page-hero {
        padding: 1rem 1.1rem !important;
    }
}

@media (max-width: 767.98px) {
    .crm-page-hero-soft,
    .crm-page-hero-leads,
    .crm-page-hero {
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
        padding: 0.95rem 1rem !important;
    }

    .crm-page-hero-soft__title,
    .crm-page-hero__title {
        font-size: 1.45rem;
    }

    .crm-page-hero-soft__actions,
    .crm-page-hero__actions {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .crm-page-hero-soft__actions .btn,
    .crm-page-hero__actions .btn,
    .crm-page-hero-soft__actions a.btn,
    .crm-page-hero__actions a.btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
    }

    .crm-page-hero-soft__actions .btn.crm-hero-keep-label,
    .crm-page-hero__actions .btn.crm-hero-keep-label,
    .crm-page-hero-soft__actions a.btn.crm-hero-keep-label,
    .crm-page-hero__actions a.btn.crm-hero-keep-label {
        padding-inline: 0.8rem !important;
    }
}


/* v13 hero compact without background */
.crm-page-hero-soft,
.crm-page-hero-leads,
.crm-page-hero {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0.25rem 0 0.85rem !important;
    min-height: auto !important;
    gap: 0.6rem !important;
}

.crm-page-hero-soft::after,
.crm-page-hero-leads::after,
.crm-page-hero::after {
    display: none !important;
}

.crm-page-hero-soft__eyebrow,
.crm-page-hero__eyebrow,
.crm-page-hero-soft__text,
.crm-page-hero__text,
.crm-page-mini-stats,
.crm-page-hero__stats {
    display: none !important;
}

.crm-page-hero-soft__title,
.crm-page-hero__title {
    color: #0f172a !important;
    font-size: 20px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    margin: 0 !important;
}

.crm-page-hero-soft__actions,
.crm-page-hero__actions {
    gap: 0.5rem !important;
    align-items: center !important;
}

.crm-page-hero-soft__actions .btn,
.crm-page-hero__actions .btn,
.crm-page-hero-soft__actions a.btn,
.crm-page-hero__actions a.btn,
.crm-page-hero-soft__actions .btn.crm-hero-keep-label,
.crm-page-hero__actions .btn.crm-hero-keep-label,
.crm-page-hero-soft__actions a.btn.crm-hero-keep-label,
.crm-page-hero__actions a.btn.crm-hero-keep-label {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 12px !important;
    font-size: 0 !important;
}

.crm-page-hero-soft__actions .btn i,
.crm-page-hero__actions .btn i,
.crm-page-hero-soft__actions a.btn i,
.crm-page-hero__actions a.btn i {
    font-size: 1rem !important;
    margin: 0 !important;
}

.crm-page-hero-soft__actions .btn .crm-hero-btn-label,
.crm-page-hero__actions .btn .crm-hero-btn-label,
.crm-page-hero-soft__actions .btn span:not(.spinner-border):not(.spinner-grow),
.crm-page-hero__actions .btn span:not(.spinner-border):not(.spinner-grow),
.crm-page-hero-soft__actions a.btn span,
.crm-page-hero__actions a.btn span {
    display: none !important;
}

@media (max-width: 767.98px) {
    .crm-page-hero-soft,
    .crm-page-hero-leads,
    .crm-page-hero {
        padding: 0.15rem 0 0.75rem !important;
        gap: 0.45rem !important;
    }

    .crm-page-hero-soft__title,
    .crm-page-hero__title {
        font-size: 20px !important;
    }

    .crm-page-hero-soft__actions .btn,
    .crm-page-hero__actions .btn,
    .crm-page-hero-soft__actions a.btn,
    .crm-page-hero__actions a.btn {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
    }
}


/* v14 hero tighter spacing + square action buttons */
.crm-page-hero-soft,
.crm-page-hero-leads,
.crm-page-hero {
    padding: 0.1rem 0 0.45rem !important;
    gap: 0.35rem !important;
}

.crm-page-hero-soft.mb-4,
.crm-page-hero-leads.mb-4,
.crm-page-hero.mb-4 {
    margin-bottom: 0.45rem !important;
}

.crm-page-hero-soft__actions,
.crm-page-hero__actions {
    gap: 0.35rem !important;
}

.crm-page-hero-soft__actions .btn,
.crm-page-hero__actions .btn,
.crm-page-hero-soft__actions a.btn,
.crm-page-hero__actions a.btn,
.crm-page-hero-soft__actions .btn.crm-hero-keep-label,
.crm-page-hero__actions .btn.crm-hero-keep-label,
.crm-page-hero-soft__actions a.btn.crm-hero-keep-label,
.crm-page-hero__actions a.btn.crm-hero-keep-label {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
}

.crm-module-card:first-of-type,
.crm-filter-card:first-of-type,
.crm-table-card:first-of-type,
.card-crm:first-of-type {
    margin-top: 0 !important;
}

@media (max-width: 767.98px) {
    .crm-page-hero-soft,
    .crm-page-hero-leads,
    .crm-page-hero {
        padding: 0.05rem 0 0.35rem !important;
        gap: 0.25rem !important;
    }

    .crm-page-hero-soft.mb-4,
    .crm-page-hero-leads.mb-4,
    .crm-page-hero.mb-4 {
        margin-bottom: 0.35rem !important;
    }

    .crm-page-hero-soft__actions .btn,
    .crm-page-hero__actions .btn,
    .crm-page-hero-soft__actions a.btn,
    .crm-page-hero__actions a.btn {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
    }
}


/* Ajustes v15 */
:root {
    --crm-control-height: 32px;
    --crm-control-radius: 10px;
}

.crm-shell .btn:not(.btn-close),
.modal .btn:not(.btn-close),
.dataTables_wrapper .dt-buttons .btn {
    min-height: var(--crm-control-height);
    height: var(--crm-control-height);
    padding: 0.25rem 0.75rem !important;
    border-radius: var(--crm-control-radius) !important;
    font-size: 0.84rem;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.crm-shell .btn.btn-sm:not(.btn-close),
.modal .btn.btn-sm:not(.btn-close),
.crm-action-group .btn,
.crm-table-modern .btn.btn-sm,
.crm-page-hero-soft__actions .btn,
.crm-page-hero__actions .btn,
.crm-page-hero-soft__actions a.btn,
.crm-page-hero__actions a.btn {
    min-width: var(--crm-control-height);
    width: auto;
    height: var(--crm-control-height);
}

.crm-action-group .btn,
.crm-table-modern .btn.btn-sm {
    width: var(--crm-control-height);
    padding: 0 !important;
}

.form-control:not(textarea):not(.form-control-color),
.form-select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: var(--crm-control-height);
    height: var(--crm-control-height);
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    border-radius: var(--crm-control-radius);
    font-size: 0.84rem;
}

.form-control.form-control-sm,
.form-select.form-select-sm {
    min-height: var(--crm-control-height);
    height: var(--crm-control-height);
}

textarea.form-control {
    min-height: 96px;
}

.select2-container .select2-selection--single {
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    border-radius: var(--crm-control-radius) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(var(--crm-control-height) - 2px) !important;
    padding-left: 0.75rem !important;
    padding-right: 2rem !important;
    font-size: 0.84rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--crm-control-height) - 2px) !important;
    right: 8px !important;
}

.select2-container .select2-selection--multiple {
    min-height: var(--crm-control-height) !important;
    border-radius: var(--crm-control-radius) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
    min-height: calc(var(--crm-control-height) - 2px);
    padding: 0 0.35rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 0 !important;
    font-size: 0.78rem;
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 2rem);
}

.modal-dialog-scrollable .modal-body,
.modal-dialog-scrollable .crm-lead-modal__body,
.modal-dialog-scrollable .crm-email-modal__body,
.modal-dialog-scrollable .crm-history-modal__body,
.modal-dialog-scrollable .crm-template-modal__body,
.modal-dialog-scrollable .crm-template-preview-modal__body,
.modal-dialog-scrollable .crm-sim-modal__body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-dialog .modal-content {
    display: flex;
    flex-direction: column;
}

.modal-dialog .modal-content > form,
.modal-dialog .crm-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.modal-dialog .modal-content > form .modal-body,
.modal-dialog .crm-modal-form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

.modal-dialog:not(.modal-dialog-scrollable) .modal-body {
    max-height: min(70vh, 720px);
    overflow-y: auto;
}

.card-crm.crm-module-card > .card-body:first-child,
.card-crm:not(.crm-filter-card):not(.crm-table-card) > .card-body:first-child {
    padding-top: 1.05rem;
}


/* v16 email tables + modal scrolling */
.crm-table-like-tags thead th {
    background: #f8fafc;
}

.crm-table-like-tags tbody td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.crm-cell-stack--tight {
    gap: 0;
}

.crm-badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.34rem 0.62rem !important;
    border-radius: 999px !important;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #475569;
    font-weight: 600 !important;
    font-size: 0.74rem;
    line-height: 1;
}

.crm-badge-soft--success {
    background: #ecfdf3;
    border-color: #b7ebca;
    color: #166534;
}

.crm-badge-soft--warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.crm-template-modal > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.modal-dialog-scrollable .crm-template-modal > form {
    max-height: inherit;
}

.crm-template-modal__body,
.crm-template-preview-modal__body,
.crm-sim-modal__body {
    flex: 1 1 auto;
    min-height: 0;
}

.crm-template-modal textarea.form-control {
    min-height: 300px;
}

.crm-template-modal .tox.tox-tinymce {
    border-radius: 16px;
    overflow: hidden;
}

.crm-unit-tabs {
    border-bottom: 1px solid #e7edf5;
    gap: 0.35rem;
}

.crm-unit-tabs .nav-link {
    border: 0;
    border-radius: 999px;
    color: #64748b;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
}

.crm-unit-tabs .nav-link.active {
    background: #0f172a;
    color: #fff;
}

.crm-unit-operation-form .crm-form-card {
    margin-bottom: 0;
}

.crm-unit-operation-form .select2-container .select2-selection--single,
.crm-unit-operation-form .select2-container .select2-selection--multiple {
    min-height: 32px;
}

.crm-unit-operation-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px;
}

.crm-unit-operation-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 30px;
}


.crm-info-list {
    display: grid;
    gap: 0.9rem;
}
.crm-info-list__item {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #e5ebf3;
    border-radius: 14px;
    background: #f8fafc;
}
.crm-info-list__label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
.crm-info-list__value {
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.35;
}
.crm-code-textarea {
    min-height: 520px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
}


.crm-unit-comment-preview__text {
    font-size: 0.85rem;
    color: #111827;
    line-height: 1.35;
}

.crm-unit-comment-preview__meta {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: #6b7280;
}

.crm-unit-observations-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.crm-unit-observation-item {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    background: #fff;
    padding: 0.875rem 1rem;
}

.crm-unit-observation-item__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    color: #64748b;
}

.crm-unit-observation-item__text {
    white-space: pre-wrap;
    color: #111827;
    font-size: 0.9rem;
    line-height: 1.45;
}
