/* =============== GOOGLE FONTS =============== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* =============== VARIABLES CSS =============== */
:root {
    --color-primary: #7380ec;
    --color-danger: #ff7782;
    --color-success: #41f1b6;
    --color-warning: #ffbb55;
    --color-white: #fff;
    --color-info-dark: #7d8da1;
    --color-info-light: #dce1eb;
    --color-dark: #363949;
    --color-light: rgba(132, 139, 200, 0.18);
    --color-primary-variant: #111e88;
    --color-dark-variant: #677483;
    --color-background: #f6f6f9;

    --card-border-radius: 2rem;
    --border-radius-1: 0.4rem;
    --border-radius-2: 0.8rem;
    --border-radius-3: 1.2rem;

    --card-padding: 1.8rem;
    --padding-1: 1.2rem;

    --box-shadow: 0 2rem 3rem var(--color-light);
}

/* =============== DARK THEME =============== */
.dark-theme-variables {
    --color-background: #181a1e;
    --color-white: #202528;
    --color-dark: #edeffd;
    --color-dark-variant: #a3bdcc;
    --color-light: rgba(0, 0, 0, 0.4);
    --box-shadow: 0 2rem 3rem var(--color-light);
}

/* =============== GENERAL =============== */
* {
    margin: 0;
    padding: 0;
    outline: 0;
    appearance: none;
    border: 0;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-height: 100vh;
    font-family: poppins, sans-serif;
    font-size: 0.88rem;
    background: var(--color-background);
    user-select: none;
    overflow-x: clip;
}

a {
    color: var(--color-dark);
}

img {
    display: block;
    width: 100%;
    object-fit: cover;
}

h1 {
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--color-dark);
}

h2 {
    font-size: 1.4rem;
    color: var(--color-dark);
}

h3 {
    font-size: 0.87rem;
    color: var(--color-dark);
}

h4 {
    font-size: 0.8rem;
    color: var(--color-dark);
}

h5 {
    font-size: 0.77rem;
    color: var(--color-dark);
}

small {
    font-size: 0.75rem;
}

.profile-avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: var(--color-light);
    position: relative;
}

.profile-avatar:hover {
    transform: scale(1.05);
    border-color: rgba(0, 0, 0, 0.08);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-dark);
}

.profile-initials.hidden {
    display: none;
}

.profile-menu {
    position: absolute;
    top: 5rem;
    right: 1rem;
    background: var(--color-white);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    z-index: 999;
    min-width: 180px;
    overflow: hidden;
}

.profile-menu.hidden {
    display: none;
}

.profile-menu-item {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-dark);
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.profile-menu-item:hover {
    background-color: var(--color-light);
}

.profile-menu-item .material-icons-sharp {
    font-size: 1.2rem;
}

.text-muted {
    color: var(--color-info-dark);
}

p {
    color: var(--color-dark-variant);
}

b {
    color: var(--color-dark);
}

.primary {
    color: var(--color-primary);
}

.danger {
    color: var(--color-danger);
}

.success {
    color: var(--color-success);
}

.warning {
    color: var(--color-warning);
}

/* =============== CONTAINER =============== */
.container {
    display: grid;
    width: min(96%, 1440px);
    margin: 0 auto;
    gap: 1.8rem;
    grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr) minmax(18rem, 23rem);
    align-items: start;
    padding: 0 0 2rem;
}

/* =============== ASIDE =============== */
aside {
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: start;
    z-index: 4;
}

aside.active {
    left: 0;
    display: block;
}

aside .top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.4rem;
}

aside .logo {
    display: flex;
    gap: 0.8rem;
}

aside .logo img {
    width: 2rem;
    height: 2rem;
}

aside .top div.close span {
    display: none;
}

/* =============== SIDEBAR =============== */
aside .sidebar {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 8rem);
    overflow-y: auto;
    position: relative;
    top: 3rem;
    padding-bottom: 2rem;
}

aside h3 {
    font-weight: 500;
}

aside .sidebar a {
    display: flex;
    color: var(--color-info-dark);
    margin-left: 2rem;
    gap: 1rem;
    align-items: center;
    position: relative;
    height: 3.7rem;
    transition: all 300ms ease;
}

aside .sidebar a span {
    font-size: 1.6rem;
    transition: all 300ms ease;
}

aside .sidebar a:last-child {
    position: absolute;
    bottom: 2rem;
    width: 100%;
}

aside .sidebar a.active {
    background: var(--color-light);
    color: var(--color-primary);
    margin-left: 0;
}

aside .sidebar a.active:before {
    content: "";
    width: 6px;
    height: 100%;
    background: var(--color-primary);
}

aside .sidebar a.active span {
    color: var(--color-primary);
    margin-left: calc(1rem - 3px);
}

aside .sidebar a:hover {
    color: var(--color-primary);
}

aside .sidebar a:hover span {
    margin-left: 1rem;
}

aside .sidebar .message-count {
    background: var(--color-danger);
    color: var(--color-white);
    padding: 2px 10px;
    font-size: 11px;
    border-radius: var(--border-radius-1);
}

/* =============== MAIN =============== */
main {
    margin-top: 1.4rem;
    min-width: 0;
}

main .date {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    margin-top: 1rem;
    padding: 0.35rem 0.75rem;
    min-height: 2.8rem;
}

main .date input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border-radius: var(--border-radius-1);
    color: var(--color-dark);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    min-height: 2.1rem;
    width: min(100%, 10rem);
    display: block;
    line-height: 1.2;
    padding: 0 0.2rem;
    border: 0;
    box-shadow: none;
    color-scheme: light only;
    -webkit-text-fill-color: var(--color-dark);
    opacity: 1;
}

main .date input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
    margin-left: 0.35rem;
    filter: none;
}

main .date input[type="date"]::-webkit-datetime-edit,
main .date input[type="date"]::-webkit-datetime-edit-fields-wrapper,
main .date input[type="date"]::-webkit-datetime-edit-text,
main .date input[type="date"]::-webkit-datetime-edit-month-field,
main .date input[type="date"]::-webkit-datetime-edit-day-field,
main .date input[type="date"]::-webkit-datetime-edit-year-field {
    color: var(--color-dark);
    -webkit-text-fill-color: var(--color-dark);
}

main .date input[type="date"]:required:invalid {
    color: var(--color-dark-variant);
    -webkit-text-fill-color: var(--color-dark-variant);
}

main .insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}

main .insights > div {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    margin-top: 1rem;
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

main .insights > div:hover {
    box-shadow: none;
}

main .insights > div span {
    background: var(--color-primary);
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--color-white);
    font-size: 2rem;
}

main .insights > div.conversions span {
    background: var(--color-success);
}

main .insights > div.revenue span {
    background: var(--color-warning);
}

main .insights > div .middle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

main .insights h3 {
    margin: 1rem 0 0.6rem;
    font-size: 1rem;
}

main .insights .progress {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 50%;
}

main .insights svg {
    width: 7rem;
    height: 7rem;
}

main .insights svg circle {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 14;
    stroke-linecap: round;
    transform: translate(5px, 5px);
}

main .insights .leads svg circle {
    stroke-dashoffset: -30;
    stroke-dasharray: 200;
}

main .insights .conversions svg circle {
    stroke-dashoffset: 20;
    stroke-dasharray: 80;
}

main .insights .revenue svg circle {
    stroke-dashoffset: 35;
    stroke-dasharray: 110;
}

main .insights .progress .number {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

main .insights small {
    margin-top: 1.3rem;
    display: block;
}

/* =============== RECENT ORDERS =============== */
main .recent-orders {
    margin-top: 2rem;
    overflow-x: auto;
}

main .recent-orders h2 {
    margin-bottom: 0.8rem;
}

main .recent-orders table {
    background: var(--color-white);
    width: 100%;
    min-width: 0;
    border-radius: var(--card-border-radius);
    padding: var(--card-padding);
    text-align: left;
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
    border-collapse: collapse;
}

main .recent-orders table:hover {
    box-shadow: none;
}

main .recent-orders table tbody td {
    height: 2.8rem;
    border-bottom: 1px solid var(--color-light);
    color: var(--color-dark);
}

main .recent-orders table th {
    color: var(--color-dark);
}

main .recent-orders table tbody tr:last-child td {
    border: none;
}

main .recent-orders a {
    text-align: center;
    display: block;
    margin: 1rem auto;
    color: var(--color-primary);
}

/* =============== RIGHT =============== */
.right {
    margin-top: 1.4rem;
    min-width: 0;
}

.right .top {
    display: flex;
    justify-content: end;
    gap: 2rem;
}

.right .top button {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms ease, visibility 200ms ease;
    z-index: 2;
}

body.sidebar-open {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

body.compact-tables .transactions-table th,
body.compact-tables .transactions-table td {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.right .theme-toggler {
    background: var(--color-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 1.6rem;
    width: 4.2rem;
    cursor: pointer;
    border-radius: var(--border-radius-1);
}

.right .theme-toggler span {
    font-size: 1.2rem;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.right .theme-toggler span.active {
    background: var(--color-primary);
    color: white;
    border-radius: var(--border-radius-1);
}

.right .profile {
    display: flex;
    gap: 2rem;
    text-align: right;
}

/* =============== RECENT UPDATES =============== */
.right .recent-updates {
    margin-top: 1rem;
}

.right .recent-updates h2 {
    margin-bottom: 0.8rem;
}

.right .recent-updates .updates {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

.right .recent-updates .updates:hover {
    box-shadow: none;
}

.right .recent-updates .update {
    display: grid;
    grid-template-columns: 2.6rem auto;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* =============== SALES ANALYTICS =============== */
.right .sales-analytics {
    margin-top: 2rem;
}

.right .sales-analytics h2 {
    margin-bottom: 0.8rem;
}

.right .sales-analytics .item {
    background: var(--color-white);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.7rem;
    padding: 1.4rem var(--card-padding);
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

.right .sales-analytics .item:hover {
    box-shadow: none;
}

.right .sales-analytics .item .icon {
    padding: 0.6rem;
    color: var(--color-white);
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
}

.right .sales-analytics .item.offline .icon {
    background: var(--color-danger);
}

.right .sales-analytics .item.customers .icon {
    background: var(--color-success);
}

.right .sales-analytics .item h3 {
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.right .sales-analytics .item .right {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin: 0;
    width: 100%;
}

.right .sales-analytics .add-product {
    background: transparent !important;
    border: 2px dashed var(--color-primary);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.right .sales-analytics .add-product div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.right .sales-analytics .add-product h3 {
    font-weight: 600;
    color: var(--color-primary);
}

.dark-theme-variables input,
.dark-theme-variables textarea,
.dark-theme-variables select,
.dark-theme-variables button,
.dark-theme-variables th,
.dark-theme-variables td,
.dark-theme-variables label,
.dark-theme-variables h1,
.dark-theme-variables h2,
.dark-theme-variables h3,
.dark-theme-variables h4,
.dark-theme-variables h5,
.dark-theme-variables h6,
.dark-theme-variables strong,
.dark-theme-variables b {
    color: var(--color-dark);
}

.dark-theme-variables main .date input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
}

.dark-theme-variables main .date input[type="date"],
.dark-theme-variables main .date input[type="date"]::-webkit-datetime-edit,
.dark-theme-variables main .date input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.dark-theme-variables main .date input[type="date"]::-webkit-datetime-edit-text,
.dark-theme-variables main .date input[type="date"]::-webkit-datetime-edit-month-field,
.dark-theme-variables main .date input[type="date"]::-webkit-datetime-edit-day-field,
.dark-theme-variables main .date input[type="date"]::-webkit-datetime-edit-year-field {
    background: transparent;
    color: var(--color-dark) !important;
    -webkit-text-fill-color: var(--color-dark) !important;
    color-scheme: dark only;
    opacity: 1;
}

/* =============== MEDIA QUERIES =============== */
@media screen and (max-width: 1200px) {
    .container {
        width: 94%;
        grid-template-columns: 7rem minmax(0, 1fr);
        gap: 1.5rem;
    }

    aside .logo h2 {
        display: none;
    }

    aside .sidebar h3 {
        display: none;
    }

    aside .sidebar a {
        width: 5.6rem;
    }

    main {
        margin-top: 6.6rem;
    }

    main .insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    main .recent-orders {
        width: 100%;
        position: relative;
        left: auto;
        transform: none;
        margin: 2rem 0 0;
    }

    main .recent-orders table {
        width: 100%;
    }

    .right {
        width: 100%;
        margin: 0 0 4rem;
        grid-column: 1 / -1;
    }

    .right .top {
        position: fixed;
        top: 0;
        left: 0;
        align-items: center;
        padding: 0 0.8rem;
        height: 4.6rem;
        background: var(--color-white);
        width: 100%;
        margin: 0;
        z-index: 5;
        box-shadow: 0 1rem 1rem var(--color-light);
    }

    .right .profile {
        gap: 1.4rem;
        margin-top: 0.2rem;
    }

    .right .top button {
        display: inline-block;
        background: transparent;
        cursor: pointer;
        color: var(--color-dark);
        position: absolute;
        left: 1rem;
    }

    .right .top button span {
        font-size: 2rem;
    }

    .right .recent-updates {
        position: relative;
        margin-top: 1rem;
    }

    .right .sales-analytics {
        margin-top: 0;
    }
}

@media screen and (max-width: 768px) {
    .container {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem 2rem;
    }

    aside {
        position: fixed;
        inset: 0 auto 0 0;
        background: var(--color-white);
        width: min(18rem, 85vw);
        max-width: 85vw;
        z-index: 6;
        box-shadow: 1rem 3rem 4rem var(--color-light);
        height: 100vh;
        min-height: 100vh;
        padding: 0 1rem 1.5rem 0;
        display: block;
        transform: translateX(-105%);
        transition: transform 0.3s ease;
    }

    aside.active {
        left: 0;
        transform: translateX(0);
    }

    aside .top {
        margin-top: 1.4rem;
        padding-inline: 1rem 0;
    }

    aside .top div.close span {
        display: inline-block;
        position: absolute;
        right: 1rem;
        cursor: pointer;
    }

    aside .sidebar {
        margin-top: 2rem;
        width: 100%;
        min-height: calc(100vh - 9rem);
        top: 0;
        padding-left: 0.4rem;
        gap: 0;
    }

    aside .sidebar h3,
    aside .sidebar a h3 {
        display: inline !important;
        width: auto !important;
        opacity: 1 !important;
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    aside .sidebar a {
        width: 100% !important;
        margin-left: 0;
        padding-left: 1rem;
        padding-right: 1rem;
        min-height: 3.2rem;
        gap: 0.8rem;
        justify-content: flex-start;
        border-radius: 0 var(--border-radius-2) var(--border-radius-2) 0;
    }

    aside .sidebar a span {
        margin-left: 0 !important;
        margin-right: 0;
        font-size: 1.4rem;
        flex-shrink: 0;
    }

    main .insights {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    main .recent-orders {
        position: relative;
        margin: 3rem 0 0 0;
        width: 100%;
    }

    main .recent-orders table {
        width: 100%;
        min-width: auto;
        margin: 0;
    }

    .right {
        width: 94%;
        margin: 0 auto 4rem;
    }

    .right .top {
        width: 100%;
        justify-content: space-between;
        gap: 0.8rem;
        align-items: center;
        padding: 0 1rem;
    }

    .right .top button {
        display: inline-block;
        background: transparent;
        cursor: pointer;
        color: var(--color-dark);
        position: relative;
        left: 0;
        z-index: 2;
        flex: 0 0 auto;
    }

    .right .top button span {
        font-size: 2rem;
    }

    .right .theme-toggler {
        margin-left: 0;
        margin-right: 0;
        order: 0;
        flex: 0 0 auto;
        justify-content: center;
    }

    .right .theme-toggler,
    .right .profile {
        margin-top: 0;
        display: flex;
        align-items: center;
    }

    .right .profile {
        order: 0;
        gap: 0.8rem;
        flex: 0 0 auto;
    }

    .right .profile .info {
        text-align: right;
    }
}

@media screen and (max-width: 600px) {
    main {
        margin-top: 6rem;
    }

    .container {
        width: 100%;
        padding: 0 0.8rem 2rem;
    }

    main h1 {
        font-size: 1.5rem;
    }

    .right .top {
        padding: 0 1rem;
    }

    .right .profile {
        gap: 1rem;
    }

    main .insights {
        gap: 1rem;
    }

    main .recent-orders table {
        min-width: 100%;
    }

    main .recent-orders thead {
        display: none;
    }

    main .recent-orders table,
    main .recent-orders tbody,
    main .recent-orders tr,
    main .recent-orders td {
        display: block;
        width: 100%;
    }

    main .recent-orders tr {
        background: var(--color-white);
        margin-bottom: 0.9rem;
        padding: 1rem;
        border-radius: var(--border-radius-2);
        box-shadow: var(--box-shadow);
    }

    main .recent-orders table tbody td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        align-items: center;
        min-height: auto;
        padding: 0.45rem 0;
        border-bottom: 1px solid var(--color-light);
        text-align: right;
    }

    main .recent-orders table tbody td::before {
        content: attr(data-label);
        color: var(--color-dark);
        font-weight: 600;
        text-align: left;
    }

    main .recent-orders table tbody tr:last-child td:last-child,
    main .recent-orders table tbody td:last-child {
        border-bottom: none;
    }

    .right {
        width: 100%;
    }

    .right .sales-analytics .item {
        padding: 1rem 1rem;
    }

    .right .profile .info {
        display: none;
    }
}

@media screen and (max-width: 420px) {
    html {
        font-size: 13px;
    }

    .container {
        padding-inline: 0.7rem;
    }

    .right .top {
        height: 4.2rem;
        padding-inline: 0.7rem;
    }

    main .date {
        width: fit-content;
        max-width: 100%;
        display: inline-flex;
        padding-inline: 0.6rem;
    }

    main .date input[type="date"] {
        width: min(100%, 9rem);
        display: block;
        min-height: 2.2rem;
        font-size: 0.92rem;
        padding-right: 1.6rem;
    }

    main .insights > div,
    .right .recent-updates .updates,
    .right .sales-analytics .item {
        padding: 1.2rem;
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.page-subtitle {
    margin-top: 0.35rem;
    color: var(--color-info-dark);
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

.hidden {
    display: none !important;
}

.message-layout {
    display: grid;
    grid-template-columns: 28rem minmax(0, 1fr);
    gap: 0;
    margin-top: 1.5rem;
    background: transparent;
    border-radius: 1.5rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.client-directory {
    background: #ffffff;
    border-radius: 0 0 0 1.5rem;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8ebee;
    transition: all 300ms ease;
}

.conversation-panel,
.transactions-card,
.stats-grid,
.search-panel {
    background: #f8fbfa;
    border-radius: 0;
    box-shadow: none;
    padding: var(--card-padding);
    transition: all 300ms ease;
}

.conversation-panel {
    border-left: 1px solid #e8ebee;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    overflow: hidden;
}

.conversation-panel .chatbox {
    min-height: 30rem;
}

.client-directory:hover,
.conversation-panel:hover {
    box-shadow: none;
}

.directory-header {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0;
    padding: 1.2rem 1rem;
    background: linear-gradient(135deg, #128c7e 0%, #0f7c72 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(18, 140, 126, 0.2);
    flex-shrink: 0;
}

.directory-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.directory-header small {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    margin: 0;
}

#message-search {
    width: 100%;
    border: none;
    border-radius: 2rem;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    color: #000000;
    background: rgba(255, 255, 255, 0.2);
    transition: all 200ms ease;
    margin: 0;
}

#message-search::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#message-search:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.client-directory input:focus,
.search-panel input:focus,
#message-input:focus,
#client-search:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-white);
    box-shadow: 0 0 0 3px rgba(115, 128, 236, 0.1);
}

.client-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.client-list::-webkit-scrollbar {
    width: 5px;
}

.client-list::-webkit-scrollbar-track {
    background: transparent;
}

.client-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 999px;
}

.client-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.client-item {
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #eef2f5;
    border-radius: 0;
    padding: 1rem 1rem;
    cursor: pointer;
    text-align: left;
    transition: all 150ms ease;
    display: flex;
    gap: 0.85rem;
    align-items: center;
    position: relative;
    margin: 0;
}

.client-item:last-child {
    border-bottom: none;
}

.client-item::before {
    display: none;
}

.client-item.active {
    background: rgba(18, 140, 126, 0.08);
    border-left: 4px solid #128c7e;
    transform: none;
}

.client-item:hover {
    background: rgba(18, 140, 126, 0.05);
    transform: none;
}

.client-item-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #128c7e, #0f7c72);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(18, 140, 126, 0.2);
}

.client-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.client-item h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-item p {
    font-size: 0.85rem;
    color: #666666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-item small {
    display: block;
    font-size: 0.8rem;
    color: #999999;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-status {
    display: none;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #128c7e 0%, #0f7c72 100%);
    color: #ffffff;
    border-bottom: none;
    border-radius: 0;
    gap: 1rem;
}

.conversation-header h2 {
    font-size: 1.1rem;
    color: #ffffff;
    margin: 0;
    font-weight: 600;
}

.conversation-header small {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.conversation-header-info {
    flex: 1;
}

.conversation-header-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.header-action-btn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 200ms ease;
    font-size: 1.1rem;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.conversation-panel {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chatbox {
    flex: 1;
    display: grid;
    grid-template-rows: minmax(20rem, 1fr) auto;
    gap: 1rem;
    min-height: 42rem;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    padding: 1.2rem;
    background: #e6f6ee;
    border: none;
    border-radius: 1.5rem 1.5rem 0.9rem 0.9rem;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 255, 255, 0.35) 2px, rgba(255, 255, 255, 0.35) 4px);
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

.message-group {
    display: flex;
    gap: 0.3rem;
    align-items: flex-end;
    margin-bottom: 0.3rem;
}

.message-group.agent {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.message-group.client {
    justify-content: flex-start;
}

.message-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: 70%;
}

.message-item.agent {
    align-items: flex-end;
}

.message-item.client {
    align-items: flex-start;
}

.message-avatar {
    display: none;
}

.message-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.message-sender {
    display: none;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: #ffffff;
    color: #111111;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 0.94rem;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.message-content:hover {
    background: #ffffff;
}

.message-group.agent .message-content {
    background: #dcf8c6;
    color: #111111;
    border-radius: 1rem 1rem 0.25rem 1rem;
}

.message-group.agent .message-content:hover {
    background: #caf0ad;
}

.message-group.client .message-content {
    background: #ffffff;
    color: #111111;
    border-radius: 1rem 1rem 1rem 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.message-group.client .message-content:hover {
    background: #f7f7f7;
}

.message-meta {
    font-size: 0.75rem;
    color: #999999;
    margin-top: 0.2rem;
}

.message-group.agent .message-meta {
    color: #999999;
    text-align: right;
}

.dark-theme-variables .message-group.agent .message-meta {
    color: rgba(255, 255, 255, 0.85);
}

.chatbox form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: #f7faf8;
    border: none;
    border-radius: 0 0 1.5rem 1.5rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 200ms ease;
}

.chatbox form:focus-within {
    background: #ffffff;
}

.chatbox form textarea {
    width: 100%;
    min-height: 2.2rem;
    max-height: 6rem;
    resize: vertical;
    padding: 0.6rem 1rem;
    border: 1px solid #e5e5ea;
    border-radius: 2rem;
    font-family: inherit;
    color: #111111;
    background: #f5f5f5;
    font-size: 0.9rem;
    transition: all 200ms ease;
}

.chatbox form textarea:focus {
    outline: none;
    border-color: #128c7e;
    background: #ffffff;
    box-shadow: none;
}

.chatbox form button {
    min-width: 2.8rem;
    width: 2.8rem;
    height: 2.8rem;
    padding: 0;
    background: #128c7e;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
    border: none;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbox form button:hover {
    background: #0f7c72;
    transform: scale(1.05);
}

.chatbox form button:active {
    transform: scale(0.95);
}

.chatbox form button .material-icons-sharp {
    font-size: 1.3rem;
    line-height: 1;
}

.message-item small {
    display: none;
}

#message-input {
    min-height: 2.2rem;
    resize: vertical;
}

.transactions-summary {
    border-top: 1px solid #e5e5ea;
    padding-top: 1rem;
    margin-top: auto;
}

.transactions-summary h3 {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111111;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 15rem;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.transactions-list::-webkit-scrollbar {
    width: 4px;
}

.transactions-list::-webkit-scrollbar-track {
    background: transparent;
}

.transactions-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 999px;
}

.transaction-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
    align-items: flex-start;
    border: 1px solid #f0f0f0;
    padding: 0.7rem;
    border-radius: 0.5rem;
    background: #f9f9f9;
    transition: all 150ms ease;
}

.transaction-row:hover {
    border-color: #e0e0e0;
    background: #ffffff;
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.transaction-row strong {
    display: block;
    margin-bottom: 0;
    font-size: 0.85rem;
    color: #111111;
    font-weight: 600;
}

.transaction-row span {
    display: block;
    color: #666666;
    font-size: 0.8rem;
}

.transaction-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.transaction-amount {
    font-size: 0.9rem;
    font-weight: 700;
    color: #128c7e;
}

.status {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    text-transform: capitalize;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid;
}

.status.completed,
.status.active,
.status.ready {
    background: rgba(18, 140, 126, 0.1);
    color: #128c7e;
    border-color: rgba(18, 140, 126, 0.2);
}

.status.prospect,
.status.review,
.status.pending {
    background: rgba(255, 187, 85, 0.18);
    color: #a15e00;
    border-color: rgba(255, 187, 85, 0.3);
}

.status.inactive,
.status.failed,
.status.closed {
    background: rgba(255, 119, 130, 0.15);
    color: #b42331;
    border-color: rgba(255, 119, 130, 0.3);
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-info-dark);
    font-size: 0.95rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.4rem;
    border-radius: var(--card-border-radius);
    background: var(--color-white);
    box-shadow: var(--box-shadow);
}

.stat-card h3 {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.stat-card h1 {
    font-size: 2rem;
}

.search-panel {
    margin-bottom: 1.5rem;
}

.toolbar-row,
.section-heading,
.form-grid,
.form-actions,
.table-actions {
    display: flex;
}

.toolbar-row {
    align-items: center;
    gap: 1rem;
}

.toolbar-row input {
    flex: 1;
}

.toolbar-row select {
    min-width: 11rem;
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-2);
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    color: var(--color-dark);
    background: var(--color-white);
    font-family: inherit;
}

.transactions-card h2 {
    margin-bottom: 1rem;
}

.section-heading {
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.results-summary {
    color: var(--color-info-dark);
    white-space: nowrap;
}

.activity-avatar {
    display: grid;
    place-items: center;
    color: white;
}

.activity-avatar span {
    font-size: 1.2rem;
}

.avatar-1 {
    background: linear-gradient(135deg, #7380ec 0%, #5dd6ff 100%);
}

.avatar-2 {
    background: linear-gradient(135deg, #ff7782 0%, #ffbb55 100%);
}

.avatar-3 {
    background: linear-gradient(135deg, #41f1b6 0%, #1fa37f 100%);
}

.avatar-4 {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.polished-table thead th,
.transactions-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-info-dark);
}

.polished-table tbody tr,
.transactions-table tbody tr {
    transition: background 180ms ease;
}

.polished-table tbody tr:hover,
.transactions-table tbody tr:hover {
    background: rgba(115, 128, 236, 0.05);
}

.table-subtext {
    margin-top: 0.35rem;
    color: var(--color-info-dark);
    font-size: 0.78rem;
}

.transactions-table th,
.transactions-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-light);
    text-align: left;
}

.transactions-table th {
    color: var(--color-dark);
    font-weight: 600;
}

.message-feed {
    margin-top: 1rem;
    display: grid;
    gap: 0.9rem;
}

.feed-item {
    background: var(--color-white);
    border-radius: var(--border-radius-2);
    padding: 1.1rem;
    border: 1.5px solid var(--color-light);
    transition: all 200ms ease;
    cursor: pointer;
}

.feed-item:hover {
    border-color: rgba(115, 128, 236, 0.3);
    box-shadow: 0 4px 12px rgba(115, 128, 236, 0.1);
    transform: translateY(-2px);
}

.feed-item h4 {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-dark);
}

.feed-item p {
    color: var(--color-info-dark);
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.feed-item small {
    font-size: 0.8rem;
    color: #bbb;
}

.summary-cards {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.summary-card {
    background: var(--color-white);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    padding: var(--card-padding);
}

.page-copy {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dashboard-card {
    background: var(--color-white);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    padding: var(--card-padding);
}

.wide-card {
    min-width: 0;
}

.priority-list,
.distribution-list {
    display: grid;
    gap: 0.9rem;
}

.priority-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: var(--border-radius-3);
    background: var(--color-background);
    border: 1px solid var(--color-light);
}

.priority-item h4 {
    margin-bottom: 0.35rem;
}

.priority-item p {
    color: var(--color-info-dark);
}

.priority-item.primary strong,
.priority-item.primary h4 {
    color: var(--color-primary);
}

.priority-item.warning strong,
.priority-item.warning h4 {
    color: #b57400;
}

.priority-item.danger strong,
.priority-item.danger h4 {
    color: var(--color-danger);
}

.distribution-item {
    padding: 1rem 1.1rem;
    border-radius: var(--border-radius-3);
    background: var(--color-background);
    border: 1px solid var(--color-light);
}

.distribution-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.distribution-bar {
    height: 0.55rem;
    background: rgba(115, 128, 236, 0.14);
    border-radius: 999px;
    overflow: hidden;
}

.distribution-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7380ec 0%, #5dd6ff 100%);
}

.primary-btn,
.secondary-btn,
.link-btn,
.ghost-btn {
    border-radius: var(--border-radius-2);
    cursor: pointer;
    font: inherit;
    transition: opacity 200ms ease, transform 200ms ease;
}

.primary-btn,
.secondary-btn {
    padding: 0.9rem 1.2rem;
}

.primary-btn {
    background: var(--color-primary);
    color: var(--color-white);
}

.secondary-btn {
    background: var(--color-light);
    color: var(--color-dark);
}

.primary-btn:hover,
.secondary-btn:hover,
.link-btn:hover,
.ghost-btn:hover {
    opacity: 0.92;
}

.ghost-btn {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid rgba(115, 128, 236, 0.2);
    padding: 0.75rem 1rem;
}

.client-form {
    margin-top: 1.25rem;
}

.form-grid {
    flex-wrap: wrap;
    gap: 1rem;
}

.form-grid label {
    flex: 1 1 15rem;
    display: grid;
    gap: 0.45rem;
    color: var(--color-dark);
    font-weight: 500;
}

.form-grid input,
.form-grid select {
    width: 100%;
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-2);
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    color: var(--color-dark);
    background: var(--color-white);
    font-family: inherit;
}

.form-actions {
    gap: 0.8rem;
    margin-top: 1rem;
}

.form-feedback {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--border-radius-2);
    font-weight: 500;
}

.form-feedback.success {
    background: rgba(65, 241, 182, 0.12);
    color: #167b57;
}

.form-feedback.error {
    background: rgba(255, 119, 130, 0.12);
    color: #b42331;
}

.client-table {
    margin-bottom: 0.5rem;
}

.table-actions {
    align-items: center;
    gap: 0.7rem;
}

.link-btn {
    background: transparent;
    color: var(--color-primary);
    padding: 0;
}

.danger-text {
    color: var(--color-danger);
}

.empty-table {
    text-align: center;
    color: var(--color-info-dark);
    padding: 1.3rem 1rem !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 20;
}

.client-modal {
    width: min(56rem, 100%);
    max-height: min(90vh, 52rem);
    overflow-y: auto;
    background: var(--color-white);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.modal-header,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-content {
    margin-top: 1.25rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-card {
    background: var(--color-background);
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-3);
    padding: 1.2rem;
}

.modal-card h3 {
    margin-bottom: 0.85rem;
}

.detail-list {
    display: grid;
    gap: 0.8rem;
}

.detail-list div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--color-light);
    padding-bottom: 0.75rem;
}

.detail-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-list span {
    color: var(--color-info-dark);
}

.modal-transactions {
    display: grid;
    gap: 0.85rem;
}

.modal-transaction {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-2);
    background: var(--color-white);
    border: 1px solid var(--color-light);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 50%;
    background: var(--color-light);
    color: var(--color-dark);
    cursor: pointer;
}

.modal-actions {
    margin-top: 1.25rem;
}

.settings-form {
    margin-top: 0.6rem;
}

.analytics-grid {
    align-items: start;
}

.property-stats .stat-card h1,
.dashboard-card h2 {
    word-break: break-word;
}

@media screen and (max-width: 1100px) {
    .message-layout {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-directory {
        background: #ffffff;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .directory-header {
        background: linear-gradient(135deg, #128c7e 0%, #0f7c72 100%);
        color: #ffffff;
        padding: 1rem;
        border-radius: 0;
        margin: 0;
        gap: 0.8rem;
    }

    .directory-header h2 {
        color: #ffffff;
        font-size: 1.1rem;
        margin: 0;
    }

    .directory-header small {
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.8rem;
    }

    #message-search {
        margin: 0;
        border-radius: 2rem;
        padding: 0.7rem 1rem;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: #ffffff;
    }

    #message-search::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

    #message-search:focus {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    }

    .client-list {
        flex: 1;
        overflow-y: auto;
        padding: 0;
        gap: 0;
    }

    .client-list::-webkit-scrollbar {
        width: 5px;
    }

    .client-list::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
    }

    .client-item {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0.9rem 1rem;
        border-bottom: 1px solid #e5e5ea;
        gap: 0.8rem;
        margin: 0;
    }

    .client-item::before {
        display: none;
    }

    .client-item.active {
        background: rgba(18, 140, 126, 0.08);
        border-color: rgba(18, 140, 126, 0.15);
        transform: none;
    }

    .client-item:hover {
        background: rgba(0, 0, 0, 0.03);
        transform: none;
    }

    .client-item-avatar {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 0.9rem;
        background: linear-gradient(135deg, #128c7e, #0f7c72);
    }

    .client-item h3 {
        margin: 0;
        font-size: 0.95rem;
    }

    .client-item p {
        margin: 0.1rem 0 0 0;
        font-size: 0.85rem;
    }

    .client-item small {
        margin: 0.2rem 0 0 0;
        font-size: 0.8rem;
    }

    .client-status {
        display: none;
    }

    .mobile-back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.2rem;
        height: 2.2rem;
        border-radius: 50%;
        background: transparent;
        border: none;
        color: #ffffff;
        cursor: pointer;
        transition: transform 200ms ease, background 200ms ease;
        font-size: 1.4rem;
    }

    .mobile-back-btn:hover {
        transform: translateX(-2px);
        background: rgba(255, 255, 255, 0.15);
    }

    .mobile-back-btn.hidden {
        display: none;
    }

    .message-layout.mobile-chat-open .client-directory {
        display: none;
    }

    .message-layout.mobile-chat-open .conversation-panel {
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        padding: 0;
        background: #ffffff;
        box-shadow: none;
        margin: 0;
        display: flex;
        flex-direction: column;
        border-radius: 0;
        overflow: hidden;
    }

    .message-layout.mobile-chat-open .transactions-summary {
        display: none;
    }

    .message-layout.mobile-chat-open .chatbox {
        min-height: auto;
        gap: 0;
    }

    .message-layout.mobile-chat-open .chat-messages {
        flex: 1;
    }

    .message-layout.mobile-chat-open .chatbox form {
        border-radius: 0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    }

    .conversation-panel {
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    .conversation-header {
        align-items: center;
        gap: 0.8rem;
        padding: 1.2rem 1rem;
        background: linear-gradient(135deg, #128c7e 0%, #0f7c72 100%);
        color: #ffffff;
        border-bottom: none;
        border-radius: 0;
        flex-shrink: 0;
    }

    .conversation-header h2 {
        color: #ffffff;
        font-size: 1.1rem;
        font-weight: 600;
        margin: 0;
    }

    .conversation-header small {
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.8rem;
        margin: 0;
    }

    .conversation-header-info {
        flex: 1;
    }

    .conversation-header-actions {
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .header-action-btn {
        width: 2.2rem;
        height: 2.2rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        transition: all 200ms ease;
        font-size: 1.1rem;
    }

    .header-action-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

    .chatbox {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: auto;
        background: #ffffff;
        padding: 0;
    }

    .chat-messages {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        overflow-y: auto;
        padding: 1rem;
        background: #ffffff;
        border: none;
        border-radius: 0;
        background-image: 
            repeating-linear-gradient(
                90deg,
                transparent,
                transparent 2px,
                rgba(200, 220, 200, 0.08) 2px,
                rgba(200, 220, 200, 0.08) 4px
            );
    }

    .chat-messages::-webkit-scrollbar {
        width: 5px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 999px;
    }

    .message-group {
        display: flex;
        gap: 0.4rem;
        align-items: flex-end;
        margin-bottom: 0.2rem;
    }

    .message-group.agent {
        flex-direction: row-reverse;
        justify-content: flex-end;
    }

    .message-avatar {
        display: none;
    }

    .message-item {
        max-width: 80%;
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }

    .message-item.agent {
        align-self: flex-end;
    }

    .message-item.client {
        align-self: flex-start;
    }

    .message-sender {
        display: none;
    }

    .message-content {
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
        word-break: break-word;
        line-height: 1.4;
        box-shadow: none;
    }

    .message-group.agent .message-content {
        background: #dcf8c6;
        color: #000000;
        border-radius: 1rem 0.3rem 1rem 1rem;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }

    .message-group.client .message-content {
        background: #e5e5ea;
        color: #000000;
        border-radius: 0.3rem 1rem 1rem 1rem;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }

    .message-content:hover {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    }

    .message-meta {
        font-size: 0.7rem;
        color: rgba(0, 0, 0, 0.45);
        margin: 0.2rem 0.35rem 0 0.35rem;
        text-align: right;
    }

    .message-group.client .message-meta {
        text-align: left;
        margin: 0.2rem 0.35rem 0 0.35rem;
    }

    .chatbox form {
        display: flex;
        gap: 0.6rem;
        align-items: flex-end;
        padding: 1rem;
        background: #ffffff;
        border-radius: 0;
        box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
        border: none;
        flex-shrink: 0;
    }

    .chatbox form:focus-within {
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    }

    .chatbox form textarea {
        width: 100%;
        min-height: 2.5rem;
        max-height: 6rem;
        resize: vertical;
        padding: 0.7rem 1rem;
        border: 1px solid #e5e5ea;
        border-radius: 2rem;
        font-family: inherit;
        color: #000000;
        background: #f5f5f5;
        font-size: 0.95rem;
        transition: all 200ms ease;
    }

    .chatbox form textarea:focus {
        outline: none;
        border-color: #128c7e;
        background: #ffffff;
        box-shadow: inset 0 0 0 1px rgba(18, 140, 126, 0.1);
    }

    .chatbox form textarea::placeholder {
        color: #999999;
    }

    .chatbox form button {
        min-width: 2.8rem;
        width: 2.8rem;
        height: 2.8rem;
        padding: 0;
        background: linear-gradient(135deg, #128c7e 0%, #0f7c72 100%);
        border-radius: 50%;
        color: #ffffff;
        cursor: pointer;
        font-weight: 600;
        border: none;
        transition: all 200ms ease;
        white-space: nowrap;
        box-shadow: 0 2px 4px rgba(18, 140, 126, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .chatbox form button span {
        font-size: 1.3rem;
        line-height: 1;
    }

    .chatbox form button:hover {
        transform: scale(1.08);
        box-shadow: 0 3px 8px rgba(18, 140, 126, 0.3);
    }

    .chatbox form button:active {
        transform: scale(0.95);
    }

    .empty-state {
        text-align: center;
        padding: 2rem 1rem;
        color: #999999;
        font-size: 0.95rem;
    }

    .message-item small {
        display: none;
    }

    .conversation-panel,
    .transactions-card,
    .stats-grid,
    .search-panel {
        padding: 1rem;
    }

    .toolbar-row,
    .section-heading,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-header,
    .modal-actions,
    .detail-list div,
    .modal-transaction {
        flex-direction: column;
        align-items: stretch;
    }
}
