
/* =========================================
   ZEVORA MESSENGER
   Coffee / Cream Design System
========================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');


/* =========================================
   1. VARIABLES
========================================= */

:root {
    --bg-main: #faf8f4;
    --bg-sidebar: #f5f1e9;
    --bg-card: #fffdf9;
    --bg-hover: #eee8de;

    --coffee-dark: #38271e;
    --coffee: #694a36;
    --coffee-medium: #89664c;
    --coffee-light: #b28c6c;
    --caramel: #d1aa82;

    --text-primary: #392a21;
    --text-secondary: #8c7d70;
    --text-muted: #b3a699;

    --border: #e9e1d7;
    --border-light: #f0ebe4;

    --success: #6d9778;
    --danger: #bd7164;

    --shadow-small: 0 2px 8px rgba(62, 42, 28, 0.04);
    --shadow-medium: 0 8px 28px rgba(62, 42, 28, 0.07);
    --shadow-large: 0 20px 60px rgba(62, 42, 28, 0.12);

    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 22px;
    --radius-xl: 28px;

    --sidebar-width: 330px;
    --topbar-height: 76px;

    --transition: 0.22s ease;
}


/* =========================================
   2. RESET
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-main);
    color: var(--text-primary);

    font-family: 'DM Sans', sans-serif;
    font-size: 14px;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: none;
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--coffee-light);
    outline-offset: 3px;
}

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.hidden {
    display: none !important;
}


/* =========================================
   3. APPLICATION LAYOUT
========================================= */

.app-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);

    overflow: hidden;
    background: var(--bg-main);
}


/* =========================================
   4. SIDEBAR
========================================= */

.sidebar {
    height: 100vh;
    height: 100dvh;

    display: flex;
    flex-direction: column;

    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);

    position: relative;
    z-index: 10;

    min-width: 0;
}


/* SIDEBAR HEADER */

.sidebar-header {
    height: 86px;
    min-height: 86px;

    padding: 0 23px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border-light);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    color: #fffaf2;
    background: linear-gradient(
        145deg,
        #8b6348,
        #543a29
    );

    box-shadow: 0 5px 12px rgba(75, 48, 31, 0.17);
}

.brand-icon svg {
    width: 23px;
    height: 23px;
}

.brand-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: var(--coffee-dark);
}

.brand-caption {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}


/* SIDEBAR ACTIONS */

.sidebar-actions {
    padding: 21px 19px 13px;
}

.new-chat-button {
    width: 100%;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: var(--coffee-dark);
    color: #fffaf4;

    border-radius: 13px;

    font-size: 13px;
    font-weight: 600;

    box-shadow: 0 5px 13px rgba(56, 39, 30, 0.12);

    transition: var(--transition);
}

.new-chat-button svg {
    width: 18px;
    height: 18px;
}

.new-chat-button:hover {
    background: #604330;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(56, 39, 30, 0.16);
}

.new-chat-button:active {
    transform: translateY(0);
}


/* =========================================
   5. SEARCH
========================================= */

.search-wrapper {
    height: 45px;
    margin: 0 19px 19px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 13px;

    background: #fffdf9;
    border: 1px solid var(--border);

    border-radius: 12px;

    transition: var(--transition);
}

.search-wrapper:focus-within {
    border-color: var(--coffee-light);
    box-shadow: 0 0 0 3px rgba(178, 140, 108, 0.10);
}

.search-wrapper svg {
    width: 17px;
    height: 17px;
    color: var(--text-muted);
}

.search-wrapper input {
    flex: 1;
    width: 100%;
    min-width: 0;

    border: none;
    outline: none;

    background: transparent;
    color: var(--text-primary);

    font-size: 12px;
}

.search-wrapper input::placeholder {
    color: #b5a99c;
}

.search-wrapper kbd {
    font-family: inherit;
    font-size: 10px;
    color: var(--text-muted);

    padding: 3px 5px;
    border: 1px solid var(--border);
    border-radius: 5px;

    white-space: nowrap;
}


/* =========================================
   6. NAVIGATION
========================================= */

.sidebar-navigation {
    padding: 0 13px 16px;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    width: 100%;
    height: 43px;

    padding: 0 12px;

    display: flex;
    align-items: center;
    gap: 12px;

    border-radius: 11px;

    background: transparent;
    color: var(--text-secondary);

    text-align: left;
    font-size: 13px;
    font-weight: 500;

    transition: var(--transition);
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: #eee7dc;
    color: var(--coffee-dark);
}

.nav-item.active {
    background: #e9ded0;
    color: var(--coffee-dark);
    font-weight: 700;
}

.nav-counter {
    margin-left: auto;

    min-width: 21px;
    height: 21px;

    padding: 0 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--coffee-dark);
    color: white;

    border-radius: 7px;

    font-size: 10px;
    font-weight: 700;
}


/* =========================================
   7. CHAT FILTERS
========================================= */

.chat-filters {
    padding: 0 19px 14px;

    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-button {
    padding: 7px 12px;

    border-radius: 20px;

    background: transparent;
    color: var(--text-secondary);

    border: 1px solid var(--border);

    font-size: 11px;
    font-weight: 600;

    transition: var(--transition);
}

.filter-button:hover {
    background: #eee8de;
}

.filter-button.active {
    background: var(--coffee-dark);
    color: white;
    border-color: var(--coffee-dark);
}


/* =========================================
   8. CHAT LIST
========================================= */

.chat-list-wrapper {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.section-heading {
    padding: 6px 21px 13px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    color: var(--text-muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.section-heading span:last-child {
    font-size: 10px;
}

.chat-list {
    flex: 1;
    min-height: 0;

    padding: 0 10px 15px;

    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 5px;
}

.chat-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: #d8cbbd;
    border-radius: 10px;
}

.chat-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: transparent;
}


/* CHAT ITEM */

.chat-item {
    width: 100%;
    min-height: 75px;

    padding: 11px 10px;

    display: flex;
    align-items: center;
    gap: 11px;

    text-align: left;

    background: transparent;
    border-radius: 14px;

    transition: var(--transition);
}

.chat-item:hover {
    background: #eee8de;
}

.chat-item.active {
    background: #e9ded0;
}

.chat-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.avatar {
    width: 45px;
    height: 45px;

    border-radius: 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    overflow: hidden;

    background: #e6d4c0;
    color: var(--coffee-dark);

    font-size: 16px;
    font-weight: 700;
}

.avatar-default {
    background: linear-gradient(145deg, #b68c69, #76523b);
    color: white;
}

.online-indicator,
.chat-online-dot {
    position: absolute;

    width: 11px;
    height: 11px;

    border: 2px solid var(--bg-sidebar);
    border-radius: 50%;

    background: var(--success);
}

.online-indicator {
    right: -1px;
    bottom: -1px;
}

.chat-online-dot {
    right: -2px;
    bottom: -1px;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-top,
.chat-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 7px;
}

.chat-item-top {
    margin-bottom: 7px;
}

.chat-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-item-time {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 9px;
}

.chat-item-message {
    flex: 1;
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--text-secondary);
    font-size: 11px;
}

.unread-badge {
    min-width: 19px;
    height: 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 5px;

    border-radius: 7px;

    background: var(--coffee);
    color: white;

    font-size: 9px;
    font-weight: 700;
}


/* EMPTY CHAT LIST */

.chat-list-placeholder {
    padding: 45px 17px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.placeholder-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: #eee6da;
    color: var(--coffee-medium);

    margin-bottom: 14px;
}

.placeholder-icon svg {
    width: 22px;
    height: 22px;
}

.chat-list-placeholder p,
.search-empty-state p {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.chat-list-placeholder span,
.search-empty-state span {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.6;
}


/* =========================================
   9. SIDEBAR PROFILE
========================================= */

.sidebar-footer {
    padding: 14px 15px;

    border-top: 1px solid var(--border);
    background: rgba(255, 253, 249, 0.4);
}

.profile-button {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 9px;

    background: transparent;
    border-radius: 13px;

    text-align: left;
    transition: var(--transition);
}

.profile-button:hover {
    background: #eee8de;
}

.profile-info {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.profile-status {
    color: var(--text-muted);
    font-size: 10px;
}

.profile-more {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}


/* =========================================
   10. MAIN CONTENT
========================================= */

.main-content {
    height: 100vh;
    height: 100dvh;
    min-width: 0;

    display: flex;
    flex-direction: column;

    background:
        radial-gradient(
            ellipse at 80% 10%,
            rgba(218, 193, 165, 0.08),
            transparent 35%
        ),
        var(--bg-main);

    position: relative;
}


/* =========================================
   11. TOPBAR
========================================= */

.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);

    padding: 0 30px;

    display: flex;
    align-items: center;

    border-bottom: 1px solid var(--border-light);

    background: rgba(255, 253, 249, 0.65);
    backdrop-filter: blur(15px);

    z-index: 2;
}

.topbar-placeholder {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.chat-header {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 13px;
}

.chat-header-avatar {
    width: 43px;
    height: 43px;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-header-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.chat-header-status {
    color: var(--success);
    font-size: 10px;
}

.chat-header-actions {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 9px;
}


/* ICON BUTTON */

.icon-button {
    width: 39px;
    height: 39px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: transparent;
    color: var(--text-secondary);

    transition: var(--transition);
}

.icon-button:hover {
    background: var(--bg-hover);
    color: var(--coffee-dark);
}

.icon-button svg {
    width: 18px;
    height: 18px;
}


/* =========================================
   12. EMPTY STATE
========================================= */

.empty-state {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 35px;

    text-align: center;

    position: relative;
    overflow: hidden;
}

.empty-decoration {
    width: 180px;
    height: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    margin-bottom: 31px;
}

.empty-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(137, 102, 76, 0.14);
}

.circle-one {
    width: 180px;
    height: 180px;
}

.circle-two {
    width: 140px;
    height: 140px;
    background: rgba(226, 210, 190, 0.13);
}

.empty-coffee-icon {
    width: 91px;
    height: 91px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(145deg, #916b4e, #563c2c);
    color: #fffaf4;

    border-radius: 30px;

    box-shadow: 0 18px 40px rgba(79, 53, 36, 0.19);

    transform: rotate(-7deg);
    z-index: 1;
}

.empty-coffee-icon svg {
    width: 42px;
    height: 42px;
    stroke-width: 1.5;
}

.empty-state-content {
    max-width: 430px;
}

.eyebrow {
    display: block;

    margin-bottom: 13px;

    color: var(--coffee-medium);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
}

.empty-state h1 {
    font-family: 'Playfair Display', serif;

    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.2;

    color: var(--coffee-dark);

    margin-bottom: 14px;
}

.empty-state-content > p {
    max-width: 360px;

    margin: 0 auto 24px;

    color: var(--text-secondary);

    font-size: 12px;
    line-height: 1.8;
}


/* PRIMARY BUTTON */

.primary-button {
    min-height: 46px;

    padding: 0 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border-radius: 12px;

    background: var(--coffee-dark);
    color: #fffaf4;

    font-size: 12px;
    font-weight: 700;

    box-shadow: 0 5px 14px rgba(56, 39, 30, 0.12);

    transition: var(--transition);
}

.primary-button svg {
    width: 17px;
    height: 17px;
}

.primary-button:hover {
    background: #684b37;
    transform: translateY(-2px);
}

.primary-button:active {
    transform: translateY(0);
}

.full-width {
    width: 100%;
}

.empty-footer {
    position: absolute;
    bottom: 25px;

    color: #c2b5a8;

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
}


/* =========================================
   13. CONVERSATION VIEW
========================================= */

.conversation-view {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* =========================================
   14. MESSAGES
========================================= */

.messages-container {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 25px 30px 15px;
}

.messages-list {
    width: 100%;
    max-width: 850px;

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    gap: 13px;
}


/* MESSAGE */

.message {
    width: 100%;

    display: flex;
    justify-content: flex-start;
}

.message.own,
.message.is-own,
.message.outgoing {
    justify-content: flex-end;
}

.message-bubble {
    max-width: min(72%, 510px);

    padding: 12px 15px 9px;

    background: #fffdf9;

    border: 1px solid var(--border-light);
    border-radius: 16px 16px 16px 5px;

    box-shadow: var(--shadow-small);

    overflow-wrap: anywhere;
}

.message.own .message-bubble,
.message.is-own .message-bubble,
.message.outgoing .message-bubble {
    background: #eaddcc;

    border-color: #e5d4c1;

    border-radius: 16px 16px 5px 16px;
}

.message-text {
    color: var(--text-primary);

    font-size: 13px;
    line-height: 1.65;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-meta {
    margin-top: 7px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;

    color: var(--text-muted);

    font-size: 9px;
}

.message-status {
    display: flex;
    align-items: center;
    color: var(--coffee-medium);
}

.message-status svg {
    width: 13px;
    height: 13px;
}

.message-attachment {
    margin-top: 9px;
}

.message-attachment img {
    display: block;

    max-width: 100%;
    max-height: 300px;

    object-fit: contain;

    border-radius: 10px;
}


/* =========================================
   15. TYPING INDICATOR
========================================= */

.typing-indicator {
    width: 100%;
    max-width: 850px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 0;
}

.typing-avatar {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #e6d4c0;
    color: var(--coffee-dark);

    font-size: 10px;
    font-weight: 700;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--text-muted);
    font-size: 10px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 4px;
    height: 4px;

    border-radius: 50%;
    background: var(--coffee-light);

    animation: typing 1.1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}


/* =========================================
   16. MESSAGE COMPOSER
========================================= */

.composer-wrapper {
    padding: 16px 25px 20px;

    background: rgba(255, 253, 249, 0.82);
    border-top: 1px solid var(--border-light);
}

.message-form {
    width: 100%;
    max-width: 850px;

    margin: 0 auto;

    min-height: 66px;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 9px 11px;

    background: #fffdf9;
    border: 1px solid var(--border);

    border-radius: 17px;

    box-shadow: var(--shadow-small);

    transition: var(--transition);
}

.message-form:focus-within {
    border-color: #c6a486;
    box-shadow: 0 0 0 3px rgba(178, 140, 108, 0.09);
}

.composer-action {
    width: 37px;
    height: 37px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: transparent;
    color: var(--text-muted);

    transition: var(--transition);
}

.composer-action:hover {
    background: #f1e9df;
    color: var(--coffee);
}

.composer-action svg {
    width: 19px;
    height: 19px;
}

.composer-input-wrapper {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.composer-input-wrapper textarea {
    width: 100%;
    min-height: 25px;
    max-height: 120px;

    resize: none;

    border: none;
    outline: none;

    background: transparent;

    color: var(--text-primary);

    font-size: 13px;
    line-height: 1.6;

    padding: 4px 0;
}

.composer-input-wrapper textarea::placeholder {
    color: #b5a99c;
}

.composer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.composer-hint,
.character-counter {
    color: #b7aa9d;
    font-size: 9px;
}

.character-counter {
    white-space: nowrap;
}

.send-button {
    width: 41px;
    height: 41px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: var(--coffee-dark);
    color: white;

    transition: var(--transition);
}

.send-button svg {
    width: 18px;
    height: 18px;
}

.send-button:hover:not(:disabled) {
    background: #745238;
    transform: scale(1.04);
}

.send-button:disabled {
    background: #e8e0d7;
    color: #b8aa9d;
    cursor: not-allowed;
}


/* ATTACHMENT PREVIEW */

.attachment-preview {
    max-width: 850px;
    margin: 10px auto 0;

    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.attachment-preview:empty {
    display: none;
}


/* =========================================
   17. MODALS
========================================= */

.modal {
    width: min(460px, calc(100% - 30px));
    max-height: min(650px, calc(100dvh - 40px));

    margin: auto;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 23px;

    background: var(--bg-card);
    color: var(--text-primary);

    box-shadow: var(--shadow-large);

    overflow: auto;
}

.modal::backdrop {
    background: rgba(45, 32, 23, 0.38);
    backdrop-filter: blur(5px);
}

.modal[open] {
    animation: modalAppear 0.2s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-container {
    padding: 25px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 24px;
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;

    font-size: 24px;
    color: var(--coffee-dark);
}

.modal-header .eyebrow {
    margin-bottom: 6px;
}

.modal-search {
    height: 48px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 14px;

    background: #f8f4ed;
    border: 1px solid var(--border);

    border-radius: 12px;

    transition: var(--transition);
}

.modal-search:focus-within {
    border-color: var(--coffee-light);
}

.modal-search svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.modal-search input {
    flex: 1;
    min-width: 0;

    border: none;
    outline: none;

    background: transparent;

    font-size: 12px;
    color: var(--text-primary);
}

.modal-search input::placeholder {
    color: #b5a99c;
}

.modal-results-heading {
    margin: 22px 0 10px;

    color: var(--text-muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.user-search-results {
    display: flex;
    flex-direction: column;

    max-height: 300px;
    overflow-y: auto;
}

.search-empty-state {
    padding: 28px 10px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}


/* USER RESULT */

.user-result {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px;

    background: transparent;
    border-radius: 12px;

    text-align: left;
    transition: var(--transition);
}

.user-result:hover {
    background: #f3ede4;
}

.user-result-avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.user-result-info {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-result-name {
    font-size: 12px;
    font-weight: 700;
}

.user-result-username {
    font-size: 10px;
    color: var(--text-muted);
}

.user-result-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}


/* =========================================
   18. PROFILE FORM
========================================= */

.profile-edit-avatar {
    width: 76px;
    height: 76px;

    margin: 0 auto 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 25px;

    background: linear-gradient(145deg, #b68c69, #76523b);
    color: white;

    font-size: 26px;
    font-weight: 700;
}

#profileForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-label {
    margin-top: 7px;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 700;
}

.form-input {
    width: 100%;

    min-height: 44px;
    padding: 11px 13px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: #faf7f1;

    outline: none;

    color: var(--text-primary);
    font-size: 12px;

    resize: vertical;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--coffee-light);
    background: white;
}

.form-input::placeholder {
    color: #b8aa9d;
}

#profileForm .primary-button {
    margin-top: 14px;
}


/* =========================================
   19. TOAST NOTIFICATIONS
========================================= */

.toast-container {
    position: fixed;

    right: 24px;
    bottom: 24px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    z-index: 1000;

    pointer-events: none;
}

.toast {
    min-width: 230px;
    max-width: 350px;

    padding: 14px 17px;

    display: flex;
    align-items: center;
    gap: 10px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: #fffdf9;
    color: var(--text-primary);

    box-shadow: var(--shadow-medium);

    font-size: 12px;
    font-weight: 600;

    animation: toastAppear 0.25s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

@keyframes toastAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================
   20. MOBILE ELEMENTS
========================================= */

.mobile-menu-button,
.mobile-close,
.mobile-overlay {
    display: none;
}


/* =========================================
   21. SCROLLBARS
========================================= */

* {
    scrollbar-width: thin;
    scrollbar-color: #d8cbbd transparent;
}


/* =========================================
   22. RESPONSIVE TABLET
========================================= */

@media (max-width: 1050px) {

    :root {
        --sidebar-width: 290px;
    }

    .sidebar-header {
        padding: 0 18px;
    }

    .messages-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .composer-wrapper {
        padding-left: 18px;
        padding-right: 18px;
    }

}


/* =========================================
   23. RESPONSIVE MOBILE
========================================= */

@media (max-width: 760px) {

    .app-shell {
        display: block;
        position: relative;
    }

    .sidebar {
        position: fixed;

        top: 0;
        bottom: 0;
        left: 0;

        width: min(330px, 88vw);
        height: 100dvh;

        z-index: 100;

        transform: translateX(-105%);
        transition: transform 0.28s ease;

        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);

        box-shadow: 15px 0 45px rgba(45, 32, 23, 0.12);
    }

    .mobile-overlay {
        display: block;

        position: fixed;
        inset: 0;

        z-index: 90;

        background: rgba(39, 28, 20, 0.35);
        backdrop-filter: blur(3px);
    }

    .mobile-menu-button,
    .mobile-close {
        display: flex;
    }

    .main-content {
        width: 100%;
        height: 100dvh;
    }

    .topbar {
        height: 67px;
        min-height: 67px;

        padding: 0 15px;
        gap: 10px;
    }

    .chat-header {
        gap: 9px;
    }

    .chat-header-avatar {
        width: 39px;
        height: 39px;
        border-radius: 13px;
    }

    .chat-header-name {
        font-size: 12px;
    }

    .chat-header-status {
        font-size: 9px;
    }

    .chat-header-actions {
        gap: 2px;
    }

    .chat-header-actions .icon-button {
        width: 34px;
        height: 34px;
    }

    .empty-state {
        padding: 20px;
    }

    .empty-decoration {
        width: 150px;
        height: 150px;
    }

    .circle-one {
        width: 150px;
        height: 150px;
    }

    .circle-two {
        width: 118px;
        height: 118px;
    }

    .empty-coffee-icon {
        width: 76px;
        height: 76px;
        border-radius: 25px;
    }

    .empty-coffee-icon svg {
        width: 35px;
        height: 35px;
    }

    .empty-state h1 {
        font-size: 29px;
    }

    .empty-state-content > p {
        font-size: 11px;
    }

    .messages-container {
        padding: 17px 12px 10px;
    }

    .messages-list {
        gap: 10px;
    }

    .message-bubble {
        max-width: 86%;
        padding: 10px 12px 8px;
    }

    .message-text {
        font-size: 12px;
    }

    .composer-wrapper {
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    }

    .message-form {
        min-height: 57px;
        gap: 5px;
        padding: 7px;
        border-radius: 15px;
    }

    .composer-action {
        width: 33px;
        height: 35px;
    }

    .composer-action svg {
        width: 17px;
        height: 17px;
    }

    .composer-input-wrapper textarea {
        font-size: 12px;
    }

    .composer-hint {
        display: none;
    }

    .character-counter {
        font-size: 8px;
    }

    .send-button {
        width: 37px;
        height: 37px;
        border-radius: 11px;
    }

    .empty-footer {
        bottom: 15px;
        font-size: 7px;
    }

    .toast-container {
        right: 12px;
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .toast {
        width: 100%;
        max-width: none;
    }

}


/* =========================================
   24. SMALL MOBILE
========================================= */

@media (max-width: 380px) {

    .brand-name {
        font-size: 20px;
    }

    .brand-caption {
        font-size: 7px;
    }

    .chat-filters {
        gap: 5px;
    }

    .filter-button {
        padding: 7px 9px;
        font-size: 10px;
    }

    .composer-action {
        width: 29px;
    }

    .character-counter {
        display: none;
    }

    .empty-state h1 {
        font-size: 25px;
    }

}


/* =========================================
   25. ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}


/* =========================================
   ZEVORA — DARK COFFEE THEME
========================================= */

:root {
    --bg-main: #171310;
    --bg-sidebar: #201a16;
    --bg-card: #29211b;
    --bg-hover: #382c23;

    --coffee-dark: #493324;
    --coffee: #79543b;
    --coffee-medium: #b28a68;
    --coffee-light: #d0a77f;
    --caramel: #c99b70;

    --text-primary: #f1e6da;
    --text-secondary: #b9a797;
    --text-muted: #897969;

    --border: #403329;
    --border-light: #332920;

    --success: #83b18c;
    --danger: #d78c7e;

    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.16);
    --shadow-medium: 0 8px 28px rgba(0, 0, 0, 0.23);
    --shadow-large: 0 20px 60px rgba(0, 0, 0, 0.42);
}


/* BASE */

html,
body {
    background: var(--bg-main);
    color: var(--text-primary);
    color-scheme: dark;
}

.app-shell {
    background: var(--bg-main);
}


/* SIDEBAR */

.sidebar {
    background: var(--bg-sidebar);
    border-color: var(--border);
}

.sidebar-header,
.sidebar-footer {
    border-color: var(--border-light);
}

.sidebar-footer {
    background: rgba(0, 0, 0, 0.12);
}

.brand-name {
    color: #f1e1d0;
}

.brand-caption {
    color: #927d69;
}

.brand-icon {
    background: linear-gradient(145deg, #a77b55, #593b29);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
}


/* BUTTONS */

.new-chat-button {
    background: linear-gradient(135deg, #a77b55, #805637);
    color: #fff8ef;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.new-chat-button:hover {
    background: linear-gradient(135deg, #bd936b, #956746);
}

.primary-button {
    background: linear-gradient(135deg, #a77b55, #805637);
    color: #fff8ef;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.primary-button:hover {
    background: linear-gradient(135deg, #bd936b, #956746);
}

.icon-button {
    color: var(--text-secondary);
}

.icon-button:hover {
    background: #382c23;
    color: var(--coffee-light);
}


/* SEARCH */

.search-wrapper {
    background: #2a221c;
    border-color: var(--border);
}

.search-wrapper:focus-within {
    background: #30251e;
    border-color: var(--coffee-medium);
    box-shadow: 0 0 0 3px rgba(178, 138, 104, 0.12);
}

.search-wrapper input {
    color: var(--text-primary);
}

.search-wrapper input::placeholder {
    color: #897968;
}

.search-wrapper kbd {
    color: #9e8a77;
    border-color: #4a3a2e;
    background: #241c17;
}


/* NAVIGATION */

.nav-item {
    color: var(--text-secondary);
}

.nav-item:hover {
    background: #342920;
    color: #e8d4c0;
}

.nav-item.active {
    background: #49372a;
    color: #f2dfca;
}

.nav-counter {
    background: #a77b55;
    color: #211710;
}


/* FILTERS */

.filter-button {
    color: var(--text-secondary);
    border-color: var(--border);
}

.filter-button:hover {
    background: #382c23;
    color: var(--text-primary);
}

.filter-button.active {
    background: #8d6242;
    color: #fff8ef;
    border-color: #8d6242;
}


/* CHAT LIST */

.section-heading {
    color: #927f6e;
}

.chat-item:hover {
    background: #30261f;
}

.chat-item.active {
    background: #49372a;
}

.chat-item-name {
    color: #f1e5d9;
}

.chat-item-time {
    color: #927f6e;
}

.chat-item-message {
    color: #ad9b89;
}

.avatar {
    background: #49382a;
    color: #e9d2b8;
}

.avatar-default {
    background: linear-gradient(145deg, #b68c69, #68462e);
    color: white;
}

.online-indicator,
.chat-online-dot {
    border-color: var(--bg-sidebar);
}

.unread-badge {
    background: #a77b55;
    color: #211710;
}


/* EMPTY CHAT LIST */

.chat-list-placeholder .placeholder-icon,
.search-empty-state .placeholder-icon {
    background: #342920;
    color: #c39a73;
}

.chat-list-placeholder p,
.search-empty-state p {
    color: var(--text-primary);
}

.chat-list-placeholder span,
.search-empty-state span {
    color: var(--text-muted);
}


/* PROFILE */

.profile-button:hover {
    background: #342920;
}

.profile-name {
    color: var(--text-primary);
}

.profile-status {
    color: var(--text-muted);
}

.profile-more {
    color: #927d69;
}


/* MAIN CONTENT */

.main-content {
    background:
        radial-gradient(
            ellipse at 80% 10%,
            rgba(143, 99, 65, 0.09),
            transparent 40%
        ),
        #171310;
}

.topbar {
    background: rgba(35, 27, 21, 0.88);
    border-color: var(--border-light);
}

.topbar-placeholder {
    color: var(--text-muted);
}

.chat-header-name {
    color: var(--text-primary);
}

.chat-header-status {
    color: var(--success);
}


/* EMPTY STATE */

.empty-circle {
    border-color: rgba(193, 151, 111, 0.16);
}

.circle-two {
    background: rgba(143, 99, 65, 0.08);
}

.empty-coffee-icon {
    background: linear-gradient(145deg, #ad8059, #593a27);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
}

.empty-state h1 {
    color: #f0dfcc;
}

.empty-state-content > p {
    color: #aa9784;
}

.eyebrow {
    color: #c69b73;
}

.empty-footer {
    color: #716052;
}


/* MESSAGES */

.message-bubble {
    background: #29211b;
    border-color: #403329;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.message.own .message-bubble,
.message.is-own .message-bubble,
.message.outgoing .message-bubble {
    background: #493628;
    border-color: #624831;
}

.message-text {
    color: #f1e5d9;
}

.message-meta {
    color: #a58c76;
}

.message-status {
    color: #d0a77f;
}

.typing-avatar {
    background: #49382a;
    color: #e9d2b8;
}

.typing-content {
    color: #a89582;
}

.typing-dots span {
    background: #c69b73;
}


/* MESSAGE COMPOSER */

.composer-wrapper {
    background: rgba(31, 24, 19, 0.96);
    border-color: var(--border-light);
}

.message-form {
    background: #29211b;
    border-color: #44372c;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.message-form:focus-within {
    background: #30251e;
    border-color: #9c7552;
    box-shadow: 0 0 0 3px rgba(178, 138, 104, 0.12);
}

.composer-input-wrapper textarea {
    color: #f1e5d9;
    caret-color: #d0a77f;
}

.composer-input-wrapper textarea::placeholder {
    color: #8c7968;
}

.composer-action {
    color: #a38c76;
}

.composer-action:hover {
    background: #443429;
    color: #d5b18e;
}

.composer-hint,
.character-counter {
    color: #817060;
}

.send-button {
    background: linear-gradient(135deg, #b1845d, #825838);
    color: #fff8ef;
}

.send-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #c99a70, #9a6c46);
}

.send-button:disabled {
    background: #413329;
    color: #82705f;
}


/* MODALS */

.modal {
    background: #261e18;
    border-color: #49382b;
    color: var(--text-primary);
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(7px);
}

.modal-header h2 {
    color: #f0dfcc;
}

.modal-search {
    background: #1e1813;
    border-color: #44352a;
}

.modal-search:focus-within {
    background: #2b211a;
    border-color: #a77b55;
}

.modal-search input {
    color: var(--text-primary);
}

.modal-search input::placeholder {
    color: #897968;
}

.modal-results-heading {
    color: #9a8673;
}

.user-result:hover {
    background: #382b21;
}

.user-result-name {
    color: #f1e5d9;
}

.user-result-username {
    color: #a18d7a;
}

.user-result-arrow {
    color: #a18d7a;
}


/* PROFILE FORM */

.profile-edit-avatar {
    background: linear-gradient(145deg, #b68c69, #68462e);
}

.form-label {
    color: #c0a58b;
}

.form-input {
    background: #1e1813;
    border-color: #44352a;
    color: #f1e5d9;
}

.form-input:focus {
    background: #30251e;
    border-color: #a77b55;
}

.form-input::placeholder {
    color: #897968;
}


/* TOAST */

.toast {
    background: #2b221b;
    border-color: #49382b;
    color: #f1e5d9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toast.success {
    border-left-color: #83b18c;
}

.toast.error {
    border-left-color: #d78c7e;
}


/* SCROLLBARS */

* {
    scrollbar-color: #66503e #211a15;
}

.chat-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: #594332;
}

.chat-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: #211a15;
}


/* TEXT SELECTION */

::selection {
    background: #896448;
    color: #fff8ef;
}


/* MOBILE OVERLAY */

.mobile-overlay {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}


/* MOBILE SIDEBAR SHADOW */

@media (max-width: 760px) {
    .sidebar.mobile-open {
        box-shadow: 15px 0 45px rgba(0, 0, 0, 0.45);
    }
}


/* REDUCE LIGHT FLASHES */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
