/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input, textarea, select, [contenteditable] {
    caret-color: #161616;
}

:root {
    --color-bg: #f0f2f5;
    --color-white: #ffffff;
    --color-text: #1a1a2e;
    --color-text-light: #6b7280;
    --color-border: #e5e7eb;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-danger: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.2s ease;

    --col-contactos: #6c5ce7;
    --col-comercializacion: #0984e3;
    --col-prospecto: #00b894;
    --col-seguimiento: #fdcb6e;
    --col-primera-visita: #e17055;
    --col-presentacion: #d63031;
    --col-arras: #a29bfe;
    --col-notaria: #00cec9;
    --col-vendido: #00b894;
    --col-perdido: #636e72;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
    background: var(--color-white);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left i {
    font-size: 28px;
    color: var(--color-primary);
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 12px;
    color: var(--color-text-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-user {
    font-size: 13px;
    color: var(--color-text-light);
    padding: 4px 12px;
    background: #f3f4f6;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 6px;
}

.header-user::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #059669;
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-light);
    padding: 8px 10px;
    border-radius: 50%;
    font-size: 16px;
}

.btn-ghost:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1e3a5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.login-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: loginIn 0.4s ease;
}

@keyframes loginIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary), #1e40af);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.login-logo i {
    font-size: 28px;
    color: white;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--color-text-light);
    text-align: center;
    margin-bottom: 28px;
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: none;
    border: 1px solid #fecaca;
}

.login-error.visible {
    display: block;
}

.login-success {
    background: #ecfdf5;
    color: #059669;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: none;
    border: 1px solid #a7f3d0;
}

.login-success.visible {
    display: block;
}

.login-card .form-group {
    margin-bottom: 18px;
}

.login-card .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.login-card .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition);
    background: #fafafa;
}

.login-card .form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    background: white;
}

.login-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--color-text-light);
}

.login-toggle a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.login-toggle a:hover {
    text-decoration: underline;
}

.login-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    color: var(--color-text-light);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    padding: 16px 0 4px;
    font-size: 11px;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
}

.login-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-loader.visible {
    display: flex;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== KANBAN BOARD ===== */
main {
    padding: 20px;
    height: calc(100vh - 130px);
}

.board {
    display: flex;
    gap: 16px;
    height: 100%;
    overflow-x: scroll;
    padding-bottom: 12px;
    align-items: flex-start;
    scrollbar-width: thin;
}

.board::-webkit-scrollbar {
    height: 8px;
}

.board::-webkit-scrollbar-track {
    background: transparent;
}

.board::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 4px;
}

/* ===== COLUMN ===== */
.column {
    min-width: 260px;
    max-width: 260px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    flex-shrink: 0;
}

.column-header {
    padding: 14px 16px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
}

.column-header:active {
    cursor: grabbing;
}

.column-header .col-name {
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-header .col-count {
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
}

.column-body {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
}

.column-body::-webkit-scrollbar {
    width: 4px;
}

.column-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* ===== COLUMN COLORS ===== */
.column[data-estado="CONTACTOS"] .column-header { background: var(--col-contactos); }
.column[data-estado="COMERCIALIZACION"] .column-header { background: var(--col-comercializacion); }
.column[data-estado="PROSPECTO"] .column-header { background: var(--col-prospecto); }
.column[data-estado="SEGUIMIENTO"] .column-header { background: var(--col-seguimiento); }
.column[data-estado="SEGUIMIENTO"] .col-name,
.column[data-estado="SEGUIMIENTO"] .col-count { color: #333; }
.column[data-estado="PRIMERA VISITA"] .column-header { background: var(--col-primera-visita); }
.column[data-estado="PRESENTACIÓN"] .column-header { background: var(--col-presentacion); }
.column[data-estado="ARRAS"] .column-header { background: var(--col-arras); }
.column[data-estado="NOTARIA"] .column-header { background: var(--col-notaria); }
.column[data-estado="VENDIDO"] .column-header { background: var(--col-vendido); }
.column[data-estado="PERDIDO"] .column-header { background: var(--col-perdido); }

/* ===== CARD ===== */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all var(--transition);
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card:active {
    cursor: grabbing;
}

.card-drag {
    opacity: 0.4;
}

.card-ghost {
    border: 2px dashed var(--color-primary);
    background: #f0f7ff;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    word-break: break-word;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
    flex-shrink: 0;
    margin-left: 8px;
}

.card:hover .card-actions {
    opacity: 1;
}

.card-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--color-text-light);
    font-size: 12px;
    transition: all var(--transition);
}

.card-actions .btn-edit:hover {
    color: var(--color-primary);
    background: #eef2ff;
}

.card-actions .btn-delete:hover {
    color: var(--color-danger);
    background: #fef2f2;
}

.card-body {
    font-size: 12px;
    color: var(--color-text-light);
}

.card-body .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.card-body .info-row .label {
    font-weight: 600;
}

.card-body .info-row .value {
    text-align: right;
}

.card-facturacion {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    background: #eef2ff;
    color: var(--color-primary);
}

.card-tag.captado {
    background: #ecfdf5;
    color: #059669;
}

.card-tag.no-captado {
    background: #fef2f2;
    color: #dc2626;
}

/* ===== MODAL (lead) ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-body {
    padding: 24px;
}

.motivo-modal {
    max-width: 480px;
}

.motivo-modal .modal-body {
    padding: 24px;
}

.motivo-desc {
    color: var(--color-text-light);
    font-size: 14px;
    margin: 0 0 16px;
    line-height: 1.5;
}

.motivo-modal textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 80px;
    box-sizing: border-box;
}

.motivo-modal textarea:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

.motivo-counter {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.motivo-counter.warn {
    color: #dc2626;
    font-weight: 600;
}

.motivo-actions {
    margin-top: 20px;
    padding-top: 0;
}

.motivo-actions .btn-primary {
    background: #dc2626;
    border-color: #dc2626;
}

.motivo-actions .btn-primary:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-text-light);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition);
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

.modal form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition);
    background: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* ===== NAV TABS ===== */
.nav-tabs {
    display: flex;
    gap: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    position: sticky;
    top: 73px;
    z-index: 99;
}

.tab-btn {
    padding: 14px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--color-text);
    background: #f9fafb;
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    height: 100%;
}

.tab-content.active#tabLeads {
    height: 100%;
}

#tabLeads .board {
    height: 100%;
}

/* ===== LLAMADAS ===== */
.llamadas-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    height: 100%;
    align-items: start;
}

.llamadas-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.llamadas-form-card,
.llamadas-stats-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.llamadas-form-card h3,
.llamadas-list h3 {
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.llamadas-stats-card .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.llamadas-stats-card .stat-row + .stat-row {
    border-top: 1px solid var(--color-border);
}

.stat-label {
    color: var(--color-text-light);
    font-weight: 500;
}

.stat-val {
    font-weight: 700;
    font-size: 16px;
}

.stat-success { color: #059669; }
.stat-lost { color: var(--color-danger); }
.stat-pct .stat-val { color: var(--color-primary); }

.llamadas-list {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.llamada-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 10px;
    position: relative;
    transition: all var(--transition);
}

.llamada-item:hover {
    box-shadow: var(--shadow-sm);
}

.llamada-item.exito {
    border-left: 4px solid #059669;
}

.llamada-item.perdida {
    border-left: 4px solid var(--color-danger);
    opacity: 0.7;
}

.llamada-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.llamada-lead {
    font-weight: 600;
    font-size: 14px;
}

.llamada-resultado {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.llamada-resultado.perdida {
    background: #fef2f2;
    color: #dc2626;
}

.llamada-resultado.seguimiento {
    background: #ecfdf5;
    color: #059669;
}

.llamada-resultado.primera_visita {
    background: #eef2ff;
    color: #2563eb;
}

.llamada-item-body {
    font-size: 13px;
    color: var(--color-text-light);
}

.llamada-fecha {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.llamada-notas {
    margin-top: 6px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.4;
}

.llamada-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: all var(--transition);
    font-size: 12px;
}

.llamada-item:hover .llamada-delete {
    opacity: 1;
}

.llamada-delete:hover {
    color: var(--color-danger);
    background: #fef2f2;
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: flex;
    gap: 24px;
    padding: 12px 24px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    font-size: 13px;
}

.stats-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.stats-bar .stat-value {
    font-weight: 700;
    font-size: 16px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 20px 10px;
    color: var(--color-text-light);
    font-size: 12px;
}

.empty-state i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-text);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    z-index: 2000;
    animation: notifIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification.success { background: #059669; }
.notification.error { background: var(--color-danger); }

@keyframes notifIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ACCIONES ===== */
.acciones-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
    align-items: start;
}

.acciones-form-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.acciones-form-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.acciones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.acciones-grid .form-group {
    margin-bottom: 0;
}

.acciones-grid .form-group label {
    font-size: 12px;
    margin-bottom: 3px;
}

.accion-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    text-align: center;
    transition: border-color var(--transition);
    background: #fafafa;
}

.accion-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: white;
}

/* Hide spinners on number inputs */
.accion-input::-webkit-outer-spin-button,
.accion-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.accion-input[type=number] {
    -moz-appearance: textfield;
}

.acciones-view {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.acciones-view h3 {
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accion-week {
    margin-bottom: 20px;
}

.accion-week-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    padding: 8px 12px;
    background: #eef2ff;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accion-day {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.accion-day:hover {
    background: #f9fafb;
}

.accion-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    grid-column: 1 / -1;
}

.accion-day-fecha {
    font-weight: 600;
    font-size: 13px;
}

.accion-day-actions {
    display: flex;
    gap: 6px;
}

.accion-day-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-text-light);
    font-size: 12px;
    transition: all var(--transition);
}

.accion-day-actions .accion-edit:hover {
    color: var(--color-primary);
    background: #eef2ff;
}

.accion-day-actions .accion-delete:hover {
    color: var(--color-danger);
    background: #fef2f2;
}

.accion-day-items {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: var(--color-text-light);
}

.accion-day-items .item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.accion-day-items .item-val {
    font-weight: 600;
    color: var(--color-text);
    min-width: 16px;
    text-align: right;
}

.accion-day-items .item-label {
    font-size: 11px;
}

.accion-day-items .resultado-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 11px;
}

.accion-day-items .resultado-item.prospecto {
    background: #eef2ff;
    color: #2563eb;
}

.accion-day-items .resultado-item.primera-visita {
    background: #ecfdf5;
    color: #059669;
}

.accion-week-footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    margin-top: 4px;
    background: #f3f4f6;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    flex-wrap: wrap;
    gap: 4px 16px;
}

.accion-week-footer .item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.accion-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-light);
}

.accion-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ===== CALCULATED FACTURACION ===== */
.calc-facturacion {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 42px;
    justify-content: center;
}

.calc-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
}

.calc-iva {
    font-size: 11px;
    color: var(--color-text-light);
}

.calc-asesor {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 42px;
    justify-content: center;
}

.calc-asesor-val {
    font-size: 18px;
    font-weight: 700;
    color: #7c3aed;
}

.card-facturacion.vendido {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.card-facturacion.vendido span:first-child {
    color: #065f46;
}

.card-asesor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #f5f3ff;
    font-size: 12px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.card-asesor span:first-child {
    color: #7c3aed;
    font-weight: 500;
}

.card-asesor span:last-child {
    font-weight: 700;
    color: #5b21b6;
}

.card-perdido {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #fef2f2;
    font-size: 12px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border-top: 1px solid #fecaca;
}

.card-perdido span:first-child {
    color: #dc2626;
    font-weight: 500;
}

.card-perdido span:last-child {
    font-weight: 700;
    color: #991b1b;
}

/* ===== PROFILE MODAL ===== */
.modal-sm {
    max-width: 440px;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 16px 0;
}

.form-hint {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 16px;
    line-height: 1.4;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ===== TICKETS / SOPORTE ===== */
.soporte-container {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.soporte-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.soporte-header h2 {
    font-size: 20px;
    color: var(--color-text);
}

.ticket-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ticket-card-left {
    flex: 1;
    min-width: 0;
}

.ticket-card-subject {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-card-meta {
    font-size: 12px;
    color: var(--color-text-light);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ticket-card-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ticket-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ticket-status.abierto {
    background: #dbeafe;
    color: #1d4ed8;
}

.ticket-status.en_progreso {
    background: #fef3c7;
    color: #b45309;
}

.ticket-status.cerrado {
    background: #d1fae5;
    color: #059669;
}

.ticket-detail-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ticket-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ticket-detail-subject {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.ticket-detail-meta {
    font-size: 12px;
    color: var(--color-text-light);
}

.ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.ticket-message {
    padding: 12px 16px;
    border-radius: 10px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
}

.ticket-message.user {
    background: #eef2ff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ticket-message.admin {
    background: #f0fdf4;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ticket-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.ticket-message-sender {
    font-weight: 600;
    color: var(--color-text);
}

.ticket-message-role {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    text-transform: uppercase;
}

.ticket-message-role.user {
    background: #dbeafe;
    color: #1d4ed8;
}

.ticket-message-role.admin {
    background: #d1fae5;
    color: #059669;
}

.ticket-message-time {
    color: var(--color-text-light);
}

.ticket-message-text {
    word-break: break-word;
}

.ticket-reply-area {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.ticket-reply-area textarea {
    flex: 1;
    min-height: 60px;
    resize: vertical;
}

.ticket-reply-area button {
    white-space: nowrap;
    padding: 10px 18px;
}

.ticket-admin-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.soporte-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
    font-size: 15px;
}

.soporte-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    color: var(--color-border);
}

@media (max-width: 768px) {
    .ticket-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .ticket-card-right {
        width: 100%;
        justify-content: space-between;
    }
    .ticket-message {
        max-width: 100%;
    }
    .ticket-reply-area {
        flex-direction: column;
    }
    .ticket-reply-area button {
        width: 100%;
    }
    .ticket-admin-actions {
        flex-wrap: wrap;
    }
}

/* ===== DASHBOARD ===== */
.dashboard-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-header h2 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-toolbar {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.dashboard-filters {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.dashboard-toolbar > .btn {
    position: absolute;
    right: 0;
    bottom: 0;
}

.dashboard-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dashboard-filters .filter-group label {
    font-size: 0.7rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-filters .filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--color-white);
    cursor: pointer;
    min-width: 100px;
}

.dashboard-filters .filter-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.dashboard-filters .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    align-content: start;
}

.dash-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    cursor: grab;
}

.dash-card:active {
    cursor: grabbing;
}

.card-ghost {
    opacity: 0.4;
    border: 2px dashed var(--color-primary);
}

.dash-drag-handle {
    margin-left: auto;
    font-size: 14px;
    color: #d1d5db;
    transition: color 0.2s;
}

.dash-card:hover .dash-drag-handle {
    color: #9ca3af;
}

.dash-card.full {
    grid-column: 1 / -1;
}

.dash-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
}

.dash-card h3 i {
    color: var(--color-primary);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dash-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.dash-stat {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.dash-stat .dash-stat-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.dash-stat .dash-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
    white-space: nowrap;
}

.dash-stat .dash-stat-label {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.dash-chart-container {
    position: relative;
    height: 220px;
    max-width: 100%;
}

.dash-chart-container canvas {
    max-height: 220px;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dash-table th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    color: var(--color-text-light);
    border-bottom: 2px solid var(--color-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
}

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

.dash-table .dash-val {
    font-weight: 700;
    text-align: center;
}

.dash-table .bar-cell {
    min-width: 100px;
}

.dash-table .bar-bg {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.dash-table .bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.dash-table .bar-fill.blue { background: var(--color-primary); }
.dash-table .bar-fill.green { background: #059669; }
.dash-table .bar-fill.yellow { background: #d97706; }
.dash-table .bar-fill.red { background: var(--color-danger); }
.dash-table .bar-fill.purple { background: #7c3aed; }
.dash-table .bar-fill.orange { background: #ea580c; }
.dash-table .bar-fill.teal { background: #0d9488; }
.dash-table .bar-fill.pink { background: #db2777; }
.dash-table .bar-fill.indigo { background: #4f46e5; }
.dash-table .bar-fill.gray { background: #6b7280; }

.dash-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
    font-size: 18px;
}

.dash-loading i {
    margin-right: 10px;
}

.dash-acciones-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.dash-acciones-item {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.dash-acciones-item .item-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
}

.dash-acciones-item .item-label {
    font-size: 10px;
    color: var(--color-text-light);
}

.dash-resultados-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.dash-resultado-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-resultado-badge.green {
    background: #d1fae5;
    color: #065f46;
}

/* ===== CONTACTOS ===== */
.contactos-container {
    height: 100%;
}

.contactos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding-bottom: 20px;
}

.contacto-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition);
    cursor: pointer;
}

.contacto-card:hover {
    box-shadow: var(--shadow-md);
}

.contacto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    user-select: none;
}

.contacto-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}

.contacto-preview {
    padding: 0 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contacto-preview span {
    font-size: 13px;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Contacto detail modal ── */
.cv-section + .cv-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

.cv-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}

.cv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cv-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cv-field .cv-label {
    font-size: 11px;
    color: var(--color-text-light);
}

.cv-field .cv-value {
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
    word-break: break-word;
}

.cv-field .cv-empty {
    color: #9ca3af;
    font-style: italic;
    font-weight: 400;
}

.cv-field-full {
    grid-column: 1 / -1;
}

.cv-obs-box {
    background: #f9fafb;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.5;
    white-space: pre-wrap;
}

.cv-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.cv-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 10px;
    font-size: 13px;
}

.cv-actions .btn-edit-contacto {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .2s;
}

.cv-actions .btn-edit-contacto:hover {
    background: var(--color-primary-hover, #1d4ed8);
}

.cv-actions .btn-delete-contacto {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .2s;
}

.cv-actions .btn-delete-contacto:hover {
    background: #fecaca;
}

@media (max-width: 600px) {
    .cv-grid {
        grid-template-columns: 1fr;
    }
}

.contacto-obs {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.4;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
}

.contactos-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.contactos-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    white-space: nowrap;
}

.contactos-search {
    position: relative;
    flex: 1;
    max-width: 360px;
    min-width: 200px;
}

.contactos-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    font-size: 14px;
    pointer-events: none;
}

.contactos-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--color-white);
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.contactos-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ===== RESPONSIVE ===== */

/* ── Tablet & below ── */
/* ── Admin Panel ────────────────────────────────────────────────── */
.admin-container {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.admin-container h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--color-text);
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-count {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-table th,
.admin-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-role-badge.admin {
    background: #ede9fe;
    color: #7c3aed;
}

.admin-role-badge.user {
    background: #dbeafe;
    color: #2563eb;
}

.admin-plan-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fef3c7;
    color: #d97706;
}

.admin-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.admin-status-badge.active {
    background: #ecfdf5;
    color: #059669;
}

.admin-status-badge.active:hover {
    background: #fef2f2;
    color: #dc2626;
}

.admin-status-badge.inactive {
    background: #fef2f2;
    color: #dc2626;
}

.admin-status-badge.inactive:hover {
    background: #ecfdf5;
    color: #059669;
}

.admin-user-row { cursor: pointer; }
.admin-user-row:hover { background: #f1f5f9; }

.admin-default-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #7c3aed;
    background: #f3e8ff;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.admin-actions-cell {
    white-space: nowrap;
}

.admin-actions-cell .btn {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.admin-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-light);
    font-size: 1rem;
}

.admin-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

@media (max-width: 1024px) {
    .llamadas-container,
    .acciones-container {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .llamadas-list {
        max-height: none;
    }

    .stats-bar {
        gap: 16px;
        padding: 10px 16px;
        flex-wrap: wrap;
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 12px 16px;
    }

    .header-left {
        justify-content: center;
    }

    .header-left i {
        font-size: 24px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .header-subtitle {
        font-size: 11px;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .header-user {
        font-size: 12px;
        padding: 3px 10px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-ghost {
        padding: 6px 8px;
        font-size: 14px;
    }

    .nav-tabs {
        top: 101px;
        padding: 0 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    main {
        padding: 12px;
        height: calc(100vh - 120px);
    }

    .board {
        padding: 8px 4px 8px;
        gap: 12px;
    }

    .column {
        min-width: 200px;
        max-width: 200px;
    }

    .column-header {
        padding: 10px 12px;
    }

    .column-header .col-name {
        font-size: 11px;
    }

    .column-body {
        padding: 6px;
    }

    .card {
        padding: 10px;
    }

    .card-name {
        font-size: 13px;
    }

    .card-actions {
        opacity: 1;
    }

    .card-actions button {
        padding: 6px;
        font-size: 13px;
    }

    .card-facturacion {
        font-size: 13px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        max-width: 100%;
        margin: 8px;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 16px 18px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal form {
        padding: 16px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .contactos-grid {
        grid-template-columns: 1fr;
    }

    .nav-tabs {
        top: 91px;
        padding: 0 4px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .tab-btn i {
        font-size: 11px;
    }

    main {
        padding: 8px;
        height: calc(100vh - 108px);
    }

    .board {
        padding: 4px 2px;
        gap: 8px;
    }

    .column {
        min-width: 180px;
        max-width: 180px;
    }

    .column-header {
        padding: 8px 10px;
    }

    .column-header .col-name {
        font-size: 10px;
    }

    .column-body {
        padding: 4px;
    }

    .card {
        padding: 8px;
        margin-bottom: 6px;
    }

    .card-name {
        font-size: 12px;
    }

    .card-facturacion {
        font-size: 12px;
    }

    .card-tag {
        font-size: 9px;
        padding: 1px 6px;
    }

    .llamadas-form-card,
    .llamadas-stats-card,
    .llamadas-list,
    .acciones-form-card,
    .acciones-view,
    .dash-card {
        padding: 12px;
    }

    .dashboard-header h2 {
        font-size: 18px;
    }

    .dashboard-filters {
        width: 100%;
        justify-content: center;
    }

    .dashboard-filters .filter-group select {
        min-width: 80px;
        font-size: 0.75rem;
        padding: 5px 8px;
    }

    .dash-stat .dash-stat-value {
        font-size: 22px;
    }

    .acciones-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .llamada-item {
        padding: 10px 12px;
    }

    .llamada-lead {
        font-size: 13px;
    }

    .llamada-resultado {
        font-size: 10px;
        padding: 2px 8px;
    }

    .modal {
        margin: 4px;
    }

    .modal-header {
        padding: 12px 14px;
    }

    .modal form {
        padding: 12px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .admin-container {
        padding: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .admin-table th,
    .admin-table td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .admin-role-badge {
        font-size: 0.7rem;
        padding: 1px 8px;
    }

    .admin-actions-cell .btn {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .admin-container {
        padding: 8px;
    }
}
