:root {
    /* OLED Base */
    --bg-base: #000000;
    --bg-surface: rgba(15, 15, 15, 0.7); /* Translucent for blur effect */
    --bg-surface-light: rgba(30, 30, 30, 0.8);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b5;
    
    /* Soft Glow Theme */
    --accent-white: #ffffff;
    --soft-purple: rgba(147, 51, 234, 0.4);
    --soft-blue: rgba(59, 130, 246, 0.4);
    
    --glow-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

/* Background Soft Glows */
.glow-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.6;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--soft-purple);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--soft-blue);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', sans-serif;
    margin: 0;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    backdrop-filter: blur(10px); /* Gives a glassmorphism feel on top of the glows */
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--bg-surface);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.sidebar-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.12;
    z-index: 0;
    pointer-events: none;
}
.sidebar-glow.blob-1 {
    width: 250px;
    height: 250px;
    background: #ff00ff;
    top: -50px;
    left: -50px;
}
.sidebar-glow.blob-2 {
    width: 250px;
    height: 250px;
    background: #00ffff;
    bottom: 50px;
    right: -100px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h1 {
    font-size: 1.4rem;
    color: var(--accent-white);
    letter-spacing: -0.5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-white);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.contact-list {
    flex: 1;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.contact-item {
    display: flex;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.contact-item:hover, .contact-item.active {
    background-color: var(--bg-surface-light);
}

.contact-item.active {
    border-left: 3px solid var(--accent-white);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-item.active .avatar {
    background: var(--accent-white);
    color: var(--bg-base);
    box-shadow: var(--glow-shadow);
}

.contact-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.contact-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* ─── Unread Badge & Bell Active ────────────────────────────────────────── */
.unread-pill {
    background: #ff3b30;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    line-height: 1;
}

.btn-bell-active {
    color: #00ff66 !important;
    border-color: rgba(0, 255, 102, 0.4) !important;
    box-shadow: 0 0 12px rgba(0, 255, 102, 0.3) !important;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0b141a; /* WhatsApp Dark Mode BG */
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h2V0h2v20h2V0h2v20h2V0h2v20h2v2H20v-1.5zM0 20h2v20H0V20zm4 0h2v20H4V20zm4 0h2v20H8V20zm4 0h2v20h-2V20zm4 0h2v20h-2V20zm4 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2z' fill='%23ffffff' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
    position: relative;
    z-index: 0;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h2 {
    font-size: 1.25rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background-color: rgba(0, 255, 102, 0.1);
    color: #00ff66;
    border-color: rgba(0, 255, 102, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.2);
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.5);
}
.status-online::before {
    background-color: #00ff66;
    box-shadow: 0 0 8px #00ff66;
}

.status-offline {
    background-color: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.2);
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}
.status-offline::before {
    background-color: #ff4444;
    box-shadow: 0 0 8px #ff4444;
}

.status-reconnecting {
    background-color: rgba(255, 204, 0, 0.1);
    color: #ffcc00;
    border-color: rgba(255, 204, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}
.status-reconnecting::before {
    background-color: #ffcc00;
    box-shadow: 0 0 8px #ffcc00;
}

.message-list {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message.inbound {
    align-self: flex-start;
}

.message.outbound {
    align-self: flex-end;
}

.bubble {
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.inbound .bubble {
    background-color: #202c33;
    border: none;
    border-bottom-left-radius: 2px;
}

.outbound {
    align-items: flex-end;
}

.outbound .bubble {
    background-color: #005c4b;
    border: none;
    border-bottom-right-radius: 2px;
}

.time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.outbound .time {
    align-self: flex-end;
}

/* Chat Input */
.chat-input-area {
    padding: 15px 20px;
    background-color: var(--bg-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    height: 76px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-sizing: border-box;
}

/* Logout Button */
.sidebar-footer {
    margin-top: auto;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: var(--bg-surface);
    height: 76px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.logout-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.4);
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.oled-input {
    flex: 1;
    background-color: var(--bg-surface-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.oled-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
}

.oled-btn {
    background-color: var(--accent-white);
    border: none;
    color: var(--bg-base);
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.oled-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}



/* Contact Loading State */
.contact-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

/* Send button disabled state */
#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Outbound message opacity animation */
.message.outbound {
    animation: fadeIn 0.2s ease;
}
/* Contact Org Badge */
.contact-org-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Settings Page Styles ─────────────────────────────────────────── */
html {
    scrollbar-gutter: stable;
}

body.settings-page {
    position: relative !important;
    display: block !important;
    min-height: 100vh;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.page-wrap {
    position: relative;
    z-index: 1;
    max-width: 840px;
    margin: 0 auto;
    padding: 32px 24px calc(100px + env(safe-area-inset-bottom, 0px));
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    margin-bottom: 28px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
}

.page-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-header-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

/* Tabs: Fixed Equal-Width Pill/Line Bar */
.tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 28px;
}
@media (max-width: 768px) {
    .tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Tab Panels: Fixed min-height to prevent vertical layout jump */
.tab-panel {
    display: none;
    min-height: 520px;
    width: 100%;
    box-sizing: border-box;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Standard Warning Box */
.warn-box {
    background: rgba(255, 204, 0, 0.06);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.83rem;
    color: #ffcc00;
    line-height: 1.6;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.warn-box strong {
    color: #ffe066;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    width: 100%;
}

/* Standardized Cards */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
    width: 100%;
    box-sizing: border-box;
}

.card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    width: 100%;
    box-sizing: border-box;
}

.card-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.card-meta code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-org {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    margin-right: 6px;
}

.del-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(255, 68, 68, 0.25);
    color: #ff6666;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.del-btn:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: #ff4444;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-surface);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 28px;
    width: 100%;
    box-sizing: border-box;
}

/* Standardized Add Form */
.add-form {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

.add-form-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field.span2 {
    grid-column: span 2;
}

.form-field label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-field label small {
    font-weight: 400;
    color: #777;
}

.field-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    height: 42px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

.field-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

input[type="password"].field-input {
    font-family: monospace;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
}

select.field-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select.field-input option {
    background: #111111;
    color: #ffffff;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
}

.save-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 11px 28px;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    height: 42px;
    cursor: pointer;
    transition: all 0.25s;
}

.save-btn:hover {
    background: #e8e8e8;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.info-card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 14px;
}

.info-card h3 {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.info-card .desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.code-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.code-box.green {
    color: #00ff66;
}

.code-box.yellow {
    color: #ffcc00;
}

.info-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.6;
    display: block;
}

.info-note code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffe066;
    font-family: monospace;
}

.events-list {
    list-style: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.events-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.events-list li code {
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.82rem;
}

.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translate(-50%, -80px);
    padding: 14px 28px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999999;
    pointer-events: none;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.success {
    background: #00ff66;
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 255, 102, 0.3);
}

.toast.error {
    background: #ff4444;
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.3);
}

@media (max-width: 650px) {
    .tabs {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-field.span2 {
        grid-column: span 1;
    }
}

/* ─── Glassmorphism Modal Dialog ───────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-header h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 9px 18px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-modal-danger {
    background: #ff4444;
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-family: 'Sora', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
    transition: all 0.2s;
}

.btn-modal-danger:hover {
    background: #ff2222;
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.6);
}

/* ─── 24-Hour Service Window LED Dot & Badge ────────────────────────────── */
.window-led {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.window-led-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.led-active .window-led-dot {
    background: #00ff66;
    box-shadow: 0 0 8px #00ff66, 0 0 12px rgba(0, 255, 102, 0.4);
}
.led-warning .window-led-dot {
    background: #ffaa00;
    box-shadow: 0 0 8px #ffaa00, 0 0 12px rgba(255, 170, 0, 0.4);
}
.led-expired .window-led-dot {
    background: #ff4444;
    box-shadow: 0 0 8px #ff4444, 0 0 12px rgba(255, 68, 68, 0.4);
}
.contact-item .window-led-dot {
    margin-left: auto;
}

/* ─── Message Status Check Ticks ────────────────────────────────────────── */
.msg-time-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}
.msg-ticks {
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: -1px;
}
.tick-sent { color: rgba(255, 255, 255, 0.6); }
.tick-delivered { color: rgba(255, 255, 255, 0.6); }
.tick-read { 
    color: #00e5ff; 
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.6); 
}

/* ─── Chat Media Renderers ──────────────────────────────────────────────── */
.chat-media-img {
    max-width: 240px;
    max-height: 240px;
    border-radius: 8px;
    display: block;
    margin-bottom: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-media-audio {
    max-width: 260px;
    height: 38px;
    margin-top: 4px;
}
.doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
    margin-bottom: 4px;
}
.doc-card:hover {
    background: rgba(0, 0, 0, 0.4);
}
.doc-icon {
    color: var(--accent-white);
    flex-shrink: 0;
}
.doc-info {
    flex: 1;
    overflow: hidden;
}
.doc-info strong {
    font-size: 0.88rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-info small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ─── + Mulai Chat Baru Button & Modal ──────────────────────────────────── */
.btn-icon-pulse {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--accent-white);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-icon-pulse:hover {
    background: var(--accent-white);
    color: var(--bg-base);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}
.btn-close-modal {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}
.btn-close-modal:hover {
    color: #fff;
}

/* ─── Responsive Mobile Layout (Inbox Slider) ───────────────────────────── */
.btn-mobile-back {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.btn-mobile-back:hover {
    background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 768px) {
    .app-container {
        position: relative;
        overflow: hidden;
        height: 100dvh;
    }
    .sidebar {
        width: 100% !important;
        flex: none;
        height: 100%;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .chat-area {
        width: 100% !important;
        flex: none;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2;
        display: flex;
        flex-direction: column;
    }
    .app-container.mobile-chat-active .sidebar {
        transform: translateX(-100%);
    }
    .app-container.mobile-chat-active .chat-area {
        transform: translateX(0);
    }
    .btn-mobile-back {
        display: inline-flex;
    }
    .message {
        max-width: 85%;
    }
    .chat-input-area {
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) 14px;
        gap: 10px;
        height: auto;
        min-height: 76px;
    }
    .oled-input {
        font-size: 0.95rem;
    }
}

/* ─── Channel Tabs Bar (above contact list) ─────────────────────────────── */
.channel-tabs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.channel-scroll-arrow {
    background: rgba(15, 23, 28, 0.95);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 100%;
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.2s;
    flex-shrink: 0;
}
.channel-scroll-arrow:hover {
    color: #fff;
    background: rgba(30, 45, 55, 0.98);
}
.channel-scroll-arrow.left {
    left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 6px 0 12px rgba(0, 0, 0, 0.75);
}
.channel-scroll-arrow.right {
    right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -6px 0 12px rgba(0, 0, 0, 0.75);
}
.channel-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    scroll-behavior: smooth;
    flex: 1;
}
.channel-tabs-bar::-webkit-scrollbar {
    display: none;
}
.channel-tab-btn {
    background: #0f171c;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-tab-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}
.channel-tab-btn.active {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--accent-white);
    color: var(--accent-white);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
}

/* ─── Buku Kontak Table & Action Icons ──────────────────────────────────── */
.btn-icon-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon-action:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.oled-table tbody tr {
    transition: background 0.2s;
}
.oled-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ─── Mobile Top Logout Icon (Power-Off) ────────────────────────────────── */
.mobile-top-logout {
    color: #ff3b30;
    display: none; /* Hidden on desktop */
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    filter: drop-shadow(0 0 6px rgba(255, 59, 48, 0.4));
}
.mobile-top-logout:hover {
    color: #ff6b63;
    filter: drop-shadow(0 0 10px rgba(255, 59, 48, 0.8));
    transform: scale(1.15);
}

@media (max-width: 768px) {
    .mobile-top-logout {
        display: flex !important;
    }
    .sidebar-footer {
        display: none !important;
    }
}







