:root {
    --teal: #008891;
    --teal-dark: #006b73;
    --ink: #0d2742;
    --muted: #6c7f96;
    --line: #d8e7ea;
    --surface: #ffffff;
    --soft: #eaf6f7;
    --page: #f5f8fa;
    --success: #10a66f;
    --danger: #f71d5b;
    --warning: #ff9f68;
    --shadow: 0 18px 40px rgba(13, 39, 66, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--page);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
}

.shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.brand,
.user-card,
.topbar,
.top-actions,
.metric-head,
.panel-head,
.title-row,
.module-row,
.alert-title,
.actions {
    display: flex;
    align-items: center;
}

.brand {
    gap: 12px;
    padding: 22px;
}

.brand-mark,
.avatar,
.icon-pill,
.card-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: var(--teal);
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(0, 136, 145, .24);
}

.brand strong {
    display: block;
    color: var(--teal-dark);
    font-size: 18px;
    line-height: 1;
}

.brand span,
.workspace span,
.user-card span,
.small,
.field span {
    color: var(--muted);
    font-size: 12px;
}

.workspace {
    margin: 0 16px 18px;
    padding: 16px;
    border-radius: 10px;
    background: #e7f3f4;
}

.workspace strong {
    display: block;
    margin-bottom: 6px;
    color: var(--teal-dark);
    font-size: 13px;
}

.nav {
    overflow: auto;
    padding: 0 16px 16px;
}

.nav-title {
    margin: 18px 4px 8px;
    color: #667c93;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: #14314b;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.nav-item.active {
    color: var(--teal-dark);
    background: #d3ebec;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 24px;
    margin-top: 2px;
}

.nav-submenu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.nav-submenu-item:hover {
    color: var(--teal-dark);
    background: var(--soft);
    padding-left: 16px;
}

.nav-submenu-item.active {
    color: var(--teal-dark);
    background: var(--soft);
    font-weight: 700;
}

.nav-submenu-bullet {
    font-size: 14px;
    line-height: 1;
    color: var(--teal);
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.nav-submenu-item.active .nav-submenu-bullet {
    opacity: 1;
    transform: scale(1.2);
}

.nav-item svg,
.top-icon svg,
.search svg,
.card-icon svg,
.row-action svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.user-card {
    gap: 10px;
    margin-top: auto;
    padding: 18px;
    border-top: 1px solid var(--line);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    background: var(--teal);
    font-size: 13px;
    font-weight: 800;
}

.content {
    min-width: 0;
}

.topbar {
    justify-content: space-between;
    gap: 20px;
    height: 70px;
    padding: 0 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.topbar h1 {
    margin: 0;
    color: var(--teal-dark);
    font-size: 18px;
}

.top-actions {
    gap: 12px;
}

.search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(390px, 34vw);
    height: 42px;
    padding: 0 14px;
    border: 1px solid #8fc7d0;
    border-radius: 7px;
    color: var(--muted);
    background: #fff;
}

.search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--ink);
}

.top-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    color: #496176;
    background: #f2f7f8;
    cursor: pointer;
}

.main {
    min-height: calc(100vh - 70px);
    padding: 30px;
    background: linear-gradient(180deg, #e6f3f4 0, #eef7f8 310px, #f7fafb 311px);
}

.main.platform-main {
    background: linear-gradient(180deg, #e6f3f4 0, #eef7f8 260px, #f7fafb 261px);
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.title-row {
    gap: 14px;
}

.icon-pill {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: var(--teal);
    background: #cfecee;
}

.hero h2 {
    margin: 0 0 6px;
    color: var(--teal-dark);
    font-size: 28px;
}

.breadcrumbs {
    display: flex;
    gap: 10px;
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 700;
}

.welcome {
    margin: 24px 0 0;
}

.welcome h3 {
    margin: 0;
    color: var(--teal-dark);
    font-size: 22px;
}

.welcome p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--teal);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 136, 145, .18);
}

.button.secondary {
    color: var(--teal-dark);
    background: #fff;
    border: 1px solid #9ccdd4;
    box-shadow: none;
}

.button.danger {
    background: var(--danger);
    box-shadow: 0 10px 18px rgba(247, 29, 91, .18);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.metric-card,
.panel {
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 132px;
    padding: 22px;
}

.metric-card.compact {
    min-height: 118px;
}

.metric-head,
.panel-head {
    justify-content: space-between;
    gap: 16px;
}

.metric-card h4,
.panel h4 {
    margin: 0;
    color: #536c83;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.card-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.card-icon.mint {
    color: #00a977;
    background: #d7faeb;
}

.card-icon.blue {
    color: #3978ff;
    background: #e2ebff;
}

.card-icon.violet {
    color: #9f3cff;
    background: #f0dcff;
}

.card-icon.rose {
    color: #f71d5b;
    background: #ffe1e7;
}

.metric-value {
    margin: 22px 0 8px;
    color: var(--teal-dark);
    font-size: 28px;
    font-weight: 900;
}

.metric-card.compact .metric-value {
    margin-top: 18px;
}

.change {
    color: var(--success);
    font-size: 12px;
    font-weight: 900;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, .96fr);
    gap: 22px;
}

.panel {
    padding: 24px;
}

.panel-link {
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.panel-value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: var(--teal-dark);
    font-size: 26px;
    font-weight: 900;
}

.badge,
.status-pill,
.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 900;
}

.badge {
    min-height: 20px;
    padding: 0 9px;
    color: #00875f;
    background: #d9f8ec;
    font-size: 11px;
}

.select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #91c9d0;
    border-radius: 7px;
    color: #45617a;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
}

.chart {
    width: 100%;
    height: 326px;
}

.chart.tenant-chart {
    height: 308px;
    margin-top: 12px;
}

.chart-grid {
    stroke: #e2ecef;
    stroke-dasharray: 4 6;
}

.chart-area {
    fill: url(#chartFill);
}

.chart-line {
    fill: none;
    stroke: var(--teal);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5;
}

.side-stack {
    display: grid;
    gap: 22px;
}

.program {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #6fbdc5;
    border-radius: 14px;
    margin-top: 14px;
}

.program-icon,
.module-mark {
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
}

.program-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.program strong,
.appointment strong,
.doc-alert strong,
.activity strong,
.list-item strong {
    display: block;
    font-size: 14px;
}

.program span,
.activity span {
    color: var(--muted);
    font-size: 12px;
}

.program b {
    color: var(--teal-dark);
    font-size: 15px;
}

.activity {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eef3f5;
}

.activity:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--teal);
}

.lower-section {
    display: grid;
    gap: 22px;
    margin-top: 22px;
}

.cases-table-wrap,
.table-wrap {
    overflow-x: auto;
}

.cases-table-wrap {
    margin: 0 -24px -12px;
}

.table-wrap {
    margin: 0 -24px -12px;
}

.table-wrap.offset {
    margin-top: 18px;
}

.cases-table,
table {
    width: 100%;
    border-collapse: collapse;
}

.cases-table {
    min-width: 840px;
}

table {
    min-width: 760px;
}

.wide-table {
    min-width: 960px;
}

.cases-table th,
.cases-table td,
th,
td {
    padding: 16px 24px;
    text-align: left;
    border-top: 1px solid #edf3f5;
}

td {
    vertical-align: top;
}

.cases-table th,
th {
    color: #60778e;
    background: #f0f7f8;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.cases-table td {
    padding: 18px 24px;
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.mini-avatar,
.date-card,
.document-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.mini-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--teal-dark);
    background: #dff2f2;
    font-size: 11px;
    font-weight: 900;
}

.cases-table tr:nth-child(3) .mini-avatar {
    color: #b66200;
    background: #fff0d9;
}

.cases-table tr:nth-child(4) .mini-avatar {
    color: #f71d5b;
    background: #ffe4ec;
}

.country-code {
    margin-right: 8px;
    color: #45617a;
    font-weight: 800;
}

.status-pill {
    min-height: 26px;
    padding: 0 12px;
    font-size: 12px;
}

.status-pill.info {
    color: var(--teal-dark);
    background: #dff3f4;
    border: 1px solid #9fd3d8;
}

.status-pill.success {
    color: #00875f;
    background: #dcf8ea;
    border: 1px solid #a9ebca;
}

.status-pill.danger {
    color: var(--danger);
    background: #ffe6ed;
    border: 1px solid #ffb7ca;
}

.status-pill.warning {
    color: #b66200;
    background: #fff0d9;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.row-action {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    color: var(--teal-dark);
    background: #eef7f8;
    box-shadow: 0 7px 14px rgba(13, 39, 66, .08);
}

.row-action svg {
    width: 16px;
    height: 16px;
}

.bottom-grid,
.lower-grid,
.grid {
    display: grid;
    gap: 22px;
}

.bottom-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.lower-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    margin-top: 22px;
}

.grid {
    grid-template-columns: minmax(360px, .78fr) minmax(0, 1.22fr);
}

.appointment {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #b8d9de;
    border-radius: 14px;
    background: #f1f8f9;
}

.date-card {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 14px rgba(13, 39, 66, .08);
    color: var(--teal-dark);
    line-height: 1;
    font-weight: 900;
}

.date-card span {
    display: block;
    color: #558098;
    font-size: 10px;
    letter-spacing: .08em;
}

.date-card b {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.appointment p,
.doc-alert p,
.alert-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.alert-panel {
    border: 1px solid #ffe0e8;
    box-shadow: 0 18px 40px rgba(247, 29, 91, .08);
}

.alert-title {
    gap: 10px;
}

.alert-title h4 {
    color: var(--danger);
}

.alert-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--danger);
    background: #ffe4ec;
}

.pending-badge {
    color: var(--danger);
    background: #ffe4ec;
}

.doc-alert {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #ffd2dd;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 20px rgba(247, 29, 91, .08);
}

.document-icon {
    position: relative;
    width: 50px;
    height: 50px;
    border: 1px solid #ffc8d6;
    border-radius: 12px;
    color: var(--danger);
    background: #fff2f6;
}

.document-icon svg {
    width: 20px;
    height: 20px;
}

.document-icon::after {
    content: "!";
    position: absolute;
    right: -5px;
    bottom: -5px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    background: #ff7d9b;
    font-size: 11px;
    font-weight: 900;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
}

.doc-type {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border: 1px solid #ffb7ca;
    border-radius: 999px;
    color: var(--danger);
    background: #fff2f6;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    color: #fff;
    background: var(--danger);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 10px 18px rgba(247, 29, 91, .24);
}

.deficiency-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: 18px;
    border: 1px dashed #ffb7ca;
    border-radius: 14px;
    color: var(--danger);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
}

.module-row {
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #eef3f5;
}

.module-row:last-child,
.list-item:last-child {
    border-bottom: 0;
}

.module-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9f1f3;
    margin-top: 8px;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.item-title,
.tenant-title {
    display: block;
    font-weight: 850;
}

.tenant-title {
    color: var(--ink);
    font-weight: 900;
}

.list-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eef3f5;
}

.pill {
    min-height: 24px;
    padding: 0 10px;
    color: var(--teal-dark);
    background: #dff3f4;
    font-size: 11px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #536c83;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.field input,
.field select,
.inline-form input,
.inline-form select {
    color: var(--ink);
    background: #fff;
    border: 1px solid #b8d9de;
    border-radius: 8px;
}

.field input,
.field select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    outline: 0;
}

.field input:focus,
.field select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 136, 145, .12);
}

.error-list,
.status {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 750;
}

.error-list {
    color: #9a123d;
    background: #ffe8ef;
    border: 1px solid #ffc4d3;
}

.status {
    color: #007856;
    background: #dcf8ea;
    border: 1px solid #a9ebca;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: start;
}

.inline-form form,
.inline-fields {
    display: contents;
}

.inline-form input,
.inline-form select {
    min-height: 38px;
    padding: 0 10px;
}

.inline-form input {
    width: 160px;
}

.inline-form select {
    width: 150px;
}

.logout {
    margin: 0;
}

.logout button {
    cursor: pointer;
}

@media (max-width: 1180px) {
    .shell {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .brand strong,
    .brand span,
    .workspace,
    .nav-title,
    .nav-item span,
    .user-card div {
        display: none;
    }

    .brand,
    .user-card {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .nav {
        padding: 0 12px 16px;
    }

    .nav-item {
        justify-content: center;
        padding: 0;
    }

    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .bottom-grid,
    .lower-grid,
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav,
    .workspace,
    .user-card {
        display: none;
    }

    .brand strong,
    .brand span {
        display: block;
    }

    .topbar {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .top-actions {
        flex-wrap: wrap;
    }

    .search {
        width: 100%;
    }

    .main {
        padding: 18px;
    }

    .hero {
        flex-direction: column;
    }

    .metrics,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field.full {
        grid-column: auto;
    }

    .program {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .program b {
        grid-column: 2;
    }

    .appointment,
    .doc-alert {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .appointment .status-pill,
    .doc-alert .upload-button {
        grid-column: 2;
        width: fit-content;
    }

    .list-item {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .list-item .small {
        grid-column: 2;
    }
}

/* ==========================================================================
   ESTILOS DE AUTENTICAÇÃO (SISTEMA DE LAYOUT AUTH-SHELL)
   ========================================================================== */

body.auth-layout {
    --bg: #f4f7f4;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --border: rgba(15, 23, 42, 0.1);
    --text: #17313b;
    --muted: #67808a;
    --accent: #1f8c8f;
    --accent-deep: #156d70;
    --accent-soft: #d9f1ef;
    --shadow: 0 30px 80px rgba(24, 75, 87, 0.15);
    --radius-xl: 32px;
    --radius-lg: 22px;
    --radius-md: 16px;

    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(31, 140, 143, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(247, 178, 103, 0.18), transparent 26%),
        linear-gradient(135deg, #f8fbfa 0%, #eef6f5 52%, #f8f6ef 100%);
}

.auth-layout .auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.auth-layout .auth-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(300px, 1.1fr) minmax(320px, 0.9fr);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.auth-layout .auth-brand {
    position: relative;
    padding: 56px;
    background:
        linear-gradient(160deg, rgba(31, 140, 143, 0.95), rgba(22, 109, 112, 0.9)),
        linear-gradient(180deg, #1f8c8f, #156d70);
    color: #f7fffe;
}

.auth-layout .auth-brand::after {
    content: "";
    position: absolute;
    inset: auto -80px -110px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.auth-layout .brand-badge {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-layout .brand-kicker {
    margin: 28px 0 10px;
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.78;
}

.auth-layout .brand-title {
    margin: 0;
    font-size: clamp(2.2rem, 3vw, 3.6rem);
    line-height: 1;
}

.auth-layout .brand-copy {
    max-width: 420px;
    margin: 20px 0 0;
    line-height: 1.7;
    color: rgba(247, 255, 254, 0.85);
}

.auth-layout .brand-panel {
    margin-top: 42px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-layout .brand-panel strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
}

.auth-layout .brand-panel p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(247, 255, 254, 0.76);
}

.auth-layout .auth-content {
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.84);
}

.auth-layout .auth-card {
    width: min(100%, 420px);
}

.auth-layout .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-layout h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
}

.auth-layout .subtitle {
    margin: 14px 0 28px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-layout .field {
    margin-bottom: 18px;
}

.auth-layout .field-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #56717b;
}

.auth-layout .field input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.auth-layout .field input:focus {
    border-color: rgba(31, 140, 143, 0.55);
    box-shadow: 0 0 0 5px rgba(31, 140, 143, 0.12);
    transform: translateY(-1px);
}

.auth-layout .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 24px;
    color: var(--muted);
    font-size: 0.95rem;
}

.auth-layout .checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-layout .checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.auth-layout .link {
    color: var(--accent-deep);
    text-decoration: none;
    font-weight: 700;
}

.auth-layout .submit {
    width: 100%;
    height: 58px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(21, 109, 112, 0.18);
}

.auth-layout .submit:hover {
    filter: brightness(1.03);
}

.auth-layout .note,
.auth-layout .status,
.auth-layout .errors {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-layout .note {
    background: #f3f7f8;
    color: var(--muted);
}

.auth-layout .status {
    background: #e6f7ef;
    color: #176048;
}

.auth-layout .errors {
    background: #fff1f1;
    color: #a33a3a;
}

.auth-layout .split-actions {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.auth-layout .portal-option {
    display: block;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.9);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.auth-layout .portal-option:hover {
    transform: translateY(-2px);
    border-color: rgba(31, 140, 143, 0.24);
    box-shadow: 0 18px 32px rgba(20, 58, 69, 0.08);
}

.auth-layout .portal-option strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.auth-layout .portal-option span {
    color: var(--muted);
    line-height: 1.55;
}

@media (max-width: 920px) {
    .auth-layout .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-layout .auth-brand,
    .auth-layout .auth-content {
        padding: 36px 24px;
    }
}

/* ==========================================================================
   ESTILOS DE PLANOS E LIMITES (CRUD DE PLATAFORMA)
   ========================================================================== */

.feature-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 136, 145, 0.08);
    color: #008891;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 2px;
    font-weight: 500;
    border: 1px solid rgba(0, 136, 145, 0.15);
}

.feature-pill.boolean {
    background: rgba(65, 184, 131, 0.08);
    color: #41b883;
    border-color: rgba(65, 184, 131, 0.15);
}

.feature-pills-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 320px;
}

.text-muted {
    color: #6c7f96;
    font-size: 0.8rem;
}

.vertical-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-grid-spacious {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-grid-spacious .field.full {
    grid-column: 1 / -1;
}

.limit-horizontal-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.5fr auto;
    gap: 20px;
    align-items: end;
}

@media (max-width: 900px) {
    .limit-horizontal-grid {
        grid-template-columns: 1fr;
    }
    .limit-horizontal-grid .button-field {
        text-align: right;
    }
    .limit-horizontal-grid .button-field button {
        width: 100%;
    }
}

.pill-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.pill-badge.limit {
    background: rgba(0, 136, 145, 0.1);
    color: #008891;
}

.pill-badge.boolean {
    background: rgba(65, 184, 131, 0.1);
    color: #41b883;
}



/* Chat Styles */
.shell .main.p-0 { padding: 0 !important; }
.chat-container {
    display: flex;
    height: calc(100vh - 80px); /* adjusted topbar height */
    background-color: #eaf6f6; /* very light teal background to match the picture */
    font-family: 'Inter', sans-serif;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* Left Column - Contacts */
.chat-sidebar {
    width: 340px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.chat-sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.chat-sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
}
.chat-sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.05em;
}
.chat-sidebar-edit-icon {
    width: 32px;
    height: 32px;
    background: #def1f1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d7b7f;
    cursor: pointer;
}
.chat-search-wrap {
    position: relative;
}
.chat-search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}
.chat-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: none;
    border-radius: 20px;
    background: #fff;
    font-size: 0.875rem;
    outline: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.contact-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.contact-item {
    padding: 1rem;
    border-radius: 16px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: all 0.2s;
}
.contact-item:hover {
    background: rgba(255,255,255,0.5);
}
.contact-item.active {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.contact-avatar-wrap {
    position: relative;
}
.contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0d7b7f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}
.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #fff;
    border-radius: 50%;
}
.contact-item.active .status-dot {
    border-color: #fff;
}
.contact-item:not(.active) .status-dot {
    border-color: #eaf6f6;
}
.contact-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.contact-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.contact-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.contact-time {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
}
.contact-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.contact-preview {
    font-size: 0.8rem;
    color: #0d7b7f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.contact-item:not(.active) .contact-preview {
    color: #6b7280;
    font-weight: 400;
}
.contact-unread {
    background: #0d7b7f;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Middle Column - Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    overflow: hidden;
}
.chat-header {
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}
.chat-header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.chat-header-info .name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
}
.chat-header-info .status {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 700;
    display: flex;
    align-items: center;
}
.chat-header-info .status-text {
    color: #6b7280;
    font-weight: 500;
    margin-left: 0.35rem;
}
.chat-header-actions {
    display: flex;
    gap: 1rem;
    color: #6b7280;
}
.chat-header-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s;
}
.chat-header-actions button:hover {
    color: #111827;
    background: #f3f4f6;
}

/* Hexagonal background pattern approximation */
.chat-messages-area {
    flex: 1;
    background-color: #fdfdfd;
    background-image: radial-gradient(#f0f2f5 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.date-divider {
    text-align: center;
    margin: 1rem 0;
}
.date-divider span {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 14px;
    letter-spacing: 0.05em;
}

.message-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}
.message-row.sent {
    flex-direction: row-reverse;
}
.message-bubble {
    max-width: 65%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.message-row.received .message-bubble {
    background: #f4f7f6;
    color: #374151;
    border-bottom-left-radius: 4px;
}
.message-row.sent .message-bubble {
    background: #0d7b7f;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.message-time {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.message-row.sent .message-time {
    justify-content: flex-end;
}

.chat-input-wrapper {
    padding: 1.25rem 2rem;
    background: #fff;
    border-top: 1px solid #f3f4f6;
}
.chat-input-container {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    gap: 0.75rem;
}
.input-action-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.input-action-btn:hover {
    color: #4b5563;
    background: #e5e7eb;
}
.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: #374151;
    padding: 0.5rem 0;
}
.chat-input::placeholder {
    color: #9ca3af;
}
.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0d7b7f;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.send-btn:hover {
    background: #0a6265;
}

/* Right Column - Context (Hidden by default unless toggled) */
.chat-context {
    width: 320px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.context-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
    color: #111827;
}
.context-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.context-section {
    margin-bottom: 1.5rem;
}
.context-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}
.context-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}



/* Marketplace Styles */
.marketplace-icon-pill {
    background: #eef2f6;
    color: #3b82f6;
}
.marketplace-hero-text {
    margin-top: 4px;
    font-size: 0.95rem;
}
.marketplace-status {
    margin: 20px 0;
    padding: 16px;
    border-radius: 8px;
    background: #dcfce7;
    color: #166534;
    font-weight: 500;
}
.marketplace-plan-card {
    margin: 24px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.marketplace-plan-title {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    color: #111827;
    font-weight: 600;
}
.marketplace-plan-details {
    display: flex;
    gap: 16px;
    align-items: center;
    color: #4b5563;
    font-size: 0.95rem;
}
.marketplace-plan-btn {
    background: #111827 !important;
    color: white !important;
}
.marketplace-section-title {
    margin: 32px 0 0 0;
    font-size: 1.25rem;
    color: #111827;
    font-weight: 600;
}
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px 0;
}
.marketplace-app-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
}
.marketplace-app-card.featured {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.marketplace-featured-badge {
    position: absolute;
    top: -12px;
    right: 24px;
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.marketplace-app-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.marketplace-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #f3f4f6;
}
.marketplace-app-icon-placeholder {
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.marketplace-app-info {
    flex: 1;
}
.marketplace-app-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.marketplace-app-name {
    margin: 4px 0 0 0;
    font-size: 1.15rem;
    color: #111827;
    font-weight: 600;
}
.marketplace-app-body {
    flex: 1;
}
.marketplace-app-desc {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 24px;
}
.marketplace-app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
    margin-top: auto;
}
.marketplace-price-free {
    font-size: 1.15rem;
    font-weight: 700;
    color: #16a34a;
}
.marketplace-price-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
}
.marketplace-price-cycle {
    font-size: 0.85rem;
    color: #6b7280;
}
.marketplace-action-right {
    text-align: right;
}
.marketplace-btn-disabled {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border-color: #e5e7eb !important;
    cursor: default !important;
}
.marketplace-btn-icon {
    margin-right: 6px;
}
.marketplace-date-info {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}
.marketplace-btn-primary {
    background: #111827 !important;
    color: white !important;
}
.marketplace-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed #d1d5db;
}
.marketplace-empty-icon {
    margin-bottom: 16px;
    display: inline-block;
}
.marketplace-empty-title {
    font-size: 1.1rem;
    color: #374151;
    font-weight: 500;
    margin-bottom: 8px;
}
.marketplace-empty-text {
    color: #6b7280;
}

/* Auto-extracted utility classes */
.u-mt-18 { margin-top: 18px; }
.u-mb-20 { margin-bottom: 20px; }
.u-style-8d95a5 { padding-top: 6px; }
.u-style-5bac15 { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: normal; }
.u-style-dc251b { width: auto; }
.u-style-7aa133 { width: 100%; border: 1px solid #d0d7de; border-radius: 6px; padding: 8px 12px; font-family: inherit; font-size: 0.9rem; resize: vertical; }
.u-style-5c2918 { margin-top: 24px; }
.u-style-ccd7dd { margin-bottom: 8px; }
.u-style-214129 { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; }
.u-style-1c20bb { display: flex; align-items: center; gap: 12px; }
.u-style-e29177 { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; }
.u-style-5a1f88 { width: 32px; height: 32px; background: #eef2f5; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.u-style-6301ae { font-size: 1.05rem; font-weight: 600; color: #1a253c; display: flex; align-items: center; gap: 6px; }
.u-style-cfdfd8 { font-size: 0.7rem; background: #fffbeb; color: #b45309; padding: 2px 6px; }
.u-style-0f7b9c { font-family: monospace; background: #eef2f5; padding: 2px 6px; border-radius: 4px; }
.u-style-00f519 { font-family: monospace; font-size: 0.85rem; color: #4b5563; }
.u-style-a6b9ef { background: rgba(31, 140, 143, 0.1); color: #1f8c8f; }
.u-style-b9697b { font-weight: 600; color: #1a253c; font-size: 1rem; }
.u-style-6a9bb6 { background: #dcfce7; color: #166534; }
.u-style-bd41af { background: #f1f5f9; color: #475569; }
.u-style-0b7d1f { text-align: center; padding: 24px; }
.u-mb-0 { margin-bottom: 0; }
.u-w-100 { width: 100%; }
.u-style-55f6e9 { display: none; margin-top: 8px; }
.u-style-e8112b { display: none; margin-bottom: 0; }
.u-style-368535 { height: 40px; padding: 0 24px; }
.u-style-894de4 { color: #1a253c; font-size: 0.95rem; }
.u-style-6dfe1c { display: block; font-size: 0.75rem; margin-top: 2px; }
.u-style-1d1dfb { font-weight: 600; color: #1a253c; font-family: monospace; }
.u-style-b13125 { display: flex; gap: 8px; align-items: center; }
.u-style-eb6455 { padding: 6px 12px; font-size: 0.8rem; }
.u-style-b82fcf { font-size: 1.05rem; font-weight: 600; color: #1a253c; }
.u-style-8396d7 { margin-top: 4px; margin-bottom: 0; max-width: 250px; font-size: 0.75rem; }
.u-style-57eca1 { margin-top: 4px; }
.u-style-dd76b6 { background: #fef08a; color: #854d0e; font-size: 0.7rem; }
.u-style-28d1f7 { font-style: italic; }
.u-style-0beede { font-family: monospace; font-size: 0.75rem; background: #eef2f6; color: #4e5d78; }
.u-style-ff09f2 { font-size: 0.75rem; font-style: italic; }
.u-style-663a19 { padding: 24px; }
.u-style-dc2cb2 { margin-bottom: 24px; }
.u-style-3bd722 { font-family: monospace; }
.u-style-db1172 { font-weight: 600; }
.u-style-230ca1 { margin-bottom: 24px; font-size: 0.9rem; }
.u-style-807c19 { background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; }
.u-style-a4b033 { margin: 0 0 16px 0; font-size: 1rem; color: #1e293b; }
.u-style-a81293 { margin-top: 16px; }
.u-style-57eaae { min-width: 0; flex: 1; }

[x-cloak] { display: none !important; }
.hidden { display: none !important; }
.h-full { height: 100% !important; }
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.text-green-600 { color: #16a34a !important; }
.font-semibold { font-weight: 600 !important; }

.shell:has(.main.chat-screen) {
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
}

.content:has(.main.chat-screen) {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.content:has(.main.chat-screen) .topbar {
    justify-content: space-between;
    gap: 20px;
    height: 70px;
    padding: 0 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.main.chat-screen {
    flex: 1 !important;
    height: calc(100vh - 70px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.main.chat-screen .chat-page {
    height: 100%;
    padding: 18px;
    background: linear-gradient(180deg, #f8fbfc 0%, #eef7f8 100%);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.main.chat-screen .chat-shell {
    height: 100%;
    border-radius: 40px;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(16, 127, 135, 0.08), transparent 28%),
        linear-gradient(180deg, #e7f3f4 0%, #edf7f8 100%);
    border: 1px solid rgba(203, 219, 224, 0.96);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow: hidden;
    box-sizing: border-box;
}

.main.chat-screen .chat-page-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.main.chat-screen .chat-page-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d7efee, #cae7e5);
    color: #107f87;
}

.main.chat-screen .chat-page-title {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #107f87;
}

.main.chat-screen .chat-page-breadcrumbs {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #6e8591;
    font-weight: 600;
}

.main.chat-screen .chat-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
}

.main.chat-screen .messages-panel,
.main.chat-screen .conversation-panel {
    min-height: 0;
    border-radius: 30px;
    background: rgba(255,255,255,0.97);
    border: 1px solid rgba(208, 220, 224, 0.94);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.main.chat-screen .messages-panel {
    display: flex;
    flex-direction: column;
}

.main.chat-screen .messages-head {
    padding: 18px 18px 14px;
}

.main.chat-screen .messages-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.main.chat-screen .messages-title {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    color: #0f172a;
}

.main.chat-screen .messages-compose {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(193, 221, 224, 0.95);
    background: #eef8f8;
    color: #108089;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main.chat-screen .messages-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    border-radius: 16px;
    background: #f3f9fa;
    border: 1px solid rgba(216, 226, 230, 0.94);
    color: #8ca0ab;
}

.main.chat-screen .messages-search input,
.main.chat-screen .messages-inbox-select,
.main.chat-screen .composer-input {
    border: 0;
    outline: none;
    background: transparent;
}

.main.chat-screen .messages-search input {
    width: 100%;
    font-size: 0.95rem;
    color: #334155;
}

.main.chat-screen .messages-inbox-wrap {
    padding: 0 18px 12px;
}

.main.chat-screen .messages-inbox-select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid #d8e7eb;
    background: #fff;
    color: #425b67;
    font-size: 0.84rem;
    font-weight: 600;
}

.main.chat-screen .messages-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 18px 12px;
}

.main.chat-screen .messages-filter {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #dae8eb;
    background: #fff;
    color: #637b86;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
}

.main.chat-screen .messages-filter.active {
    background: #107f87;
    border-color: #107f87;
    color: #fff;
}

.main.chat-screen .messages-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 10px 12px;
}

.main.chat-screen .message-contact {
    display: flex;
    gap: 13px;
    padding: 13px 12px;
    border-radius: 22px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: .18s ease;
    margin-bottom: 10px;
}

.main.chat-screen .message-contact.active,
.main.chat-screen .message-contact:hover {
    background: linear-gradient(180deg, #eef8f8 0%, #f8fcfc 100%);
    border-color: #d1e7ea;
    box-shadow: 0 14px 24px rgba(15, 118, 110, 0.08);
}

.main.chat-screen .avatar-chip {
    position: relative;
    flex: 0 0 auto;
}

.main.chat-screen .avatar-chip .avatar,
.main.chat-screen .conversation-avatar .avatar {
    background: linear-gradient(135deg, #11838b, #0d7680);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.main.chat-screen .avatar-chip .avatar {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    font-size: 0.98rem;
}

.main.chat-screen .avatar-chip .dot,
.main.chat-screen .conversation-avatar .dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #1cc86d;
    border: 2px solid #fff;
}

.main.chat-screen .contact-body {
    min-width: 0;
    flex: 1;
}

.main.chat-screen .contact-topline,
.main.chat-screen .contact-subline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.main.chat-screen .contact-name {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main.chat-screen .contact-preview {
    font-size: 0.82rem;
    color: #657987;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main.chat-screen .contact-preview-muted {
    color: #8aa0a9;
    font-style: italic;
}

.main.chat-screen .contact-time {
    font-size: 0.73rem;
    color: #8ea1aa;
    font-weight: 700;
    white-space: nowrap;
}

.main.chat-screen .contact-unread {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #108089;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main.chat-screen .session-chip {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef6f7;
    color: #6b7f88;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.main.chat-screen .session-chip-muted {
    background: #f2f7f8;
    color: #6b8790;
}

.main.chat-screen .conversation-panel {
    display: flex;
    flex-direction: column;
}

.main.chat-screen .conversation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid #e4ecef;
    background: rgba(255,255,255,0.98);
}

.main.chat-screen .conversation-user {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.main.chat-screen .conversation-avatar {
    position: relative;
    flex: 0 0 auto;
}

.main.chat-screen .conversation-avatar .avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 0.86rem;
}

.main.chat-screen .conversation-name {
    font-size: 1.12rem;
    font-weight: 800;
    color: #0f172a;
}

.main.chat-screen .conversation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6c8490;
}

.main.chat-screen .conversation-status strong {
    color: #18b96a;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.main.chat-screen .conversation-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main.chat-screen .conversation-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: #6b808a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main.chat-screen .conversation-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 26px 18px;
    background:
        linear-gradient(30deg, rgba(219, 230, 235, 0.4) 12%, transparent 12.5%, transparent 87%, rgba(219, 230, 235, 0.4) 87.5%, rgba(219, 230, 235, 0.4)),
        linear-gradient(150deg, rgba(219, 230, 235, 0.4) 12%, transparent 12.5%, transparent 87%, rgba(219, 230, 235, 0.4) 87.5%, rgba(219, 230, 235, 0.4)),
        linear-gradient(90deg, rgba(219, 230, 235, 0.34) 2%, transparent 2.5%, transparent 97%, rgba(219, 230, 235, 0.34) 97.5%, rgba(219, 230, 235, 0.34));
    background-size: 34px 60px;
    background-position: 0 0, 0 0, 17px 30px;
    background-color: #fff;
}

.main.chat-screen .date-pill {
    width: fit-content;
    margin: 0 auto 22px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f6f9fb;
    border: 1px solid #dce7ec;
    color: #738694;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.main.chat-screen .bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.main.chat-screen .bubble-row.sent {
    justify-content: flex-end;
}

.main.chat-screen .bubble-row.sent .bubble-meta {
    align-items: flex-end;
}

.main.chat-screen .bubble-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: min(68%, 780px);
}

.main.chat-screen .bubble {
    padding: 16px 20px;
    border-radius: 22px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.main.chat-screen .bubble-row.received .bubble {
    background: linear-gradient(180deg, #f7fcfc 0%, #eff8f9 100%);
    color: #28404b;
    border: 1px solid #dae9ec;
}

.main.chat-screen .bubble-row.sent .bubble {
    background: linear-gradient(135deg, #12838b 0%, #0f757d 100%);
    color: #fff;
}

.main.chat-screen .bubble-time {
    margin-top: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #8ea2ac;
}

.main.chat-screen .audio-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main.chat-screen .audio-bubble audio {
    height: 36px;
    min-width: 180px;
    max-width: 240px;
}

.main.chat-screen .composer-shell {
    padding: 18px;
    border-top: 1px solid #e4ecef;
    background: rgba(255,255,255,0.98);
}

.main.chat-screen .composer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 14px;
    border-radius: 20px;
    background: #f4fafb;
    border: 1px solid #dce9ed;
}

.main.chat-screen .composer-left,
.main.chat-screen .composer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main.chat-screen .composer-btn {
    border: 0;
    background: transparent;
    color: #5f7781;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main.chat-screen .composer-input {
    flex: 1;
    font-size: 0.95rem;
    color: #334155;
}

.main.chat-screen .composer-send {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #11838b, #0d747d);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 24px rgba(17, 131, 139, 0.24);
}

.main.chat-screen .voice-btn.recording {
    color: #dc2626;
}

.main.chat-screen .recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    color: #667781;
}

.main.chat-screen .rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #dc2626;
    animation: blink 1s infinite;
}

.main.chat-screen .rec-time {
    font-variant-numeric: tabular-nums;
    color: #111b21;
    font-size: 0.95rem;
}

.main.chat-screen .empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: #6f8591;
}

.main.chat-screen .empty-state h3 {
    font-size: 1.18rem;
    font-weight: 800;
    color: #0f172a;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .2; }
}

@media (max-width: 1180px) {
    .main.chat-screen .chat-grid {
        grid-template-columns: 1fr;
    }

    .main.chat-screen .messages-panel {
        min-height: 360px;
    }
}

@media (max-width: 768px) {
    .main.chat-screen .chat-page {
        padding: 10px;
    }

    .main.chat-screen .chat-shell {
        padding: 16px;
        border-radius: 24px;
    }

    .main.chat-screen .chat-page-title {
        font-size: 1.6rem;
    }

    .main.chat-screen .conversation-body {
        padding: 16px;
    }

    .main.chat-screen .bubble-meta {
        max-width: 88%;
    }
}
