.item-pin {
    border: 2px solid #28a745;
    background: rgba(144, 238, 144, .25);
}

.app-title {
    margin-left: 0.75rem;
    color: #ffffff;
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.2;
    display: inline-block;
}

@media (max-width: 576px) {
    .app-title {
        font-size: 0.95rem;
        margin-left: 0.5rem;
        max-width: 220px;
    }
}

.reminder-soon {
    background: rgba(255,193,7,.15);
}

.reminder-overdue {
    background: rgba(220,53,69,.12);
}

/* === Indicadores diarios globales === */
.crm-indicators-bar {
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid #d7e3f3;
    background: #eef5ff;
    color: #223044;
    font-size: .82rem;
}

.crm-indicators-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .25rem .9rem;
    min-height: 24px;
    padding: .15rem 0;
}

.crm-indicators-title {
    font-weight: 700;
    color: #0b5ed7;
}

.crm-indicator-item {
    font-weight: 600;
}

.crm-indicator-meta {
    color: #607086;
    font-size: .82rem;
}

.crm-indicators-bar.is-error {
    border-bottom-color: #f1c2c6;
    background: #fff3f4;
}

.crm-indicators-bar.is-error .crm-indicators-title,
.crm-indicators-bar.is-error .crm-indicator-item {
    color: #842029;
}

/* === Solicitudes === */
.solicitudes-chat {
    max-height: 300px;
    overflow-y: auto;
    padding: .85rem;
    border: 1px solid #d6e6dc;
    border-radius: 8px;
    background: #eef7f0;
}

.solicitudes-chat-message {
    display: flex;
    margin-bottom: .75rem;
}

.solicitudes-chat-message:last-child {
    margin-bottom: 0;
}

.solicitudes-chat-message.is-mine {
    justify-content: flex-end;
}

.solicitudes-chat-bubble {
    max-width: min(86%, 620px);
    padding: .7rem .85rem;
    border: 1px solid #dfe8e2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .05);
}

.solicitudes-chat-message.is-admin .solicitudes-chat-bubble {
    border-color: #dfe8e2;
    background: #fff;
}

.solicitudes-chat-message.is-mine .solicitudes-chat-bubble {
    border-color: #8fd7a8;
    background: #c9f7d4;
}

.solicitudes-chat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .35rem;
    color: #607086;
    font-size: .78rem;
}

.solicitudes-chat-text {
    white-space: pre-wrap;
    color: #212529;
}

/* === Costeo Servicios === */
.cotizar-module {
    --cotizar-accent: #0d6efd;
    --cotizar-soft: #f4f8ff;
    --cotizar-border: #d9e2ef;
}

.cotizar-page-head {
    padding-bottom: .25rem;
}

.cotizar-flash {
    border-radius: 8px;
}

.cotizar-filter-card,
.cotizar-list-card,
.cotizar-section,
.cotizar-detail-hero,
.cotizar-summary-card,
.cotizar-bottom-actions {
    border: 1px solid var(--cotizar-border);
    border-radius: 8px;
}

.cotizar-section {
    border-left: 4px solid var(--cotizar-accent);
}

.cotizar-section .card-body,
.cotizar-summary-card .card-body,
.cotizar-detail-hero .card-body {
    padding: 1.25rem;
}

.cotizar-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cotizar-section-head.compact {
    margin-bottom: .75rem;
}

.cotizar-section-kicker {
    display: block;
    color: #5f6f86;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .15rem;
}

.cotizar-form-actions,
.cotizar-detail-actions,
.cotizar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

.cotizar-bottom-actions .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--cotizar-soft);
}

.cotizar-edit-table th,
.cotizar-table th {
    color: #243145;
    font-size: .86rem;
    white-space: nowrap;
    background: #f8fafc;
}

.cotizar-edit-table td,
.cotizar-table td {
    vertical-align: middle;
}

.cotizar-edit-table input,
.cotizar-edit-table select {
    min-width: 110px;
}

.cotizar-table .cotizar-client-cell {
    min-width: 170px;
}

.cotizar-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.cotizar-status.is-final {
    color: #0f5132;
    background: #d1e7dd;
}

.cotizar-status.is-draft {
    color: #664d03;
    background: #fff3cd;
}

.cotizar-summary-card {
    border-left: 4px solid #198754;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.cotizar-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.cotizar-summary-item {
    display: flex;
    min-height: 96px;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border: 1px solid var(--cotizar-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

.cotizar-summary-item .small {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.cotizar-summary-item [data-summary] {
    line-height: 1.15;
    color: #111827;
}

.cotizar-summary-item.is-total {
    grid-column: span 3;
    color: #fff;
    min-height: 118px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-color: #0a58ca;
    box-shadow: 0 14px 30px rgba(13, 110, 253, .22);
}

.cotizar-summary-item.is-total .text-muted {
    color: rgba(255,255,255,.78) !important;
}

.cotizar-summary-item.is-total [data-summary] {
    color: #fff;
    font-size: 1.85rem !important;
}

.cotizar-total-value {
    color: #0d6efd;
}

.cotizar-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
}

.cotizar-detail-meta > div {
    padding: .8rem;
    border: 1px solid var(--cotizar-border);
    border-radius: 8px;
    background: #fff;
}

.cotizar-detail-meta span {
    display: block;
    color: #6c757d;
    font-size: .8rem;
    margin-bottom: .2rem;
}

.cotizar-detail-list dt,
.cotizar-detail-list dd {
    padding-top: .25rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid #eef2f7;
}

.cotizar-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
}

.cotizar-suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid var(--cotizar-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}

.cotizar-suggestion-item {
    display: block;
    width: 100%;
    padding: .55rem .75rem;
    color: #212529;
    background: #fff;
    border: 0;
    text-align: left;
}

.cotizar-suggestion-item:hover,
.cotizar-suggestion-item:focus {
    background: var(--cotizar-soft);
    outline: 0;
}

.cotizar-table tr.cotizar-row-highlight {
    position: relative;
    animation: cotizarSavedPulse 1.8s ease-out 1;
}

.cotizar-table tr.cotizar-row-highlight > * {
    background-color: transparent !important;
}

.cotizar-table tr.cotizar-row-highlight.is-settled {
    transition: background-color .5s ease, box-shadow .5s ease;
    background-color: transparent;
    box-shadow: none;
}

@keyframes cotizarSavedPulse {
    0% {
        background-color: #e7f1ff;
        box-shadow: inset 0 0 0 2px rgba(13,110,253,.28), 0 0 0 0 rgba(13,110,253,.18);
    }
    28% {
        background-color: #eef6ff;
        box-shadow: inset 0 0 0 2px rgba(13,110,253,.22), 0 0 0 5px rgba(13,110,253,.08);
    }
    62% {
        background-color: #f7fbff;
        box-shadow: inset 0 0 0 1px rgba(13,110,253,.12), 0 0 0 2px rgba(13,110,253,.03);
    }
    100% {
        background-color: transparent;
        box-shadow: inset 0 0 0 rgba(13,110,253,0), 0 0 0 0 rgba(13,110,253,0);
    }
}

.cotizar-module .form-control:focus,
.cotizar-module .form-select:focus {
    border-color: rgba(13,110,253,.55);
    box-shadow: 0 0 0 .18rem rgba(13,110,253,.12);
}

@media (max-width: 768px) {
    .cotizar-summary-grid {
        grid-template-columns: 1fr;
    }
    .cotizar-summary-item.is-total {
        grid-column: span 1;
    }
    .cotizar-bottom-actions .card-body,
    .cotizar-section-head {
        align-items: stretch;
        flex-direction: column;
    }
}

/* === Trabajos board (scoped) === */
.trabajos-board {
    --trabajos-blue: #0073EA;
    --trabajos-purple: #A25DDC;
    --trabajos-green: #00C875;
    --trabajos-orange: #FDAB3D;
    --trabajos-red: #E2445C;
    --trabajos-gray: #eef1f6;
}

.trabajos-board-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.trabajos-tabs-wrapper {
    overflow-x: auto;
}

.trabajos-tabs {
    display: inline-flex;
    gap: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.trabajos-tab {
    border: 1px solid transparent;
    background: transparent;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.trabajos-tab.active {
    background: #f1f5ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.trabajos-tab-add {
    font-size: 1.25rem;
    padding: 0.15rem 0.6rem;
}

.trabajos-month-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.trabajos-month-label {
    font-weight: 600;
    text-transform: capitalize;
    min-width: 140px;
    text-align: center;
}

.trabajos-categoria-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f8fafc;
    border: 1px solid #d6e0eb;
    border-radius: 999px;
    padding: 0.2rem;
}

.trabajos-categoria-btn {
    border: 0;
    background: transparent;
    color: #334155;
    border-radius: 999px;
    padding: 0.32rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.trabajos-categoria-btn:hover {
    background: #eaf2ff;
    color: #1d4ed8;
}

.trabajos-categoria-btn.active {
    background: #1d4ed8;
    color: #ffffff;
}

.trabajos-group {
    margin-bottom: 1.5rem;
}

.trabajos-section {
    margin-bottom: 1.5rem;
}

.trabajos-section-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.trabajos-completed-toggle {
    font-weight: 600;
    padding: 0;
}

.trabajos-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
}

.trabajos-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.trabajos-group-pill {
    width: 0.5rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--grupo-color, var(--trabajos-blue));
    display: inline-block;
}

.trabajos-grid-header,
.trabajos-row {
    display: grid;
    grid-template-columns: 36px minmax(200px, 2fr) 120px 140px 180px 120px 140px;
    gap: 0.5rem;
    align-items: center;
}

.trabajos-grid-header {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 0 0.5rem 0.5rem;
}

.trabajos-row {
    padding: 0.65rem 0.5rem;
    border-radius: 0.6rem;
    border: 1px solid #d8e0ea;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    background: #fff;
    cursor: pointer;
}

.trabajos-row.trabajos-row-colored {
    border-left: 8px solid var(--trabajo-card-color);
}

.trabajos-row + .trabajos-row {
    margin-top: 0.35rem;
}

.trabajos-row:hover {
    border-color: #aebfd3;
    background: #f8fbff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    transform: translateY(-1px);
}

.trabajos-row.dragging {
    opacity: 0.6;
}

.trabajos-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trabajos-control {
    cursor: default;
}

.trabajos-title {
    font-weight: 600;
    min-height: 1.5rem;
    outline: none;
}

.trabajos-client-subtitle {
    font-size: 0.82rem;
    line-height: 1.25;
    color: #64748b;
    margin-top: 0.1rem;
    word-break: break-word;
}

.trabajos-handle {
    cursor: grab;
    font-size: 1.1rem;
    color: #94a3b8;
}

.trabajos-handle:active {
    cursor: grabbing;
}

.trabajos-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #cbd5f5;
    background: #eff6ff;
    font-weight: 700;
    color: #1e3a8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.trabajos-assignees-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.trabajos-assignees {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.trabajos-workload {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trabajos-search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trabajos-search-row {
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.trabajos-search-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.trabajos-search-title {
    font-weight: 600;
}

.trabajos-client-subtitle--search {
    margin-top: 0.15rem;
}

.trabajos-calendar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trabajos-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.trabajos-calendar-controls {
    display: flex;
    gap: 0.35rem;
}

.trabajos-calendar-title {
    font-weight: 700;
    text-transform: capitalize;
}

.trabajos-calendar-legend {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.8rem;
    color: #475569;
}

.trabajos-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.trabajos-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.trabajos-legend-dot.legend-current {
    background: var(--trabajos-blue);
}

.trabajos-legend-dot.legend-next {
    background: var(--trabajos-purple);
}

.trabajos-calendar-mode {
    max-width: 120px;
}

.trabajos-calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.trabajos-calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.trabajos-calendar-header-cell {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    padding: 0.4rem 0;
}

.trabajos-calendar-week {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.trabajos-calendar-cell {
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    min-height: 110px;
    padding: 0.35rem;
    background: #fff;
    position: relative;
}

.trabajos-calendar-cell.muted {
    background: #f8fafc;
    color: #94a3b8;
}

.trabajos-calendar-date {
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 0.25rem;
}

.trabajos-calendar-lanes {
    position: absolute;
    left: 0;
    right: 0;
    top: 26px;
    height: 78px;
    pointer-events: none;
}

.trabajos-calendar-bar {
    position: absolute;
    height: 22px;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.75rem;
    padding: 0 0.4rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    pointer-events: auto;
    border: none;
}

.trabajos-calendar-bar span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trabajos-calendar-bar.start {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.trabajos-calendar-bar.end {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.trabajos-calendar-bar.continuation-start {
    border-top-left-radius: 0.2rem;
    border-bottom-left-radius: 0.2rem;
}

.trabajos-calendar-bar.continuation-end {
    border-top-right-radius: 0.2rem;
    border-bottom-right-radius: 0.2rem;
}

.trabajos-calendar-more {
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-size: 0.75rem;
    padding: 0;
    margin-top: 0.2rem;
}

@media (max-width: 768px) {
    .trabajos-calendar-cell {
        min-height: 90px;
    }
    .trabajos-calendar-lanes {
        top: 22px;
    }
    .trabajos-client-subtitle {
        font-size: 0.78rem;
    }
}

.trabajos-workload-row {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
}

.trabajos-workload-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.trabajos-workload-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trabajos-chip {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
    cursor: pointer;
    text-align: left;
}

.trabajos-chip-title {
    font-weight: 600;
}

.trabajos-client-subtitle--chip {
    margin-top: 0;
    font-size: 0.72rem;
}

.trabajos-chip-meta {
    font-size: 0.7rem;
    color: #64748b;
}

.trabajos-avatar.small {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.trabajos-status {
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    min-width: 110px;
}

.trabajos-progress {
    position: relative;
    height: 22px;
    background: var(--trabajos-gray);
    border-radius: 999px;
    overflow: hidden;
    width: 100%;
}

.trabajos-progress span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.trabajos-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0073EA, #5aa7ff);
    border-radius: 999px;
}

.trabajos-drop-placeholder {
    background: rgba(148, 163, 184, 0.12);
    border: 2px dashed #94a3b8;
    border-radius: 0.6rem;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin: 0.35rem 0;
}

.trabajos-avatars {
    display: inline-flex;
    align-items: center;
}

.trabajos-avatar-stack {
    margin-left: -8px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e2e8f0;
}

.trabajos-avatar-stack:first-child {
    margin-left: 0;
}

.trabajos-avatar-stack.extra {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
}

.trabajos-remove-assignee {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 999px;
    background: #fee2e2;
    color: #ef4444;
    font-size: 0.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.trabajos-avatar.assignee {
    position: relative;
}

.trabajos-date {
    max-width: 120px;
}

.trabajos-date-label {
    font-size: 0.85rem;
    color: #475569;
}

.trabajos-client-combobox {
    position: relative;
}

.trabajos-client-combobox .input-group .btn {
    min-width: 2.5rem;
}

.trabajos-client-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
    z-index: 1060;
}

.trabajos-client-option {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.trabajos-client-option:hover,
.trabajos-client-option.active {
    background: #eaf2ff;
    color: #0b4bb3;
}

.trabajos-client-empty {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    color: #64748b;
}

.trabajos-stars {
    display: flex;
    gap: 0.15rem;
    cursor: pointer;
    font-size: 1.05rem;
}

.trabajos-star {
    color: #cbd5e1;
    transition: color 0.2s ease;
}

.trabajos-star.active {
    color: #f59e0b;
}

.trabajos-mobile-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

.trabajos-kanban-vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trabajos-kanban-lane {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
    align-items: start;
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    outline: 0 solid transparent;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, outline-color 0.18s ease, outline-width 0.18s ease;
}

.trabajos-kanban-lane.is-drop-target {
    background: #e8f1ff;
    border-color: #3b82f6;
    outline: 3px solid rgba(59, 130, 246, 0.55);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.35), 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.trabajos-kanban-header {
    font-weight: 700;
    border-left: 4px solid var(--estado-color, var(--trabajos-blue));
    padding-left: 0.5rem;
    min-height: 2.25rem;
    display: flex;
    align-items: center;
}

.trabajos-kanban-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-items: start;
}

.trabajos-kanban-card {
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    min-height: auto;
    background: #ffffff;
    border-radius: 0.65rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}

.trabajos-kanban-card.trabajos-kanban-card-colored {
    border-left: 8px solid var(--trabajo-card-color);
}

.trabajos-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.trabajos-color-option {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem 0.2rem 0.35rem;
}

.trabajos-color-option.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.trabajos-color-swatch-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--swatch, #64748b);
    border: 1px solid rgba(15, 23, 42, 0.18);
}

.trabajos-color-none-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
    color: #64748b;
}

.trabajos-kanban-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.trabajos-kanban-card .trabajos-client-subtitle {
    margin-bottom: 0.35rem;
}

.trabajos-kanban-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
    .trabajos-kanban-lane {
        grid-template-columns: 1fr;
    }
}


.trabajos-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-x: auto;
}

.trabajos-timeline-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 1rem;
}

.trabajos-timeline-label {
    font-weight: 600;
}

.trabajos-timeline-track {
    position: relative;
    height: 24px;
    background: #f1f5f9;
    border-radius: 999px;
}

.trabajos-timeline-bar {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 999px;
    overflow: hidden;
}

.trabajos-timeline-progress {
    height: 100%;
    background: rgba(255, 255, 255, 0.55);
}

.trabajos-panel-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
}

.trabajos-detail-modal .modal-dialog {
    max-width: min(1240px, 96vw);
}

.trabajos-detail-modal .modal-content {
    border: 1px solid #dbe3ef;
    border-radius: 0.9rem;
}

.trabajos-detail-modal .modal-header {
    border-bottom: 1px solid #dbe3ef;
}

.trabajos-detail-modal .modal-body {
    background: #f8fafc;
}

.trabajos-detail-tabs {
    border-bottom: 1px solid #dbe3ef;
}

.trabajos-detail-tabs .nav-link {
    font-weight: 600;
}

.trabajos-detail-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0.95rem;
}

.trabajos-detail-section h6 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.trabajos-detail-kv {
    border: 1px solid #dbe3ef;
    border-radius: 0.6rem;
    background: #ffffff;
    padding: 0.6rem 0.7rem;
}

.trabajos-detail-kv-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.trabajos-detail-kv-value {
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}

#detalleUpdatesSection {
    background: #f8fafc;
}

#updatesList {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.85rem;
    border: 1px solid #d6e6dc;
    border-radius: 8px;
    background: #eef7f0;
}

.trabajos-update-composer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.55rem;
}

.trabajos-update-selected-files {
    color: #475569;
    font-size: 0.85rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trabajos-update {
    display: flex;
    margin-bottom: 0.75rem;
}

.trabajos-update.pinned {
    position: relative;
}

.trabajos-update.is-mine {
    justify-content: flex-end;
}

.trabajos-update-bubble {
    max-width: min(86%, 720px);
    padding: 0.7rem 0.85rem;
    border: 1px solid #dfe8e2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .05);
}

.trabajos-update.is-mine .trabajos-update-bubble {
    border-color: #8fd7a8;
    background: #c9f7d4;
}

.trabajos-update.pinned .trabajos-update-bubble {
    border-color: #f2c36b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .16), 0 3px 10px rgba(15, 23, 42, .05);
}

.trabajos-update-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.trabajos-update-date {
    color: #607086;
    font-size: 0.78rem;
}

.trabajos-update-body {
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

.trabajos-update-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.trabajos-update-actions .btn-link {
    padding-left: 0;
    color: #0f5132;
    text-decoration: none;
}

.trabajos-update-actions .btn-link:hover {
    text-decoration: underline;
}

.trabajos-update-reply {
    margin-top: 0.6rem;
}

.trabajos-updates-empty {
    color: #607086;
    font-size: 0.92rem;
}

.trabajos-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.trabajos-attachment {
    background: #e2e8f0;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    text-decoration: none;
    color: #1e293b;
}

.trabajos-attachment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.trabajos-attachment-row:last-child {
    border-bottom: none;
}

.trabajos-extra-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.trabajos-extra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    background: #ffffff;
    padding: 0.7rem 0.8rem;
}

.trabajos-extra-total {
    border-top: 1px solid #dbe3ef;
    padding-top: 0.75rem;
    color: #0f172a;
}

@media (max-width: 992px) {
    .trabajos-grid-header {
        display: none;
    }

    .trabajos-row {
        grid-template-columns: 32px 1fr;
        grid-template-rows: auto;
        gap: 0.75rem;
    }

    .trabajos-row .trabajos-cell:nth-child(n + 3) {
        grid-column: 2 / -1;
        flex-wrap: wrap;
    }

    .trabajos-date {
        max-width: 100%;
    }
}

#modalCliente .modal-content {
    background: #f3f4f9;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

#modalCliente .modal-header {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #ffffff;
    border-bottom: none;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    padding: 1.25rem 1.5rem;
}

#modalCliente .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.75;
}

#modalCliente .modal-header .btn-close:hover {
    opacity: 1;
}

#modalCliente .modal-body {
    background: #f8fafc;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    padding: 1.75rem;
}

#modalCliente .crm-modal-meta {
    font-size: 0.95rem;
    color: #e2e8f0;
    margin-top: 0.35rem;
}

#modalCliente .crm-modal-section {
    border: 1px solid #d8dee9;
    border-radius: 1rem;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

#modalCliente .crm-modal-section .card-header {
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 1rem 1.5rem;
}

#modalCliente .crm-section-header h6 {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1e293b;
}

#modalCliente .crm-modal-section .card-body {
    padding: 1.5rem;
}

#modalCliente .crm-collapse-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #334155;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#modalCliente .crm-collapse-toggle:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

#modalCliente .crm-collapse-toggle:hover {
    background: #e2e8f0;
}

#modalCliente .crm-collapse-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
}

#modalCliente .crm-collapse-icon::before {
    content: "\25BE";
}

#modalCliente .crm-form-stacked {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#modalCliente .crm-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1.25rem 1.5rem;
    background: #fdfdff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

#modalCliente .crm-fieldset legend {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #475569;
    padding: 0 0.4rem;
    margin-bottom: 1rem;
}

#modalCliente .crm-fieldset .form-label {
    font-weight: 600;
    color: #1e293b;
}

#modalCliente .crm-option-card {
    border: 1px solid #d1d9e6;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#modalCliente .crm-option-card small {
    font-size: 0.75rem;
    color: #64748b;
}

#modalCliente .crm-dropzone {
    border: 2px dashed #94a3b8;
    border-radius: 0.85rem;
    padding: 1.75rem;
    background: #f8fafc;
    color: #475569;
    font-weight: 500;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

#modalCliente .crm-dropzone:hover {
    border-color: #2563eb;
    background: #f1f5ff;
    color: #1d4ed8;
    cursor: pointer;
}

#modalCliente .crm-dropzone kbd {
    background: #1e293b;
    color: #ffffff;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.25);
}

#modalCliente .crm-attachment-list {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #ffffff;
    padding: 0.75rem 1rem;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.16);
}

#modalCliente .crm-attachment-list li + li {
    border-top: 1px dashed #e2e8f0;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

#modalCliente .crm-form-actions {
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

#modalCliente .crm-form-actions .btn-primary {
    min-width: 180px;
}

#modalCliente .crm-form-actions .btn {
    padding-inline: 1.35rem;
}

#modalCliente .modal-body .alert {
    border-radius: 0.75rem;
}

#modalCliente .crm-activity-card .activity-snooze-group .btn {
    min-width: 110px;
}

#modalCliente .crm-activity-card .activity-save-btn {
    min-width: 160px;
}

#modalCliente .crm-activity-card .card-body .form-label {
    font-weight: 600;
    color: #1e293b;
}

#modalCliente .crm-modal-section + .crm-modal-section {
    margin-top: 1.5rem;
}

@media (min-width: 769px) {
    /* CRM: mobile modal layout - mantener secciones abiertas en desktop */
    #modalCliente .crm-mobile-section.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible;
    }
    #modalCliente .crm-collapse-toggle {
        display: none;
    }
}

@media (max-width: 576px) {
    #modalCliente .crm-activity-card .activity-snooze-group {
        gap: 0.5rem;
    }

    #modalCliente .crm-activity-card .activity-save-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* CRM: mobile modal layout adjustments */
    #modalCliente .modal-header {
        padding: 0.9rem 1rem;
    }

    #modalCliente .modal-title {
        font-size: 1.05rem;
    }

    #modalCliente .crm-modal-meta {
        font-size: 0.85rem;
    }

    #modalCliente .modal-body {
        padding: 1.1rem;
    }

    #modalCliente .crm-modal-section .card-header {
        padding: 0.85rem 1rem;
    }

    #modalCliente .crm-modal-section .card-body {
        padding: 1rem;
    }

    #modalCliente .crm-section-header h6 {
        font-size: 0.98rem;
    }

    #modalCliente .crm-fieldset {
        padding: 1rem;
    }

    #modalCliente .crm-fieldset legend {
        margin-bottom: 0.75rem;
        font-size: 0.8rem;
    }

    #modalCliente .crm-form-actions .btn {
        padding-inline: 1rem;
    }

    #modalCliente .crm-activity-card .activity-snooze-group .btn {
        min-width: auto;
        padding: 0.35rem 0.65rem;
    }

    #modalCliente .crm-activity-card .activity-save-btn {
        min-width: 0;
    }

    #modalCliente .crm-modal-section + .crm-modal-section {
        margin-top: 1rem;
    }

    #modalCliente .crm-collapse-toggle {
        display: inline-flex;
    }

    #modalCliente .crm-collapse-toggle[aria-expanded="true"] .crm-collapse-icon {
        transform: rotate(180deg);
    }
}

.stock-table-wrapper {
    min-height: 0;
}

.stock-units-cell .stock-actions form {
    min-width: 120px;
}

.stock-step-btn {
    min-width: 42px;
}

.stock-toast-container {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(360px, 92vw);
}

.stock-toast {
    border-radius: 0.75rem;
    border: 1px solid #c6ebd0;
    background: linear-gradient(135deg, #e8f7ee, #dff5e8);
    color: #0f5132;
    box-shadow: 0 12px 32px rgba(25, 135, 84, 0.15);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.stock-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.stock-toast-hide {
    opacity: 0;
    transform: translateY(8px);
}

.stock-units-cell .form-control-sm {
    min-height: 38px;
}

.stock-row td {
    word-break: break-word;
}

.stock-toast.alert-danger {
    border-color: #f5c2c7;
    background: linear-gradient(135deg, #f8d7da, #fbeaed);
    color: #842029;
}

@media (max-width: 576px) {
    .stock-table-wrapper table {
        border: 0;
    }

    .stock-table-wrapper thead {
        display: none;
    }

    .stock-table-wrapper tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e9ecef;
        border-radius: 0.75rem;
        padding: 0.75rem 0.85rem;
        box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
    }

    .stock-table-wrapper tbody tr:last-child {
        margin-bottom: 0;
    }

    .stock-table-wrapper tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border: 0;
    }

    .stock-table-wrapper tbody tr td::before {
        content: attr(data-label);
        flex: 0 0 120px;
        max-width: 45%;
        font-weight: 600;
        color: #6c757d;
    }

    .stock-units-form {
        align-items: stretch !important;
    }

    .stock-step-group {
        width: 100%;
    }

    .stock-step-btn {
        flex: 1;
    }

    .stock-input-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    .stock-units-input,
    .stock-save-btn {
        width: 100%;
    }

    .stock-row td[data-label="Acciones"] {
        justify-content: flex-start;
    }
}

.flatpickr-calendar.crm-calendar {
    background: #ffffff;
    border: 1px solid #d0d7de;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    border-radius: 0.75rem;
    overflow: hidden;
}

.flatpickr-calendar.crm-calendar .flatpickr-day.selected,
.flatpickr-calendar.crm-calendar .flatpickr-day.startRange,
.flatpickr-calendar.crm-calendar .flatpickr-day.endRange,
.flatpickr-calendar.crm-calendar .flatpickr-day.selected:hover {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.flatpickr-calendar.crm-calendar .flatpickr-months {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.flatpickr-calendar.crm-calendar .flatpickr-time {
    border-top: 1px solid #e2e8f0;
}

.flatpickr-calendar.crm-calendar .flatpickr-time input {
    border-radius: 0.5rem;
}

.flatpickr-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.flatpickr-apply-btn {
    min-width: 90px;
}

.flatpickr-alt-input {
    width: 100%;
    background-color: #ffffff;
}

.login-body {
    min-height: 100vh;
    margin: 0;
    background: #f5f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-wrapper {
    width: min(100%, 420px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.login-logo {
    max-width: 180px;
    width: 60%;
    height: auto;
}

.login-card {
    width: 100%;
    background: #ffffff;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
}

.login-google-wrap {
    margin-top: 0.85rem;
    text-align: center;
}

.login-google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    padding-inline: 0.75rem;
    width: auto;
    min-width: 0;
}

.login-google-btn .login-google-icon {
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex: 0 0 auto;
    display: inline-block;
}

.empresa-card-list {
    display: none;
    gap: 0.75rem;
}

.empresa-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem 1.25rem 1.1rem;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    position: relative;
}

.empresa-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border-left: 4px solid transparent;
    pointer-events: none;
}

.empresa-card.stale-1::before { border-left-color: #F2C200; }
.empresa-card.stale-2::before { border-left-color: #FF9800; }
.empresa-card.stale-3::before { border-left-color: #E53935; }
.empresa-card.stale-muted::before { border-left-color: #9CA3AF; }

.empresa-card:nth-child(even) {
    background: #f8fafc;
}

.empresa-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
    word-break: break-word;
}

.empresa-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.empresa-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.empresa-card-details {
    margin: 0;
    padding: 0;
}

.empresa-card-field {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    align-items: flex-start;
}

.empresa-card-field + .empresa-card-field {
    border-top: 1px solid #e2e8f0;
}

.empresa-card-field dt {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.empresa-card-field dd {
    margin: 0;
    font-size: 0.95rem;
    color: #0f172a;
    flex: 1;
    text-align: right;
    word-break: break-word;
}

.empresa-card-badge {
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
}


.empresa-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.empresa-card-contactos {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.empresa-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.empresa-card-actions .btn {
    flex: 1 1 150px;
    min-height: 46px;
    font-weight: 700;
}

.badge-stale {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 0.75rem;
    font-weight: 600;
    border-left: 4px solid transparent;
}

.badge-stale-1 { background:#FFF4CC; color:#7A5B00; border-left-color:#F2C200; }
.badge-stale-2 { background:#FFE4CC; color:#7A2E00; border-left-color:#FF9800; }
.badge-stale-3 { background:#FFD6D6; color:#7A0F0F; border-left-color:#E53935; }
.badge-muted  { background:#E5E7EB; color:#374151; border-left-color:#9CA3AF; }

.clientes-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: #e5e7eb;
    color: #1f2937;
}

.clientes-chip + .clientes-chip {
    margin-left: 0.35rem;
}

.clientes-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.clientes-controls .form-control,
.clientes-controls .form-select {
    min-height: 44px;
}

.clientes-advanced-toggle {
    padding: 0.25rem 0;
}

.clientes-advanced-options {
    width: 100%;
}

.activity-filter-pills {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.1rem 0.25rem 0.5rem;
    position: relative;
}

.activity-filter-pills button {
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    white-space: nowrap;
}

.activity-filter-pills button.active {
    background: #0d6efd;
    color: #ffffff;
}

.activity-filter-pills .count {
    font-size: 0.8rem;
    margin-left: 0.35rem;
    opacity: 0.85;
}

.activity-filter-pills::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
}

.sort-select-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 200px;
}

.clientes-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.clientes-pagination .btn {
    min-width: 140px;
}

@media (max-width: 767.98px) {
    .clientes-controls {
        flex-direction: column;
        align-items: stretch;
    }

    #clientesAdvancedOptions.collapse:not(.show) {
        display: none;
    }

    .sort-select-group {
        width: 100%;
    }

    .clientes-pagination {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (min-width: 768px) {
    #clientesAdvancedOptions.collapse {
        display: flex !important;
        height: auto !important;
        visibility: visible;
    }
}

@media (max-width: 991.98px) {
    #tablaClientes,
    #tablaClientesWrap {
        display: none;
    }

    .empresa-card-list {
        display: flex;
        flex-direction: column;
    }

    .empresa-card-field {
        flex-wrap: wrap;
    }

    .empresa-card-field dd {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
        border-radius: 14px;
    }

    .login-logo {
        max-width: 140px;
    }
}

@media (min-width: 992px) {
    .login-body {
        padding: 2rem;
    }

    .login-card {
        max-width: 420px;
    }
}

#listaInteracciones {
    padding-left: 0;
}

#listaInteracciones .interaccion-card-inner {
    --interaccion-card-bg: #ffffff;
}

#listaInteracciones .interaccion-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#listaInteracciones .interaccion-info {
    flex: 1 1 auto;
    min-width: 0;
}

#listaInteracciones .interaccion-title {
    font-weight: 600;
    font-size: 1rem;
    color: #0f172a;
}

#listaInteracciones .interaccion-meta {
    font-size: 0.9rem;
    color: #475569;
}

#listaInteracciones .interaccion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

#listaInteracciones .interaccion-action {
    min-width: 44px;
    min-height: 44px;
    padding: 0.35rem 0.85rem;
    font-weight: 500;
}

#listaInteracciones .interaccion-body {
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#listaInteracciones .interaccion-body.is-collapsed {
    max-height: calc(1.45em * 5);
    overflow: hidden;
    position: relative;
}

#listaInteracciones .interaccion-body.is-collapsed::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5rem;
    background: linear-gradient(0deg, var(--interaccion-card-bg, #ffffff), rgba(248, 250, 252, 0));
}

#listaInteracciones .interaccion-toggle {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

#listaInteracciones .interaccion-toggle:hover,
#listaInteracciones .interaccion-toggle:focus {
    text-decoration: underline;
}

#listaInteracciones .interaccion-meta-badge {
    font-size: 0.85rem;
    color: #0f172a;
}

#listaInteracciones .interaccion-attachments a {
    min-height: 44px;
}

@media (min-width: 576px) {
    #listaInteracciones .interaccion-header {
        flex-direction: row;
        align-items: flex-start;
    }

    #listaInteracciones .interaccion-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 575.98px) {
    #modalCliente .modal-body {
        padding: 1.25rem;
    }

    #listaInteracciones .interaccion-card {
        border: none;
        padding: 0;
        background: transparent;
    }

    #listaInteracciones .interaccion-card + .interaccion-card {
        margin-top: 0.75rem;
    }

    #listaInteracciones .interaccion-card-inner {
        padding: 1rem;
        border-radius: 1rem;
        border: 1px solid #e2e8f0;
        background: #ffffff;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

    #listaInteracciones .interaccion-card:nth-child(even) .interaccion-card-inner {
        background: #f8fafc;
        --interaccion-card-bg: #f8fafc;
    }

    #listaInteracciones .item-pin .interaccion-card-inner {
        border-color: #9ecf2d;
        box-shadow: 0 0 0 2px rgba(158, 207, 45, 0.25), 0 10px 24px rgba(142, 202, 50, 0.25);
        --interaccion-card-bg: #f8ffef;
    }

    #listaInteracciones .interaccion-actions {
        width: 100%;
        justify-content: flex-start;
    }

    #listaInteracciones .interaccion-action {
        flex: 1 1 calc(50% - 0.5rem);
    }
}



.trabajos-kanban-empty {
    font-size: 0.8rem;
    color: #64748b;
    padding: 4px 2px;
}

.kanban-card {
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    min-height: auto;
}

@media (max-width: 768px) {
    .trabajos-kanban-cards {
        grid-template-columns: 1fr;
    }
}
