:root {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    --bg: #11051e;
    --side: #1b0c2a;
    --panel: #210f32;
    --panel2: #29143b;
    --text: #fcf8ff;
    --muted: #aa98bd;
    --line: #392449;
    --input: #2c1940;
    --accent: #b600ed;
    --pink: #ed28c6;
    --orange: #ff795c;
    --green: #38d6a5;
    --shadow: 0 16px 42px #07000e2e;
    color-scheme: dark
}

body.light {
    --bg: #f8f6fc;
    --side: #fff;
    --panel: #fff;
    --panel2: #f5f0fa;
    --text: #281539;
    --muted: #81738d;
    --line: #e9e0ee;
    --input: #f6f2fa;
    --shadow: 0 12px 30px #2510390c;
    color-scheme: light
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 14px
}

button,
input,
select,
textarea {
    font: inherit
}

button {
    cursor: pointer
}

button:disabled {
    opacity: .5;
    cursor: not-allowed
}

.hidden {
    display: none !important
}

.login-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: #fff;
    color: #1a0d2b
}

.login-art {
    background: radial-gradient(circle at 80% 30%, #55107a 0, transparent 40%), linear-gradient(145deg, #160526, #26043e 65%, #4e0863);
    padding: 50px clamp(32px, 6vw, 110px);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden
}

.art-mark,
.brand,
.mobile-brand {
    font-weight: 900;
    font-size: 32px;
    letter-spacing: -2px
}

.art-mark span,
.brand span,
.mobile-brand span {
    color: #f339a5
}

.art-mark small,
.brand small {
    display: block;
    letter-spacing: 2px;
    font-size: 10px;
    font-weight: 650;
    color: #ab93c0
}

.eyebrow {
    color: #f7a4e5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px
}

.login-art h1 {
    font-size: clamp(36px, 4.5vw, 66px);
    line-height: 1.1;
    max-width: 600px;
    letter-spacing: -2.5px
}

.login-art em {
    font-style: normal;
    background: linear-gradient(100deg, #cb00ff, #ff7d65);
    background-clip: text;
    color: transparent
}

.login-art p {
    color: #cdbdd7;
    line-height: 1.8;
    max-width: 480px
}

.art-pill {
    display: inline-block;
    margin-top: 35px;
    border: 1px solid #7a448c;
    border-radius: 100px;
    padding: 14px 18px;
    color: #f4dbff
}

.art-footer {
    color: #9f8bb1;
    font-size: 12px
}

.login-right {
    display: grid;
    place-items: center;
    padding: 35px
}

.login-card {
    width: min(420px, 100%)
}

.login-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background: linear-gradient(130deg, #a000f5, #ff6b79);
    color: white;
    border-radius: 17px;
    font-size: 28px
}

.login-card h2 {
    font-size: 31px;
    margin: 27px 0 6px;
    letter-spacing: -1px
}

.login-card p {
    color: #8c8095;
    margin-bottom: 32px
}

.login-card label {
    display: block;
    margin: 18px 0;
    font-weight: 650;
    font-size: 13px
}

.login-card input {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: #f6f3fa;
    color: #2a1539;
    border: 1px solid #eae2f0;
    border-radius: 11px;
    padding: 15px
}

.primary {
    border: 0;
    color: #fff;
    background: linear-gradient(105deg, #9400ff, #ea1ec4, #ff8060);
    padding: 13px 20px;
    border-radius: 11px;
    font-weight: 750
}

.primary:hover {
    filter: brightness(1.1)
}

.full {
    width: 100%;
    margin-top: 16px
}

.login-hint {
    font-size: 12px;
    line-height: 1.9;
    color: #82758d;
    background: #f7f3fb;
    padding: 14px;
    border-radius: 12px;
    margin-top: 25px
}

.error {
    color: #dd3365;
    margin-top: 12px
}

.mobile-brand {
    display: none
}

.shell {
    --sidebar-width: min(290px, calc(100vw - 24px));
    --sidebar-collapsed-width: 68px;
    min-height: 100vh
}

.sidebar {
    width: var(--sidebar-collapsed-width);
    background: var(--side);
    border: 1px solid var(--line);
    border-radius: 0 0 18px 0;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 22px 10px 18px;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    box-shadow: var(--shadow);
    transition: width .24s ease
}

.sidebar::-webkit-scrollbar {
    display: none
}

.sidebar.expanded {
    width: var(--sidebar-width)
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: rgb(7 3 12 / 62%);
    -webkit-backdrop-filter: blur(4px) saturate(.75);
    backdrop-filter: blur(4px) saturate(.75);
    opacity: 0;
    visibility: hidden;
    transition: opacity .24s ease, visibility .24s
}

.menu-backdrop.expanded {
    opacity: 1;
    visibility: visible
}

.sidebar-header {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    margin-bottom: 20px
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -1px;
    white-space: nowrap
}

.brand img {
    display: block;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    object-fit: contain
}

.sidebar:not(.expanded) .brand {
    width: 100%;
    justify-content: center
}

.brand-name,
.brand-name span,
.brand-name small {
    display: none
}

.sidebar.expanded .brand-name {
    display: block;
    font-size: 21px
}

.sidebar.expanded .brand img {
    width: 36px;
    height: 36px;
    flex-basis: 36px
}

.sidebar.expanded .brand-name span {
    display: inline;
    color: #f339a5
}

.sidebar.expanded .brand-name small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 1.4px
}

.menu-toggle.icon-btn {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-collapsed-width) - 12px);
    z-index: 1002;
    width: 24px;
    height: 24px;
    display: none;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--panel);
    border-color: var(--line);
    box-shadow: var(--shadow);
    transition: left .24s ease
}

.menu-toggle.icon-btn[aria-expanded="true"] {
    left: calc(var(--sidebar-width) - 12px)
}

.menu-toggle.icon-btn svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round
}

.menu-toggle:hover {
    border-color: var(--accent);
    color: var(--text)
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 3px
}

nav {
    display: grid;
    gap: 4px;
    width: 100%
}

nav button,
.nav-foot {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 9px;
    border-radius: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    min-height: 42px;
    text-align: left;
    white-space: nowrap
}

nav button svg,
.nav-foot svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

nav button span,
.nav-foot span {
    display: none
}

.sidebar.expanded nav button,
.sidebar.expanded .nav-foot {
    justify-content: flex-start
}

.sidebar.expanded nav button,
.sidebar.expanded .nav-foot {
    padding: 10px 12px
}

.sidebar.expanded nav button span,
.sidebar.expanded .nav-foot span {
    display: inline
}

nav button:hover,
nav button.selected,
.nav-foot:hover {
    background: linear-gradient(100deg, #7800b8, #9f00c5);
    color: white
}

.sidebar-bottom {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 9px
}

.sidebar-user {
    display: grid;
    justify-items: center;
    min-width: 0;
    gap: 8px;
    padding: 8px 0 12px
}

.sidebar.expanded .sidebar-user {
    justify-items: center;
    padding: 10px;
    margin-bottom: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0
}

.sidebar.expanded .sidebar-user-card {
    justify-content: center
}

.sidebar.expanded .user-info {
    text-align: center
}

.sidebar-theme-switch {
    display: none
}

.sidebar.expanded .sidebar-theme-switch {
    display: inline-flex;
    justify-self: center
}

.sidebar:not(.expanded) .sidebar-theme-switch {
    display: none
}

.user-info {
    display: none;
    min-width: 0;
    color: var(--text)
}

.sidebar.expanded .user-info {
    display: block
}

.user-info strong,
.user-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.user-info strong {
    font-size: 12px
}

.user-info small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px
}

.sidebar-actions {
    display: none
}

.sidebar.expanded .sidebar-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line)
}

.sidebar.expanded .sidebar-actions .nav-foot {
    justify-content: center;
    padding-right: 10px;
    padding-left: 10px
}

.sidebar-actions .nav-foot {
    width: auto;
    min-width: 0;
    flex: 1;
    justify-content: center;
    padding: 10px
}

.workspace {
    margin-left: var(--sidebar-collapsed-width);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.icon-btn {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    width: 37px;
    height: 37px;
    border-radius: 10px
}

.avatar {
    background: linear-gradient(140deg, #8500e7, #ef23c1);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 750;
    flex: 0 0 38px
}

.profile-layout {
    display: grid;
    width: min(100%, 860px);
    gap: 16px;
    margin-inline: auto
}

.profile-identity-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 18px
}

.profile-identity {
    display: grid;
    min-width: 0;
    gap: 5px
}

.profile-identity strong {
    overflow: hidden;
    color: var(--text);
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap
}

.profile-identity small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap
}

.profile-edit-card h2 {
    margin: 0 0 20px;
    font-size: 16px
}

.profile-edit-card form {
    max-width: 560px
}

main {
    padding: 30px 32px 60px;
    max-width: 1800px;
    margin: auto
}

#main {
    width: 100%;
    flex: 1
}

.workspace.chat-page main {
    margin: 0 auto;
    padding-bottom: 12px
}

.workspace.chat-page #main {
    flex: 0 0 auto
}

.workspace-footer {
    padding: 16px 24px 20px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 11px;
    text-align: center
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 26px
}

.page-heading h1 {
    font-size: 27px;
    letter-spacing: -.7px;
    margin: 0 0 8px
}

.page-heading p {
    color: var(--muted);
    margin: 0;
    font-size: 13px
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow)
}

.card h3 {
    font-size: 14px;
    margin: 0 0 18px
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 17px
}

.kpi {
    padding: 22px;
    position: relative;
    min-height: 134px
}

.kpi-icon {
    font-size: 22px;
    color: #ed2ce8
}

.kpi strong {
    display: block;
    font-size: 29px;
    letter-spacing: -1px;
    margin: 12px 0 3px
}

.kpi small {
    color: var(--muted)
}

.kpi em {
    position: absolute;
    right: 20px;
    top: 22px;
    font-size: 10px;
    color: var(--green);
    font-style: normal
}

.two-col {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    margin-bottom: 16px
}

.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px
}

.muted {
    color: var(--muted)
}

.chart {
    display: flex;
    align-items: end;
    gap: 14px;
    height: 220px;
    border-bottom: 1px solid var(--line);
    padding: 15px 4px 0
}

.barcol {
    flex: 1;
    text-align: center;
    min-width: 0
}

.bar {
    border-radius: 7px 7px 0 0;
    background: linear-gradient(0deg, #8700d2, #e13cf2);
    min-height: 5px
}

.barcol small {
    display: block;
    color: var(--muted);
    padding-top: 8px;
    font-size: 10px
}

.donut {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(#aa00ec 0 45%, #e82dd0 45% 73%, #fb5d9b 73% 90%, #6632c2 90%);
    margin: 20px auto;
    display: grid;
    place-items: center
}

.donut:after {
    content: 'Canais';
    background: var(--panel);
    width: 115px;
    height: 115px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700
}

.legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 11px;
    justify-content: center
}

.legend span:before {
    content: '● ';
    color: var(--pink)
}

.activity {
    display: grid;
    gap: 12px
}

.activity div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 11px;
    font-size: 12px
}

.activity span {
    color: var(--muted)
}

.gradient-card {
    background: linear-gradient(115deg, #9c00f1, #e522c4 60%, #ff766d);
    border: 0;
    color: white
}

.gradient-card h3 {
    font-size: 23px;
    margin-top: 25px
}

.gradient-card p {
    line-height: 1.8
}

.outline,
.small-btn {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    padding: 11px 14px
}

.small-btn {
    padding: 7px 11px;
    font-size: 12px
}

.actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 650;
    font-size: 12px
}

.field input,
.field textarea,
.field select,
.search {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--line);
    background: var(--input);
    color: var(--text);
    border-radius: 9px;
    outline: none
}

.field textarea {
    min-height: 130px;
    resize: vertical
}

.field input:focus,
.field textarea:focus,
.search:focus {
    border-color: #bd00ed
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 5px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel2);
    color: var(--muted)
}

.theme-switch svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.theme-switch[aria-checked="true"] svg:first-child,
.theme-switch[aria-checked="false"] svg:last-child {
    color: var(--text)
}

.theme-switch-track {
    width: 34px;
    height: 20px;
    padding: 2px;
    border-radius: 999px;
    background: var(--line)
}

.theme-switch-track span {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform .18s ease
}

.theme-switch[aria-checked="false"] .theme-switch-track span {
    transform: translateX(14px)
}

.theme-switch:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 3px
}

.table-wrap {
    overflow: auto
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 12px
}

.data-table th {
    color: var(--muted);
    font-weight: 650
}

.chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 50px;
    font-size: 11px;
    background: #8b00dc24;
    color: #cf65ff
}

.chip.good {
    background: #25c89920;
    color: var(--green)
}

.chip.warn {
    background: #f79a3b20;
    color: #f2a358
}

.chat-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--panel);
    height: min(720px, calc(100vh - 190px));
    min-height: 520px
}

.chat-list {
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0
}

.chat-list-header {
    padding: 18px;
    border-bottom: 1px solid var(--line)
}

.chat-list-header h3 {
    margin: 0 0 14px
}

.chat-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px
}

.chat-filter {
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel2);
    color: var(--muted);
    font-size: 12px
}

.chat-filter.active {
    border-color: var(--green);
    background: color-mix(in srgb, var(--green) 14%, var(--panel));
    color: var(--text);
    font-weight: 700
}

.chat-items {
    overflow: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #a026c9 transparent
}

.chat-items::-webkit-scrollbar {
    width: 6px
}

.chat-items::-webkit-scrollbar-track {
    background: transparent
}

.chat-items::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(135deg, #7e00bf, #f62fa7)
}

.chat-items::-webkit-scrollbar-button,
.chat-items::-webkit-scrollbar-button:single-button,
.chat-items::-webkit-scrollbar-button:vertical:decrement,
.chat-items::-webkit-scrollbar-button:vertical:increment,
.chat-items::-webkit-scrollbar-button:vertical:start:decrement,
.chat-items::-webkit-scrollbar-button:vertical:end:increment {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important
}

.chat-item {
    width: 100%;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--text)
}

.chat-item:hover,
.chat-item.active {
    background: var(--panel2)
}

.contact-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #7e00bf, #f62fa7);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800
}

.chat-item-body {
    min-width: 0;
    flex: 1
}

.chat-item-body strong,
.chat-item-body small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.chat-item-body small {
    color: var(--muted);
    margin-top: 3px
}

.chat-item-meta {
    display: flex !important;
    align-items: center;
    gap: 8px
}

.chat-mode {
    display: inline-flex;
    align-items: center;
    gap: 5px
}

.human-mode-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #38d6a5;
    box-shadow: 0 0 0 2px rgb(56 214 165 / 16%)
}

.chat-mode.ai {
    color: var(--muted)
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    position: relative
}

.chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.chat-header h3 {
    margin: 0;
    font-size: 14px
}

.chat-header small {
    color: var(--muted)
}

.chat-header .chat-mode {
    white-space: nowrap
}

.chat-back {
    display: none
}

.control-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel2);
    color: var(--text);
    font-size: 12px;
    white-space: nowrap
}

.control-toggle-track {
    width: 30px;
    height: 17px;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    background: var(--muted);
    transition: background .18s ease
}

.control-toggle-track span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: white;
    transition: transform .18s ease
}

.control-toggle.active {
    border-color: rgb(56 214 165 / 45%)
}

.control-toggle.active .control-toggle-track {
    background: var(--green)
}

.control-toggle.active .control-toggle-track span {
    transform: translateX(13px)
}

.control-toggle:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 2px
}

.chat-messages {
    flex: 1;
    overflow: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: radial-gradient(circle at 70% 20%, #7e00c00a, transparent 50%)
}

.chat-day-divider {
    display: flex;
    justify-content: center;
    padding: 8px 0
}

.chat-day-divider span {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 11px
}

.bubble {
    width: fit-content;
    max-width: min(76%, 520px);
    flex: 0 0 auto;
    align-self: flex-start;
    display: grid;
    gap: 4px;
    border-radius: 13px;
    padding: 9px 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    background: var(--panel2)
}

.bubble.out {
    align-self: flex-end;
    background: linear-gradient(115deg, #7900be, #aa00bc);
    color: white
}

.bubble-text {
    white-space: pre-wrap
}

.bubble small {
    display: block;
    text-align: right;
    opacity: .65;
    font-size: 10px
}

.chat-compose {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--line)
}

.chat-compose input {
    flex: 1;
    min-width: 0
}

.chat-compose input:disabled {
    opacity: .65;
    cursor: not-allowed
}

.chat-ai-notice {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    transform: translate(-50%, -50%);
    max-width: min(360px, calc(100% - 32px));
    padding: 14px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--muted);
    box-shadow: var(--shadow);
    text-align: center;
    font-weight: 650;
    pointer-events: none
}

.chat-local-notice {
    padding: 8px 15px;
    border-top: 1px solid var(--line);
    background: var(--panel2);
    color: var(--muted);
    font-size: 11px;
    text-align: center
}

.handoff-alerts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1003;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    overflow: clip;
    pointer-events: none
}

.handoff-alert {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 14px;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px 10px 58px;
    border: 1px solid rgb(56 214 165 / 45%);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
    pointer-events: auto;
    transform: translateX(calc(100% - 48px));
    transition: transform .22s ease;
    touch-action: pan-y
}

.handoff-alert.is-open {
    transform: translateX(0)
}

.handoff-alert.is-dragging {
    transition: none;
    transform: translateX(calc(100% - 48px + var(--handoff-drag-offset, 0px)))
}

.handoff-alert.is-open.is-dragging {
    transform: translateX(var(--handoff-drag-offset, 0px))
}

.handoff-alert-copy {
    display: none;
    min-width: 0;
    gap: 5px
}

.handoff-alert.is-open .handoff-alert-copy {
    display: grid
}

.handoff-alert-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-size: 13px
}

.handoff-alert-details {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    min-width: 0
}

.handoff-alert-details > strong {
    overflow: hidden;
    font-size: 14px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap
}

.handoff-alert-icon {
    display: none
}

.handoff-alert-details small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap
}

.handoff-alert-toggle {
    position: absolute;
    inset: 0 auto 0 0;
    display: grid;
    width: 48px;
    place-items: center;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 12px 0 0 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    touch-action: pan-y
}

.handoff-alert-toggle .handoff-alert-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: #10251f;
    font-weight: 900
}

.handoff-alert-open {
    display: none;
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    white-space: nowrap;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel2);
    color: var(--text);
    cursor: pointer
}

.handoff-alert.is-open .handoff-alert-open {
    display: block
}

.empty {
    padding: 50px 20px;
    text-align: center;
    color: var(--muted)
}

.toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #42165e;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 99;
    max-width: 380px
}

@media(max-width:760px) {

    .handoff-alerts {
        top: auto;
        right: 0;
        bottom: max(86px, env(safe-area-inset-bottom));
        width: min(310px, 100vw)
    }

    .handoff-alert {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        padding: 10px 10px 10px 58px;
        border-radius: 14px 0 0 14px;
    }

    .handoff-alert-toggle {
        border-radius: 14px 0 0 14px;
        cursor: grab;
    }

    .handoff-alert-toggle:active {
        cursor: grabbing
    }

    .handoff-alert-open {
        grid-column: 1;
        grid-row: auto;
        justify-self: start
    }
}

.stack {
    display: grid;
    gap: 16px
}

.notice {
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 12px
}

.preview {
    background: var(--panel2);
    border-radius: 12px;
    padding: 20px;
    line-height: 1.8;
    white-space: pre-wrap;
    min-height: 140px
}

.footer-note {
    color: var(--muted);
    font-size: 11px;
    margin-top: 25px
}

.switchline {
    display: flex;
    align-items: center;
    gap: 10px
}

.switchline input {
    accent-color: #b600ed
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center
}

.toolbar .search {
    max-width: 320px
}

.table-empty {
    padding: 22px;
    color: var(--muted)
}

.indicator-heading {
    margin-bottom: 20px
}

.indicator-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #ff7b82;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px
}

.data-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    white-space: nowrap
}

.data-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e7aa55;
    box-shadow: 0 0 0 4px rgb(231 170 85 / 12%)
}

.data-status strong,
.data-status small {
    display: block
}

.data-status strong {
    font-size: 11px
}

.data-status small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px
}

.indicator-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px
}

.indicator-tab {
    flex: 0 0 auto;
    padding: 12px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700
}

.indicator-tab.active {
    border-bottom-color: #ff5c68;
    color: var(--text)
}

.indicator-tab:focus-visible,
.period-filter:focus-visible {
    outline: 2px solid #ff7b82;
    outline-offset: -2px
}

.period-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px
}

.period-toolbar h2 {
    margin: 0 0 4px;
    font-size: 16px
}

.period-toolbar p,
.section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 11px
}

.period-filters {
    display: flex;
    gap: 5px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel)
}

.period-filter {
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700
}

.period-filter.active {
    background: #e94d5e;
    color: #fff
}

.indicator-kpis {
    margin-bottom: 15px
}

.indicator-kpi {
    min-width: 0;
    min-height: 145px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-content: start;
    justify-items: center;
    row-gap: 5px;
    text-align: center;
    padding: 18px
}

.indicator-kpi-heading {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 36px
}

.indicator-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 92 104 / 20%);
    border-radius: 11px;
    background: rgb(255 92 104 / 10%);
    color: #ff737b;
    font-size: 13px;
    font-weight: 800;
    margin: 0
}

.indicator-kpi-heading > small {
    min-width: 0;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-align: center;
    font-size: 13px;
    font-weight: 750
}

.indicator-kpi > strong {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    margin: 0;
    overflow: hidden;
    font-size: clamp(18px, 2vw, 27px);
    letter-spacing: -.8px;
    white-space: nowrap
}

.indicator-kpi strong em {
    position: static;
    margin-left: 3px;
    color: var(--muted);
    font-size: .55em;
    font-style: normal;
    letter-spacing: 0
}

.kpi-detail {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4
}

.kpi-detail.positive {
    color: var(--green)
}

.indicator-chart-grid,
.indicator-lower-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 15px
}

.indicator-chart-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr)
}

.indicator-lower-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr)
}

.indicator-card {
    min-width: 0;
    padding: 18px
}

.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px
}

.section-title h3 {
    margin: 0 0 5px;
    font-size: 13px
}

.chart-period {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    font-size: 10px
}

.revenue-chart {
    width: 100%;
    height: auto;
    overflow: visible
}

.revenue-grid-line {
    stroke: var(--line);
    stroke-dasharray: 4 5;
    stroke-width: 1
}

.revenue-axis-label {
    fill: var(--muted);
    font-family: inherit;
    font-size: 10px
}

.revenue-area {
    fill: url(#revenueFill)
}

.revenue-line {
    fill: none;
    stroke: #ff5c68;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3
}

.revenue-marker {
    fill: var(--panel);
    stroke: #ff6972;
    stroke-width: 2.5
}

.payment-bars {
    display: grid;
    gap: 16px;
    padding: 8px 0
}

.payment-row {
    display: grid;
    gap: 7px
}

.payment-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px
}

.payment-label span {
    color: var(--muted)
}

.payment-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--panel2)
}

.payment-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--payment-color)
}

.payment-footnote {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 10px
}

.indicator-table {
    min-width: 540px
}

.indicator-table th,
.indicator-table td {
    padding: 11px 9px;
    font-size: 10px
}

.indicator-table td:first-child {
    font-weight: 650
}

.product-rank {
    display: inline-block;
    min-width: 26px;
    color: #ff737b;
    font-size: 9px;
    font-weight: 800
}

.customer-ranking {
    display: grid;
    gap: 13px
}

.customer-row {
    display: grid;
    grid-template-columns: 16px 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px
}

.customer-rank {
    color: var(--muted);
    font-size: 10px;
    text-align: center
}

.customer-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 92 104 / 22%);
    border-radius: 50%;
    background: rgb(255 92 104 / 10%);
    color: #ff8a90;
    font-size: 10px;
    font-weight: 800
}

.customer-info {
    min-width: 0;
    display: grid;
    gap: 3px
}

.customer-info strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap
}

.customer-info small {
    color: var(--muted);
    font-size: 9px
}

.customer-spend-track {
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--panel2)
}

.customer-spend-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff5c68, #f29b63)
}

.customer-total {
    font-size: 10px;
    white-space: nowrap
}

.indicator-disclaimer {
    margin: 2px 0 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5
}

@media(max-width:1100px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .three-col {
        grid-template-columns: 1fr 1fr
    }

    .chat-layout {
        grid-template-columns: 265px 1fr
    }

    .indicator-chart-grid {
        grid-template-columns: minmax(0, 1.3fr) minmax(230px, 1fr)
    }

    .indicator-lower-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:760px) {
    .login-screen {
        grid-template-columns: 1fr
    }

    .login-art {
        display: none
    }

    .login-right {
        min-height: 100vh
    }

    .mobile-brand {
        display: block;
        margin-bottom: 35px
    }

    main {
        padding: 23px 15px 45px
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .indicator-heading {
        gap: 14px
    }

    .data-status {
        align-self: stretch
    }

    .period-toolbar {
        align-items: flex-start;
        flex-direction: column
    }

    .period-filters {
        width: 100%;
        justify-content: space-between
    }

    .period-filter {
        flex: 1;
        padding: 8px 6px
    }

    .two-col,
    .three-col {
        grid-template-columns: 1fr
    }

    .indicator-chart-grid {
        grid-template-columns: 1fr
    }

    .indicator-kpi {
        min-height: 126px;
        padding: 14px
    }

    .indicator-kpi > strong {
        font-size: 20px
    }

    .chat-layout {
        grid-template-columns: 1fr;
        height: calc(100vh - 185px)
    }

    .chat-list {
        display: none
    }

    .chat-layout.show-list .chat-list {
        display: flex
    }

    .chat-layout.show-list .chat-panel {
        display: none
    }

    .chat-header {
        flex-wrap: wrap;
        align-items: flex-start
    }

    .chat-back {
        display: inline-flex;
        align-items: center;
        gap: 6px
    }

    .chat-header .actions {
        width: 100%
    }

    .chat-header .actions > * {
        flex: 1;
        justify-content: center
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .kpi {
        min-height: 118px;
        padding: 15px
    }

    .kpi strong {
        font-size: 24px
    }
}

@media(max-width:430px) {
    .kpi-grid {
        gap: 8px
    }

    .kpi {
        padding: 12px
    }

    .kpi strong {
        font-size: 22px
    }

    .kpi small {
        font-size: 10px
    }

    .indicator-kpi {
        padding: 11px
    }

    .indicator-icon {
        width: 29px;
        height: 29px;
        border-radius: 9px;
        font-size: 11px
    }

    .indicator-kpi-heading > small {
        font-size: 11px
    }

    .indicator-kpi > strong {
        font-size: 17px
    }

    .kpi-detail {
        font-size: 9px
    }

    .indicator-card {
        padding: 14px
    }

    .revenue-card .revenue-axis-label {
        font-size: 9px
    }

    .customer-row {
        grid-template-columns: 14px 32px minmax(0, 1fr) auto;
        gap: 7px
    }

    .customer-avatar {
        width: 30px;
        height: 30px
    }

}

body.menu-open {
    overflow: hidden
}

@media(prefers-reduced-motion:reduce) {
    .sidebar,
    .menu-backdrop {
        transition: none
    }
}