/* Leaders CRM — Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ld-primary: #6366f1;
    --ld-primary-dark: #4f46e5;
    --ld-primary-light: #eef2ff;
    --ld-sidebar: #1a1c2e;
    --ld-sidebar-hover: #252840;
    --ld-sidebar-active: #6366f1;
    --ld-bg: #f4f6fb;
    --ld-surface: #ffffff;
    --ld-border: #e8ecf4;
    --ld-text: #1e293b;
    --ld-text-muted: #64748b;
    --ld-success: #10b981;
    --ld-warning: #f59e0b;
    --ld-danger: #ef4444;
    --ld-info: #06b6d4;
    --ld-radius: 12px;
    --ld-radius-sm: 8px;
    --ld-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .04);
    --ld-shadow-lg: 0 8px 30px rgba(15, 23, 42, .08);
    --ld-sidebar-width: 260px;
}

*, *::before, *::after { box-sizing: border-box; }

body.ld-body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--ld-text);
    background: var(--ld-bg);
    -webkit-font-smoothing: antialiased;
}

/* ── App shell ── */
.ld-app { display: flex; min-height: 100vh; }

.ld-sidebar {
    width: var(--ld-sidebar-width);
    background: var(--ld-sidebar);
    color: #c8cdd8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform .25s;
}

.ld-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.ld-brand-icon {
    width: 38px; height: 38px;
    background: var(--ld-primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
}

.ld-brand-text { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }

.ld-sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }

.ld-nav-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: #5c6378;
    padding: 12px 12px 6px;
    text-transform: uppercase;
}

.ld-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--ld-radius-sm);
    color: #a8b0c4;
    text-decoration: none;
    font-weight: 500;
    font-size: .875rem;
    margin-bottom: 2px;
    transition: all .15s;
}

.ld-nav-link i { width: 18px; text-align: center; font-size: .95rem; }

.ld-nav-link:hover {
    background: var(--ld-sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.ld-nav-link.active {
    background: var(--ld-sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}

.ld-sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.ld-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--ld-radius-sm);
    background: rgba(255,255,255,.04);
}

.ld-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ld-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; flex-shrink: 0;
}

.ld-user-info { flex: 1; min-width: 0; }
.ld-user-name { color: #fff; font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-user-role { color: #7c849a; font-size: .72rem; }

.ld-logout-btn {
    background: none; border: none; color: #7c849a;
    cursor: pointer; padding: 6px; border-radius: 6px;
    transition: color .15s;
}
.ld-logout-btn:hover { color: #ef4444; }

/* ── Main area ── */
.ld-main {
    flex: 1;
    margin-left: var(--ld-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ld-topbar {
    background: var(--ld-surface);
    border-bottom: 1px solid var(--ld-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}

.ld-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: .8rem; color: var(--ld-text-muted);
}
.ld-breadcrumb strong { color: var(--ld-text); font-weight: 600; }

.ld-topbar-right { display: flex; align-items: center; gap: 16px; }

.ld-topbar-user {
    display: flex; align-items: center; gap: 10px;
    font-size: .85rem; font-weight: 500;
}

.ld-status-dot {
    width: 8px; height: 8px;
    background: var(--ld-success);
    border-radius: 50%;
    display: inline-block;
}

.ld-content { padding: 24px 28px 40px; flex: 1; }

.ld-page-header { margin-bottom: 24px; }
.ld-page-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; letter-spacing: -.02em; }
.ld-page-subtitle { color: var(--ld-text-muted); margin: 0; font-size: .875rem; }

/* ── Cards ── */
.ld-card {
    background: var(--ld-surface);
    border-radius: var(--ld-radius);
    box-shadow: var(--ld-shadow);
    border: 1px solid var(--ld-border);
    overflow: hidden;
}

.ld-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--ld-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ld-card-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ld-text-muted);
    margin: 0;
}

.ld-card-body { padding: 22px; }

/* ── Stat cards ── */
.ld-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

.ld-stat-card {
    background: var(--ld-surface);
    border-radius: var(--ld-radius);
    padding: 20px;
    box-shadow: var(--ld-shadow);
    border: 1px solid var(--ld-border);
    display: flex; align-items: flex-start; gap: 14px;
}

.ld-stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.ld-stat-icon.purple { background: var(--ld-primary-light); color: var(--ld-primary); }
.ld-stat-icon.green { background: #ecfdf5; color: var(--ld-success); }
.ld-stat-icon.yellow { background: #fffbeb; color: var(--ld-warning); }
.ld-stat-icon.blue { background: #ecfeff; color: var(--ld-info); }

.ld-stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.ld-stat-label { font-size: .78rem; color: var(--ld-text-muted); font-weight: 500; }
.ld-stat-trend { font-size: .72rem; color: var(--ld-success); margin-top: 4px; }

/* ── Buttons ── */
.ld-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px;
    border-radius: var(--ld-radius-sm);
    font-weight: 600; font-size: .85rem;
    border: none; cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    line-height: 1.4;
}

.ld-btn-primary { background: var(--ld-primary); color: #fff; }
.ld-btn-primary:hover { background: var(--ld-primary-dark); color: #fff; text-decoration: none; box-shadow: 0 4px 12px rgba(99,102,241,.3); }

.ld-btn-outline {
    background: var(--ld-surface); color: var(--ld-text);
    border: 1px solid var(--ld-border);
}
.ld-btn-outline:hover { background: var(--ld-bg); color: var(--ld-text); text-decoration: none; }

.ld-btn-success { background: var(--ld-success); color: #fff; }
.ld-btn-success:hover { background: #059669; color: #fff; }

.ld-btn-sm { padding: 6px 14px; font-size: .8rem; }
.ld-btn-xs { padding: 4px 10px; font-size: .75rem; }

.ld-btn-icon {
    width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: none; cursor: pointer;
    background: transparent; color: var(--ld-text-muted);
    transition: all .15s;
}
.ld-btn-icon:hover { background: var(--ld-bg); }
.ld-btn-icon.danger:hover { background: #fef2f2; color: var(--ld-danger); }
.ld-btn-icon.warning:hover { background: #fffbeb; color: var(--ld-warning); }

/* ── Filter pills ── */
.ld-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }

.ld-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .8rem; font-weight: 500;
    border: 1px solid var(--ld-border);
    background: var(--ld-surface);
    color: var(--ld-text-muted);
    text-decoration: none;
    transition: all .15s;
}
.ld-pill:hover { border-color: var(--ld-primary); color: var(--ld-primary); text-decoration: none; }
.ld-pill.active { background: var(--ld-primary); color: #fff; border-color: var(--ld-primary); }

/* ── Tables ── */
.ld-table-wrap { overflow-x: auto; }

.ld-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.ld-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ld-text-muted);
    border-bottom: 1px solid var(--ld-border);
    background: #fafbfe;
    white-space: nowrap;
}

.ld-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.ld-table tbody tr:hover td { background: #fafbfe; }

.ld-table tbody tr:last-child td { border-bottom: none; }

/* ── Forms ── */
.ld-form-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ld-text-muted);
    margin-bottom: 6px;
}

.ld-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    font-size: .875rem;
    font-family: inherit;
    color: var(--ld-text);
    background: var(--ld-surface);
    transition: border-color .15s, box-shadow .15s;
}

.ld-input:focus {
    outline: none;
    border-color: var(--ld-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.ld-input-group {
    position: relative;
}
.ld-input-group .ld-input { padding-left: 40px; }
.ld-input-group-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--ld-text-muted); font-size: .9rem;
}

.ld-select {
    padding: 6px 12px;
    border: 1px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    font-size: .8rem;
    font-family: inherit;
    background: var(--ld-surface);
}

/* ── Badges ── */
.ld-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}
.ld-badge-green { background: #ecfdf5; color: #059669; }
.ld-badge-yellow { background: #fffbeb; color: #d97706; }
.ld-badge-purple { background: var(--ld-primary-light); color: var(--ld-primary); }
.ld-badge-blue { background: #ecfeff; color: #0891b2; }
.ld-badge-gray { background: #f1f5f9; color: #64748b; }

/* ── Alerts ── */
.ld-alert {
    padding: 14px 18px;
    border-radius: var(--ld-radius-sm);
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
    font-size: .875rem;
}
.ld-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.ld-alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.ld-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Avatar inline ── */
.ld-avatar-sm {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--ld-primary-light);
    color: var(--ld-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700;
    margin-right: 8px;
}

.ld-wa-link { color: #25d366; margin-left: 6px; }

/* ── Toolbar ── */
.ld-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: center; margin-bottom: 16px;
}

.ld-search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    padding: 0 14px;
    flex: 1; max-width: 360px;
}
.ld-search-box input {
    border: none; outline: none; padding: 10px 0;
    font-size: .875rem; width: 100%; font-family: inherit;
    background: transparent;
}
.ld-search-box i { color: var(--ld-text-muted); }

/* ── Auth pages (login, cambiar password) ── */
.ld-auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-family: 'Inter', -apple-system, sans-serif;
    background: #fff;
}

.ld-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 56px;
    background: linear-gradient(145deg, #4f46e5 0%, #6366f1 45%, #7c3aed 100%);
    color: #fff;
    overflow: hidden;
}

.ld-auth-brand::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    top: -120px; right: -100px;
}

.ld-auth-brand::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    bottom: -80px; left: -60px;
}

.ld-auth-brand-content { position: relative; z-index: 1; max-width: 400px; }

.ld-auth-brand-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 32px;
    border: 1px solid rgba(255,255,255,.15);
}

.ld-auth-brand h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -.03em;
    margin: 0 0 16px;
    line-height: 1.15;
}

.ld-auth-brand p {
    font-size: 1rem;
    opacity: .85;
    line-height: 1.6;
    margin: 0 0 40px;
}

.ld-auth-features { list-style: none; padding: 0; margin: 0; }
.ld-auth-features li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    font-size: .9rem;
    opacity: .9;
}
.ld-auth-features li i {
    width: 28px; height: 28px;
    background: rgba(255,255,255,.15);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
}

.ld-auth-form-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    background: #fafbfe;
}

.ld-auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.ld-auth-form-header { margin-bottom: 32px; }
.ld-auth-form-header h2 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 8px;
    color: var(--ld-text);
}
.ld-auth-form-header p {
    margin: 0;
    color: var(--ld-text-muted);
    font-size: .9rem;
}

.ld-auth-field { margin-bottom: 20px; }

.ld-auth-input-wrap {
    position: relative;
}

.ld-auth-input-wrap i.ld-auth-input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: .9rem;
    pointer-events: none;
}

.ld-auth-input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--ld-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.ld-auth-input:focus {
    outline: none;
    border-color: var(--ld-primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}

.ld-auth-input-toggle {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #94a3b8; cursor: pointer;
    padding: 4px; font-size: .9rem;
}
.ld-auth-input-toggle:hover { color: var(--ld-primary); }

.ld-auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ld-auth-checkbox {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 24px;
    font-size: .85rem;
    color: var(--ld-text-muted);
    cursor: pointer;
}
.ld-auth-checkbox input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--ld-primary);
    cursor: pointer;
}

.ld-auth-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.ld-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,.45);
}
.ld-auth-submit:active { transform: translateY(0); }

.ld-auth-footer {
    text-align: center;
    margin-top: 40px;
    font-size: .75rem;
    color: #94a3b8;
}

.ld-auth-error {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: .85rem;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}

.ld-link { color: var(--ld-primary); text-decoration: none; font-size: .8rem; font-weight: 500; }
.ld-link:hover { text-decoration: underline; }

.text-danger { color: var(--ld-danger); font-size: .8rem; margin-top: 4px; display: block; }

@media (max-width: 900px) {
    .ld-auth-page { grid-template-columns: 1fr; }
    .ld-auth-brand { display: none; }
    .ld-auth-form-side { padding: 32px 24px; min-height: 100vh; }
}

/* legacy aliases */
.ld-login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; background:#fafbfe; font-family:'Inter',sans-serif; }
.ld-login-card { width:100%; max-width:400px; background:#fff; border-radius:16px; box-shadow:var(--ld-shadow-lg); padding:40px 36px; }
.ld-checkbox-row { display:flex; align-items:center; gap:8px; margin-bottom:20px; font-size:.85rem; color:var(--ld-text-muted); }
.ld-login-footer { text-align:center; margin-top:32px; font-size:.75rem; color:var(--ld-text-muted); }

/* ── Modals (bootstrap override) ── */
.modal-content { border-radius: var(--ld-radius); border: none; box-shadow: var(--ld-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--ld-border); padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--ld-border); padding: 14px 22px; }
.modal-title { font-weight: 700; font-size: 1rem; }

/* ── CRM drawer ── */
.crm-drawer-overlay { display:none; position:fixed; inset:0; background:rgba(15,23,42,.4); z-index:1040; backdrop-filter:blur(2px); }
.crm-drawer {
    position:fixed; top:0; right:-480px; width:460px; max-width:95vw; height:100vh;
    background:var(--ld-surface); z-index:1050;
    box-shadow: -8px 0 30px rgba(15,23,42,.12);
    transition:right .25s; display:flex; flex-direction:column;
}
.crm-drawer.open { right:0; }
.crm-drawer-header { padding:18px 22px; border-bottom:1px solid var(--ld-border); display:flex; justify-content:space-between; align-items:center; }
.crm-drawer-body { flex:1; overflow-y:auto; padding:18px 22px; }
.crm-timeline-item { border-left:3px solid var(--ld-primary); padding-left:14px; margin-bottom:16px; }
.crm-table th { background:#fafbfe !important; color:var(--ld-text-muted) !important; font-size:.7rem !important; text-transform:uppercase; letter-spacing:.06em; }
.crm-cell-input:focus { outline:none; border-color:var(--ld-primary); box-shadow:0 0 0 2px rgba(99,102,241,.15); border-radius:6px; }

.crm-import-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.crm-file-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}
.crm-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.crm-file-name {
    font-size: .8rem;
    color: var(--ld-text-muted);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-cell-select {
    display: block;
    width: 100%;
    min-width: 150px;
    padding: 8px 32px 8px 12px;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--ld-text);
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    appearance: auto;
    cursor: pointer;
}
.crm-cell-select:focus {
    outline: none;
    border-color: var(--ld-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.crm-add-col-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: .75rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--ld-primary);
    background: var(--ld-primary-light);
    border: 1px dashed var(--ld-primary);
    border-radius: var(--ld-radius-sm);
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}
.crm-add-col-btn:hover {
    background: #e0e7ff;
    border-style: solid;
    box-shadow: 0 2px 8px rgba(99,102,241,.2);
}
.crm-add-col-btn i { font-size: .7rem; }

.ld-btn-filter-active {
    border-color: var(--ld-primary);
    color: var(--ld-primary);
    background: var(--ld-primary-light);
}
.ld-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--ld-primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}
.crm-filtro-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.crm-filtro-val-wrap { min-width: 0; }
.crm-filtro-del {
    width: 34px;
    height: 34px;
    border: 1px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    background: var(--ld-surface);
    color: var(--ld-text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.crm-filtro-del:hover {
    background: #fef2f2;
    color: var(--ld-danger);
    border-color: #fecaca;
}
@media (max-width: 768px) {
    .crm-filtro-row { grid-template-columns: 1fr; }
}

/* ── Legacy AdminLTE overrides inside ld-app ── */
.ld-content .card {
    border-radius: var(--ld-radius);
    box-shadow: var(--ld-shadow);
    border: 1px solid var(--ld-border);
}
.ld-content .card-header {
    background: var(--ld-surface);
    border-bottom: 1px solid var(--ld-border);
}
.ld-content .btn-primary { background: var(--ld-primary); border-color: var(--ld-primary); }
.ld-content .btn-primary:hover { background: var(--ld-primary-dark); border-color: var(--ld-primary-dark); }
.ld-content .table thead th { background: #fafbfe; color: var(--ld-text-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--ld-border); }
.ld-content .alert { border-radius: var(--ld-radius-sm); }
.ld-content .form-control {
    border-radius: var(--ld-radius-sm);
    border-color: var(--ld-border);
    font-size: .875rem;
    padding: 10px 14px;
}
.ld-content .form-control:focus {
    border-color: var(--ld-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.ld-content .form-control.form-control-sm {
    height: auto;
    min-height: 34px;
    padding: 6px 10px;
    line-height: 1.5;
}
.ld-content .page-item.active .page-link {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
}
.ld-content .page-link { color: var(--ld-primary); }

/* ── Mobile ── */
.ld-menu-toggle {
    display: none;
    background: none; border: none;
    font-size: 1.2rem; color: var(--ld-text);
    cursor: pointer; padding: 4px 8px;
}

@media (max-width: 991px) {
    .ld-sidebar { transform: translateX(-100%); }
    .ld-sidebar.open { transform: translateX(0); }
    .ld-main { margin-left: 0; }
    .ld-menu-toggle { display: block; }
    .ld-content { padding: 16px; }
}
