* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0056a6 0%, #003d7a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen {
    display: none;
    width: 100%;
    max-width: 340px;
}

.screen.active {
    display: block;
}

/* ============================================
   LOGIN
   ============================================ */

.login-box {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
    text-align: center;
    margin-bottom: 25px;
}

.logo i {
    font-size: 50px;
    background: linear-gradient(135deg, #0056a6, #00a86b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    margin-top: 10px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: #0056a6;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #0056a6;
    box-shadow: 0 0 0 3px rgba(0, 86, 166, 0.1);
}

/* ============================================
   BOTONES GENERALES
   ============================================ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #0056a6, #00a86b);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 86, 166, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   LAYOUT PRINCIPAL: Teléfono + Panel Leads
   ============================================ */

.main-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.phone-column {
    width: 340px;
    min-width: 340px;
    max-width: 340px;
    border-right: 2px solid #e0e0e0;
    overflow-y: auto;
    background: #fff;
}

.leads-column {
    flex: 1;
    overflow-y: auto;
    background: #f4f7f6;
}

/* ============================================
   TELÉFONO COMPACTO
   ============================================ */

.phone-container {
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header con CID - COMPACTO */
.phone-header {
    background: linear-gradient(135deg, #0056a6, #003d7a);
    color: white;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cid-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cid-name {
    font-size: 13px;
    font-weight: 600;
}

.cid-extension {
    font-size: 10px;
    opacity: 0.8;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.dot.online {
    background: #00a86b;
    box-shadow: 0 0 8px #00a86b;
    animation: pulse 2s infinite;
}

.dot.offline {
    background: #dc3545;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.icon-btn.active {
    background: #dc3545;
}

/* Tabs de navegación - COMPACTOS */
.phone-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    flex: 1;
    padding: 8px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.tab i {
    font-size: 14px;
}

.tab.active {
    color: #0056a6;
    background: white;
    border-bottom: 2px solid #0056a6;
}

.tab:hover:not(.active) {
    background: #e9ecef;
}

/* Tab content */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

/* Display - COMPACTO */
.display {
    padding: 10px 12px;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.call-state {
    color: #0056a6;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.display-number {
    font-size: 22px;
    font-weight: 300;
    color: #333;
    min-height: 32px;
    word-break: break-all;
    padding: 6px;
    border: 2px dashed transparent;
    border-radius: 6px;
    outline: none;
    cursor: text;
    transition: all 0.2s;
}

.display-number:focus {
    border-color: #0056a6;
    background: white;
}

.display-number:empty::before {
    content: "Escribe un número...";
    color: #aaa;
    font-size: 13px;
}

.display-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.display-btn {
    background: #e9ecef;
    border: none;
    color: #495057;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.display-btn:hover {
    background: #0056a6;
    color: white;
}

.call-timer {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
}

/* Dialpad - COMPACTO */
.dialpad {
    padding: 10px;
}

.dialpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 240px;
    margin: 0 auto;
}

.dial-btn {
    aspect-ratio: 1.3;
    border: none;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dial-btn small {
    font-size: 8px;
    color: #888;
    letter-spacing: 1.5px;
    margin-top: 1px;
}

.dial-btn:hover {
    background: #0056a6;
    color: white;
    transform: scale(1.03);
}

.dial-btn:active {
    transform: scale(0.97);
}

/* Call Controls - COMPACTO */
.call-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 10px;
}

.btn-call {
    background: linear-gradient(135deg, #00a86b, #28a745);
    color: white;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-call:hover:not(:disabled) {
    transform: scale(1.05);
}

.btn-hangup {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-hangup:hover:not(:disabled) {
    transform: scale(1.05);
}

.btn-call:disabled, .btn-hangup:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Controles en llamada - COMPACTO */
.in-call-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.ctrl-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: #0056a6;
}

.ctrl-btn i {
    font-size: 14px;
}

.ctrl-btn:hover {
    background: #e9ecef;
}

.ctrl-btn.active {
    background: #00a86b;
    color: white;
    border-color: #00a86b;
}

.ctrl-btn .tooltip {
    display: none;
}

/* Volume Control - COMPACTO */
.volume-control {
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-control label {
    font-size: 11px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}

.volume-control label i {
    color: #0056a6;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #0056a6;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #0056a6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-value {
    font-size: 11px;
    color: #555;
    min-width: 35px;
    text-align: right;
}

.hidden {
    display: none !important;
}

/* ============================================
   HISTORIAL DE LLAMADAS
   ============================================ */

.history-panel {
    padding: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.history-panel h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-panel h3 i {
    color: #0056a6;
    margin-right: 6px;
}

.history-clear {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 11px;
    padding: 4px 8px;
}

.history-clear:hover {
    text-decoration: underline;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.history-item.incoming {
    border-left-color: #00a86b;
}

.history-item.outgoing {
    border-left-color: #0056a6;
}

.history-item.missed {
    border-left-color: #dc3545;
}

.history-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.history-item.incoming .history-icon {
    color: #00a86b;
}

.history-item.outgoing .history-icon {
    color: #0056a6;
}

.history-item.missed .history-icon {
    color: #dc3545;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-number {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    font-size: 10px;
    color: #888;
    display: flex;
    gap: 6px;
    margin-top: 1px;
}

.history-call-btn {
    background: #0056a6;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
}

.history-call-btn:hover {
    background: #00a86b;
}

.history-empty {
    text-align: center;
    padding: 25px;
    color: #888;
    font-size: 12px;
}

/* ============================================
   CONTACTOS
   ============================================ */

.contacts-panel {
    padding: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.contacts-header h3 {
    color: #333;
    font-size: 13px;
}

.contacts-header h3 i {
    color: #0056a6;
    margin-right: 6px;
}

.contacts-search {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}

.contacts-search:focus {
    outline: none;
    border-color: #0056a6;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.contact-item:hover {
    background: #e9ecef;
}

.contact-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0056a6, #00a86b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.contact-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-number {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
}

.contact-actions {
    display: flex;
    gap: 4px;
}

.contact-btn {
    background: white;
    border: 1px solid #e0e0e0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.contact-btn.call {
    color: #00a86b;
}

.contact-btn.call:hover {
    background: #00a86b;
    color: white;
}

.contact-btn.edit {
    color: #0056a6;
}

.contact-btn.edit:hover {
    background: #0056a6;
    color: white;
}

.contact-btn.delete {
    color: #dc3545;
}

.contact-btn.delete:hover {
    background: #dc3545;
    color: white;
}

.contacts-empty {
    text-align: center;
    padding: 25px;
    color: #888;
    font-size: 12px;
}

/* ============================================
   PREFERENCIAS
   ============================================ */

.prefs-panel {
    padding: 12px;
}

.prefs-panel h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 13px;
}

.prefs-panel h3 i {
    color: #0056a6;
    margin-right: 6px;
}

.pref-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pref-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pref-label i {
    color: #0056a6;
}

.pref-description {
    font-size: 10px;
    color: #888;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #0056a6, #00a86b);
}

input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* ============================================
   MODALES
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    max-width: 360px;
    width: 90%;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content.incoming {
    text-align: center;
    padding: 40px 30px;
    min-width: 300px;
}

.caller-info {
    margin-bottom: 30px;
}

.caller-avatar {
    font-size: 80px;
    margin-bottom: 20px;
    color: white;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.incoming-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.incoming-actions .btn {
    min-width: 140px;
    padding: 15px 30px;
    font-size: 16px;
    position: relative;
    z-index: 10;
}

.incoming-actions .btn-hangup {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.incoming-actions .btn-call {
    background: linear-gradient(135deg, #28a745, #218838);
}

.transfer-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.tab-btn.active {
    border-color: #0056a6;
    background: #0056a6;
    color: white;
}

#transferNumber, #contactName, #contactNumber {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-actions .btn {
    flex: 1;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s;
    min-width: 220px;
    font-size: 13px;
}

@keyframes slideInRight {
    from { transform: translateX(400px); }
    to { transform: translateX(0); }
}

.toast.success {
    border-left: 4px solid #00a86b;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #0056a6;
}

.toast i {
    font-size: 18px;
}

.toast.success i { color: #00a86b; }
.toast.error i { color: #dc3545; }
.toast.info i { color: #0056a6; }

/* ============================================
   CORRECCIÓN: phoneScreen activo
   ============================================ */

#phoneScreen.screen.active {
    max-width: 100%;
    width: 100%;
    height: 100vh;
}

#phoneScreen .phone-container {
    height: 100%;
    border-radius: 0;
}

#phoneScreen .main-layout {
    height: 100%;
}

#phoneScreen .phone-column {
    display: flex;
    flex-direction: column;
}

#phoneScreen .phone-column .phone-container {
    flex: 1;
    overflow-y: auto;
}

/* ============================================
   PANEL DE LEADS
   ============================================ */

.leads-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.leads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.leads-header h2 {
    margin: 0;
    color: #0056b3;
    font-size: 22px;
}

.leads-agent-info {
    color: #666;
    font-size: 14px;
}

/* Sub-tabs del panel */
.leads-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.leads-tab {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: 0.3s;
}

.leads-tab:hover {
    background: #f0f0f0;
}

.leads-tab.active {
    background: #0056b3;
    color: white;
    border-color: #0056b3;
}

.leads-tab-content {
    display: none;
}

.leads-tab-content.active {
    display: block;
}

.lead-data {
    color: #555;
    margin: 6px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-data i {
    width: 18px;
    color: #00a896;
    text-align: center;
}

/* Estado del dialer */
.dialer-state {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.dialer-icon {
    font-size: 60px;
    color: #00a896;
    margin-bottom: 20px;
}

.dialer-state h3 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 20px;
}

.dialer-state p {
    color: #666;
    margin-bottom: 25px;
}

/* Botón iniciar dialer */
.btn-start-dialer {
    background: linear-gradient(135deg, #00a896, #008c7d);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 168, 150, 0.4);
    transition: transform 0.2s;
}

.btn-start-dialer:hover {
    transform: scale(1.05);
}

/* Ficha del lead */
.lead-card {
    text-align: left;
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.lead-badge {
    background: #0056b3;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.lead-counter {
    color: #999;
    font-size: 14px;
}

.lead-name {
    font-size: 24px;
    color: #333;
    margin: 0 0 15px 0;
}

.lead-phone {
    font-size: 18px;
    color: #0056b3;
    margin: 10px 0;
}

.lead-city, .lead-state {
    color: #666;
    margin: 8px 0;
}

.lead-card i {
    width: 20px;
    color: #00a896;
}

/* Botón llamar */
.btn-llamar {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    transition: transform 0.2s;
}

.btn-llamar:hover {
    transform: scale(1.02);
}

.btn-llamar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Tipificación */
.tipificar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.tip-btn {
    padding: 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: transform 0.2s;
}

.tip-btn:hover {
    transform: scale(1.05);
}

.tip-btn.venta { background: linear-gradient(135deg, #28a745, #218838); }
.tip-btn.agendar { background: linear-gradient(135deg, #ffc107, #e0a800); color: #333; }
.tip-btn.no-contesta { background: linear-gradient(135deg, #fd7e14, #e8590c); }
.tip-btn.no-interesa { background: linear-gradient(135deg, #dc3545, #c82333); }

.tip-btn i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

.tip-btn.otro {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.tip-btn.otro:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
}

/* Botón eliminar agendado */
.btn-delete-scheduled {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
    z-index: 10;
}

.btn-delete-scheduled:hover {
    transform: scale(1.1);
    background: #c82333;
}

/* Listas */
.leads-list {
    padding: 10px;
}

.empty-msg {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

.empty-msg i {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

/* ============================================
   RESPONSIVE: Móvil
   ============================================ */

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .phone-column {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .leads-column {
        width: 100%;
    }
    
    .tipificar-buttons {
        grid-template-columns: 1fr;
    }
    
    .rendimiento-widget {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
}

/* ============================================
   WIDGET DE RENDIMIENTO
   ============================================ */

.rendimiento-widget {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.rendimiento-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.rendimiento-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.rendimiento-info {
    flex: 1;
}

.rendimiento-number {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.rendimiento-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    text-transform: uppercase;
}

/* ============================================
   BOTÓN NUEVA VENTA (Header)
   ============================================ */

.btn-manual-sale {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-manual-sale:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* ============================================
   BOTÓN REGISTRAR VENTA (Durante llamada)
   ============================================ */

.btn-sale-during-call {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    transition: all 0.3s;
    animation: pulse-green 2s infinite;
}

.btn-sale-during-call:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(40, 167, 69, 0.7); }
}

/* ============================================
   FORMULARIO DE VENTA
   ============================================ */

#saleForm .form-group {
    margin-bottom: 12px;
}

#saleForm label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 600;
    font-size: 13px;
}

#saleForm label i {
    color: #0056b3;
    margin-right: 5px;
}

#saleForm input,
#saleForm select,
#saleForm textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

#saleForm input:focus,
#saleForm select:focus,
#saleForm textarea:focus {
    outline: none;
    border-color: #0056b3;
}

#saleForm h4 {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
    margin-top: 20px;
}

/* Secciones colapsables del formulario */
.form-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: white;
}

.form-section h4 {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
}

.form-section-content {
    margin-top: 15px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.form-section-content.collapsed {
    max-height: 0;
    margin-top: 0;
}

.form-section h4 .fa-chevron-down {
    transition: transform 0.3s;
}

.form-section h4 .fa-chevron-down.rotated {
    transform: rotate(180deg);
}

/* ============================================
   RESPONSIVE EXTRA - PANTALLAS MUY PEQUEÑAS
   ============================================ */

@media (max-width: 480px) {
    .screen {
        max-width: 100%;
    }
    
    .dial-btn {
        font-size: 16px;
    }
    
    .display-number {
        font-size: 20px;
    }
    
    .ctrl-btn {
        font-size: 9px;
    }
    
    .ctrl-btn i {
        font-size: 12px;
    }
    
    .btn-call, .btn-hangup {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}


/* Botón Cancelar Lead */
#btnCancelLead {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
}

#btnCancelLead:hover {
    background: #5a6268;
}

#btnCancelLead:active {
    transform: scale(0.98);
}