* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f0f2f5;
    height: 100vh;
    overflow: hidden;
    color: #333;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar Nav (Far Left) */
.sidebar-nav {
    width: 70px;
    background-color: #5c9174;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 10;
}

.nav-brand {
    margin-bottom: 40px;
}

.nav-menu {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.nav-menu li {
    width: 100%;
    display: flex;
    justify-content: center;
}

.nav-menu li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 20px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-menu li a:hover, .nav-menu li.active a {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Contacts Sidebar */
.contacts-sidebar {
    width: 320px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.user-profile-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: #f7f9fc;
    border-bottom: 1px solid #e0e0e0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.user-info {
    flex: 1;
}

.user-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.status {
    font-size: 12px;
    color: #888;
}

.header-actions {
    display: flex;
    gap: 15px;
    color: #666;
    cursor: pointer;
}

.search-container {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.search-bar {
    background-color: #f0f2f5;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 8px 15px;
}

.search-icon {
    color: #999;
    margin-right: 10px;
    font-size: 14px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 13px;
}

.contacts-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    font-weight: 500;
}

.filter-left {
    display: flex;
    align-items: center;
}

.badge {
    background-color: #5c9174;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 5px;
}

.filter-right {
    display: flex;
    gap: 10px;
}

.icon-btn {
    border: none;
    background: #f0f2f5;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn.active {
    background-color: #5c9174;
    color: white;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.contact-item:hover {
    background-color: #f7f9fc;
}

.contact-item.active {
    background-color: #f2f7f4;
    border-left: 3px solid #5c9174;
}

.contact-details {
    flex: 1;
    min-width: 0;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.contact-header h4 {
    font-size: 14px;
    margin: 0;
    color: #222;
}

.time {
    font-size: 11px;
    color: #888;
}

.contact-message {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-gray { color: #aaa; }
.text-blue { color: #34b7f1; }
.text-green { color: #5c9174; }

/* Main Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #ebe5de; /* Fondo tipo wp/telegram */
    background-image: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M20 20.5V18H0v2.5h20v-2.5h20v2.5H20zM0 20.5h40V40H0V20.5z" fill="%23dcd5cc" fill-opacity="0.4" fill-rule="evenodd"/></svg>');
}

.chat-header {
    background-color: #ffffff;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 2;
}

.assign-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.assign-info .label {
    font-size: 13px;
    color: #888;
}

.dropdown-btn {
    border: 1px solid #e0e0e0;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}

.resolve-btn {
    background-color: #87d37c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.date-sep {
    text-align: center;
    margin: 20px 0;
}

.date-sep span {
    background-color: #e5f1f7;
    color: #555;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

.message {
    display: flex;
    margin-bottom: 2px;
}

.message.incoming {
    justify-content: flex-start;
}

.message.outgoing {
    justify-content: flex-end;
}

.bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.message.incoming .bubble {
    background-color: #ffffff;
    border-top-left-radius: 0;
}

.message.outgoing .bubble {
    background-color: #e2f7cb;
    border-top-right-radius: 0;
}

.bubble p {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 4px;
}

.bubble .time {
    display: block;
    text-align: right;
    font-size: 10px;
    color: #999;
}

.quick-replies-container {
    background: #fcfbf9;
    padding: 10px 20px;
    border-top: 1px solid #e0e0e0;
}

.quick-replies {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quick-reply-item {
    font-size: 13px;
    color: #666;
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #eee;
    cursor: pointer;
    width: fit-content;
}

.quick-reply-item:hover {
    background: #f0f0f0;
}

.chat-input-area {
    background-color: #f0f2f5;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-top: 1px solid #e0e0e0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    flex: 1;
    border-radius: 24px;
    padding: 5px 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#message-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 15px;
    background: transparent;
}

.smiley-btn, .send-btn {
    background: transparent;
    color: #888;
    font-size: 20px;
    width: 40px;
    height: 40px;
}
.smiley-btn:hover, .send-btn:hover {
    color: #555;
}

/* Right Panel */
.right-panel {
    width: 300px;
    background-color: #ffffff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.right-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px;
    border-bottom: 1px solid #e0e0e0;
}

.right-header h2 {
    font-size: 16px;
    font-weight: 500;
    color: #222;
    margin: 0;
}

.close-btn {
    color: #888;
    cursor: pointer;
    font-size: 18px;
}

.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.client-profile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
}

.avatar-container {
    position: relative;
    margin-bottom: 15px;
}

.large-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.status-dot {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    background-color: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}

.profile-details {
    width: 100%;
}

.profile-details h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.border-bottom {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.info-row .label {
    color: #888;
    width: 80px;
}

.info-row .value {
    color: #222;
    flex: 1;
    text-align: right;
}

.margin-b {
    margin-bottom: 15px;
}

.add-link {
    color: #4caf50;
    text-decoration: none;
    font-size: 12px;
}

.panel-section h4 {
    font-size: 14px;
    color: #5c9174;
    margin-bottom: 15px;
    font-weight: 600;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
}
.user-chip img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.timeline {
    position: relative;
}

.timeline-date {
    background: #e5f1f7;
    color: #555;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    margin-bottom: 15px;
    margin-top: 10px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.timeline-item img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.timeline-item p {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.timeline-item p strong {
    color: #222;
}

.typing-indicator .bubble {
    background-color: #ffffff;
    color: #666;
    font-style: italic;
}
