/* ==========================================
   CSS SYSTEM: chat.hcaborca.com
   Premium WhatsApp Web CRM Clone
   ========================================== */

:root {
    --font-primary: 'Outfit', sans-serif;
    
    /* Dark Theme Variables (Default) */
    --bg-app: #0c1317;
    --bg-sidebar: #111b21;
    --bg-chat: #0b141a;
    --bg-chat-header: #202d33;
    --bg-chat-bubble-out: #005c4b;
    --bg-chat-bubble-in: #202d33;
    --bg-active-chat: #2a3942;
    --bg-hover: #202d33;
    --bg-border: #222d34;
    --text-primary: #e9edef;
    --text-secondary: #8696a0;
    --text-message-time: #667781;
    --text-bubble-out: #e9edef;
    --text-bubble-in: #e9edef;
    --accent-color: #00a884;
    --accent-color-hover: #008f72;
    --danger-color: #f15c5c;
    --success-color: #00e676;
    --warning-color: #ffb300;
    
    /* UI Specifics */
    --shadow-main: 0 4px 20px rgba(0, 0, 0, 0.3);
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 24px;
    --transition-speed: 0.25s;
}

/* Light Theme Variables overrides */
.light-theme {
    --bg-app: #eae6df;
    --bg-sidebar: #ffffff;
    --bg-chat: #efeae2;
    --bg-chat-header: #f0f2f5;
    --bg-chat-bubble-out: #d9fdd3;
    --bg-chat-bubble-in: #ffffff;
    --bg-active-chat: #f0f2f5;
    --bg-hover: #f5f6f6;
    --bg-border: #e9edef;
    --text-primary: #111b21;
    --text-secondary: #667781;
    --text-message-time: #667781;
    --text-bubble-out: #111b21;
    --text-bubble-in: #111b21;
    --accent-color: #008069;
    --accent-color-hover: #005e4d;
    --shadow-main: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-border: border-box;
    box-sizing: border-box;
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* MAIN LAYOUT CONTAINER */
.app-container {
    width: 100%;
    height: 100%;
    max-width: 1600px;
    max-height: 900px;
    display: flex;
    box-shadow: var(--shadow-main);
    overflow: hidden;
    background-color: var(--bg-sidebar);
    transition: background-color var(--transition-speed);
}

/* On ultra wide, make it centered with a tiny border */
@media (min-width: 1600px) {
    .app-container {
        height: 95vh;
        border-radius: var(--border-radius-md);
    }
}

/* HEADER BASE */
.panel-header {
    height: 60px;
    background-color: var(--bg-chat-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-right: 1px solid var(--bg-border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid var(--accent-color);
}

/* SIDEBAR IZQUIERDO: Chats, Poblados */
.sidebar-panel {
    width: 350px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--bg-border);
    z-index: 10;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.status-dot-online {
    color: var(--success-color);
    font-size: 8px;
    margin-right: 4px;
}

/* ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.action-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* SEARCH BAR */
.search-bar-container {
    padding: 8px 12px;
    border-bottom: 1px solid var(--bg-border);
}

.search-input-wrapper {
    background-color: var(--bg-chat-header);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    padding: 6px 12px;
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 10px;
    font-size: 14px;
}

.search-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 14px;
}

.search-input-wrapper input::placeholder {
    color: var(--text-secondary);
}

/* TABS */
.sidebar-tabs {
    display: flex;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--bg-border);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: color var(--transition-speed), border var(--transition-speed);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

/* LIST CONTAINERS */
.list-container {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.list-container.active {
    display: block;
}

/* CHATS LIST CLONE */
.chats-list {
    list-style: none;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-border);
    transition: background-color var(--transition-speed);
}

.chat-item:hover {
    background-color: var(--bg-hover);
}

.chat-item.active {
    background-color: var(--bg-active-chat);
}

.chat-item-meta {
    flex: 1;
    min-width: 0;
}

.chat-item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-item-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.chat-item-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

/* STATUS LIGHTS ON CHATS LIST */
.status-light {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 6px;
    flex-shrink: 0;
}

.status-light.active {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-light.suspended {
    background-color: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-color);
}

.status-light.unlinked {
    background-color: var(--warning-color);
    box-shadow: 0 0 8px var(--warning-color);
}

/* POBLADOS ACCORDION */
.poblados-accordion {
    padding: 12px;
}

.poblado-group {
    margin-bottom: 12px;
    border: 1px solid var(--bg-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.poblado-header {
    background-color: var(--bg-chat-header);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.poblado-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poblado-title {
    font-size: 14px;
    font-weight: 500;
}

.poblado-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-badge {
    background-color: var(--accent-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.btn-megaphone {
    background: transparent;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 13px;
    transition: color var(--transition-speed);
}

.btn-megaphone:hover {
    color: var(--accent-color-hover);
}

.poblado-content {
    display: none;
    padding: 8px;
    background-color: var(--bg-sidebar);
}

.poblado-group.open .poblado-content {
    display: block;
}

.sectorial-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.sectorial-item:hover {
    background-color: var(--bg-hover);
}

/* CENTRAL CHAT PANEL */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-chat);
    position: relative;
    border-right: 1px solid var(--bg-border);
}

.chat-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-chat);
    padding: 40px;
    z-index: 5;
}

.placeholder-content {
    max-width: 500px;
}

.placeholder-icon-wrapper {
    margin-bottom: 24px;
}

.placeholder-logo {
    font-size: 90px;
    color: var(--accent-color);
    filter: drop-shadow(0 4px 15px rgba(0, 168, 132, 0.2));
}

.placeholder-title {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 12px;
}

.placeholder-text {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.placeholder-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background-color: var(--bg-chat-header);
    padding: 6px 14px;
    border-radius: 20px;
}

/* ACTIVE CHAT AREA */
.chat-active-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.chat-header {
    height: 60px;
    background-color: var(--bg-chat-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--bg-border);
    z-index: 2;
}

.chat-header-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.chat-client-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-client-title-row {
    display: flex;
    align-items: center;
}

.chat-client-name {
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-client-status {
    font-size: 12px;
    color: var(--text-secondary);
}

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

/* CHAT MESSAGES AREA */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 30px;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-blend-mode: overlay;
    background-color: var(--bg-chat);
    opacity: 0.95;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* MESSAGE BUBBLES */
.message-bubble {
    max-width: 60%;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    position: relative;
    display: flex;
    flex-direction: column;
    font-size: 14.5px;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    animation: bubbleAppear 0.2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes bubbleAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-bubble.out {
    align-self: flex-end;
    background-color: var(--bg-chat-bubble-out);
    color: var(--text-bubble-out);
    border-top-right-radius: 0;
}

.message-bubble.in {
    align-self: flex-start;
    background-color: var(--bg-chat-bubble-in);
    color: var(--text-bubble-in);
    border-top-left-radius: 0;
}

.message-text {
    line-height: 1.45;
    margin-bottom: 4px;
}

.message-meta {
    display: flex;
    align-self: flex-end;
    align-items: center;
    gap: 4px;
}

.message-time {
    font-size: 10px;
    color: var(--text-message-time);
}

.message-status-ticks {
    font-size: 11px;
    color: var(--text-secondary);
}

.message-status-ticks.blue {
    color: #53bdeb;
}

/* ATTACHMENT IN BUBBLE */
.message-attachment-card {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    gap: 12px;
    margin-bottom: 6px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.attachment-icon {
    font-size: 24px;
    color: var(--accent-color);
}

.attachment-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.attachment-filename {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 11px;
    color: var(--text-secondary);
}

/* CHAT FOOTER / INPUT */
.chat-footer {
    height: 60px;
    background-color: var(--bg-chat-header);
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 12px;
    z-index: 2;
}

.footer-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.footer-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.message-input-wrapper {
    flex: 1;
    background-color: var(--bg-app);
    border-radius: var(--border-radius-sm);
    padding: 2px 16px;
    display: flex;
    align-items: center;
}

.message-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 15px;
    height: 38px;
}

.send-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-speed), transform 0.1s;
}

.send-btn:hover {
    background-color: var(--accent-color-hover);
}

.send-btn:active {
    transform: scale(0.95);
}

/* CRM RIGHT PANEL */
.crm-panel {
    width: 400px;
    min-width: 360px;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--bg-border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed), transform var(--transition-speed);
    z-index: 10;
}

.crm-panel.collapsed {
    width: 0;
    min-width: 0;
    transform: translateX(400px);
    border-left: none;
    position: absolute;
    right: 0;
    height: 100%;
}

.crm-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-primary);
}

.crm-section {
    background-color: var(--bg-chat-header);
    border-radius: var(--border-radius-md);
    padding: 16px;
    border: 1px solid var(--bg-border);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-border);
    padding-bottom: 8px;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 13.5px;
    color: var(--text-primary);
}

.info-value.text-bold {
    font-weight: 600;
}

/* ANTENNA SIGNAL CARD */
.signal-card {
    background-color: var(--bg-sidebar);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    border: 1px solid var(--bg-border);
}

.signal-gauge {
    height: 28px;
    background-color: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.gauge-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--danger-color), var(--success-color));
    transition: width 0.5s ease-out;
}

.signal-value {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.signal-details {
    display: flex;
    justify-content: space-between;
}

.signal-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 13px;
    font-weight: 500;
}

.refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
}

.refresh-btn:hover {
    color: var(--accent-color);
}

/* ACTION SWITCHES & FORM */
.action-card {
    background-color: var(--bg-sidebar);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    border: 1px solid var(--bg-border);
    margin-bottom: 14px;
}

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

.action-info h4 {
    font-size: 13px;
    font-weight: 600;
}

.action-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.action-meta {
    margin-top: 8px;
    font-size: 11px;
    color: var(--warning-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Switch Toggle Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-hover);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* PAYMENT FORM */
.payment-form-card {
    background-color: var(--bg-sidebar);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    border: 1px solid var(--bg-border);
}

.payment-form-card h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 11.5px;
    color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
    background-color: var(--bg-chat-header);
    border: 1px solid var(--bg-border);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
    transition: border-color var(--transition-speed);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent-color);
}

.primary-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    transition: background var(--transition-speed);
}

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

.secondary-btn {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--bg-border);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background var(--transition-speed);
}

.secondary-btn:hover {
    background-color: var(--bg-border);
}

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

/* CRM ALERT BOX */
.crm-alert {
    display: flex;
    gap: 12px;
    background-color: rgba(255, 179, 0, 0.15);
    border: 1px solid var(--warning-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
}

.crm-alert.warning {
    border-color: var(--warning-color);
    background-color: rgba(255, 179, 0, 0.1);
}

.alert-icon {
    font-size: 20px;
    color: var(--warning-color);
}

.alert-body h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-body p {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* MODAL / DIALOG OVERLAYS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity var(--transition-speed);
}

.modal-card {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--bg-border);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-main);
    animation: modalAppear 0.3s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes modalAppear {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--bg-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* MODAL RESULTS LIST */
.modal-results-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--bg-border);
    border-radius: var(--border-radius-sm);
}

.modal-results-list {
    list-style: none;
}

.modal-results-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    justify-content: space-between;
}

.modal-results-item:hover {
    background-color: var(--bg-hover);
}

/* SAFETY DELAY BROADCAST */
.broadcast-target-info {
    font-size: 13.5px;
    background-color: var(--bg-chat-header);
    padding: 10px;
    border-radius: var(--border-radius-sm);
}

.broadcast-safety-alert {
    background-color: rgba(0, 168, 132, 0.1);
    border: 1px solid var(--accent-color);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
}

.broadcast-progress-wrapper {
    margin-top: 12px;
}

.progress-bar-bg {
    height: 10px;
    background-color: var(--bg-hover);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.progress-text {
    font-size: 11px;
    margin-top: 4px;
    text-align: right;
    color: var(--text-secondary);
}

/* SETTINGS DROPDOWN */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--bg-border);
    min-width: 160px;
    box-shadow: var(--shadow-main);
    z-index: 50;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.dropdown-content button {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.dropdown-content button:hover {
    background-color: var(--bg-hover);
}

.dropdown.open .dropdown-content {
    display: block;
}

/* UTILITY CLASSES */
.hidden {
    display: none !important;
}

/* RESPONSIVE LAYOUT (ADAPTABILIDAD DE RESOLUCIONES) */

/* Tablets (1024px and below) */
@media (max-width: 1024px) {
    .crm-panel {
        width: 320px;
        min-width: 320px;
    }
}

/* Mobile & Small Tablets (768px and below) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: row;
    }
    
    /* single column mode - hide other panels */
    .sidebar-panel {
        width: 100%;
        min-width: 100%;
    }
    
    .chat-panel {
        display: none;
        width: 100%;
    }
    
    /* When active chat is shown, sidebar is hidden */
    .app-container.chat-open .sidebar-panel {
        display: none;
    }
    
    .app-container.chat-open .chat-panel {
        display: flex;
    }
    
    /* Collapsed CRM hides completely and overlays when open */
    .crm-panel {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 100%;
        max-width: 100%;
        z-index: 200;
    }
    
    .crm-panel.collapsed {
        transform: translateX(100%);
    }
    
    /* Add back button for mobile header */
    .chat-header::before {
        content: "\f060"; /* FontAwesome Left Arrow */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 18px;
        color: var(--text-secondary);
        margin-right: 16px;
        cursor: pointer;
    }
}
