:root {
    --bg: #070b12;
    --surface: #0d1421;
    --surface-2: #111b2c;
    --panel: #ffffff;
    --soft: #f4f7fb;
    --ink: #121827;
    --muted: #6b7280;
    --line: #dce3ee;
    --line-dark: #223049;
    --brand: #00b386;
    --brand-2: #19d3a2;
    --blue: #3b82f6;
    --danger: #e5484d;
    --warning: #f59e0b;
    --shadow: 0 20px 60px rgba(7, 11, 18, 0.16);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--design-surface, var(--soft));
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    flex: 0 0 auto;
    min-width: 0;
}

.brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand span {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--brand);
    color: #03100c;
    font-weight: 900;
}

.brand img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
}

.brand img.brand-logo-default {
    box-sizing: border-box;
    padding: 5px;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 9px;
    background: #f8fafc;
    box-shadow: 0 6px 16px rgba(2, 6, 23, .18);
}

.brand.center {
    justify-content: center;
}

.btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 11px 18px;
    background: var(--brand);
    color: #03100c;
    font-weight: 800;
}

.btn.small {
    min-height: 36px;
    padding: 8px 13px;
}

.btn.secondary {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    color: #0f3f74;
}

.btn.secondary:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #0b315f;
}

.side-nav a.active,
.settings-index a.active,
.tab-switcher label:hover,
.tab-switcher input:checked + label,
.mini.approve,
.status.approved {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #03100c !important;
}

.side-nav a:hover,
.settings-index a:hover,
.table-action,
.permission-editor summary,
.up,
.positive,
.eyebrow {
    color: var(--brand) !important;
}

.check-row input,
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--brand);
}

.brand span,
.balance-pill,
.price-line,
.spec-chart-toolbar button.active,
.order-type-row button.active {
    background: var(--brand) !important;
    color: #03100c !important;
}

.market-watchlist button:hover,
.market-watchlist button.active,
.spec-side-toggle label:has(input:checked),
.market-chip.active,
.theme-card:has(input:checked) {
    border-color: var(--brand) !important;
}

.landing-body {
    background:
        radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--brand) 24%, transparent), transparent 30%),
        linear-gradient(135deg, var(--design-dark) 0%, #0f1b2d 56%, #071018 100%);
}

.ghost-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.landing-body {
    min-height: 100vh;
    color: white;
    background:
        radial-gradient(circle at 20% 10%, rgba(0, 179, 134, 0.22), transparent 30%),
        linear-gradient(135deg, #070b12 0%, #0f1b2d 56%, #071018 100%);
}

.landing-nav {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-nav nav,
.hero-actions,
.inline-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.inline-form input {
    min-height: 34px;
}

.hero {
    width: min(1180px, calc(100% - 32px));
    margin: 58px auto 34px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 34px;
    align-items: center;
}

.hero h1 {
    font-size: 72px;
    line-height: 0.95;
    margin: 10px 0 20px;
    letter-spacing: 0;
}

.lead {
    max-width: 610px;
    color: #c7d2e5;
    font-size: 20px;
    line-height: 1.65;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand-2);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
}

.hero-terminal {
    min-height: 430px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(13, 20, 33, 0.82);
    box-shadow: var(--shadow);
}

.ticker-row,
.market-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--line-dark);
}

.ticker-row em,
.market-item em {
    font-style: normal;
    font-weight: 800;
}

.chart-lines {
    height: 190px;
    margin-top: 34px;
    background:
        linear-gradient(160deg, transparent 45%, rgba(0, 179, 134, 0.85) 46%, transparent 48%),
        linear-gradient(20deg, transparent 48%, rgba(59, 130, 246, 0.7) 49%, transparent 51%),
        repeating-linear-gradient(to right, transparent 0 54px, rgba(255, 255, 255, 0.05) 55px 56px),
        repeating-linear-gradient(to bottom, transparent 0 38px, rgba(255, 255, 255, 0.05) 39px 40px);
    border: 1px solid var(--line-dark);
    border-radius: 8px;
}

.chart-lines.large {
    height: 260px;
}

.trading-overview {
    overflow: hidden;
}

.market-strip,
.market-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 14px;
}

.market-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-bottom: 18px;
}

.market-card {
    position: relative;
    min-height: 150px;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.market-card.bull {
    background: linear-gradient(180deg, #ffffff 0%, #ecfff8 100%);
}

.market-card.bear {
    background: linear-gradient(180deg, #ffffff 0%, #fff0f1 100%);
}

.market-card strong,
.market-card span,
.market-card em {
    position: relative;
    z-index: 1;
}

.market-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.market-card em {
    display: inline-flex;
    margin-top: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(0, 179, 134, 0.12);
    color: #047857;
    font-style: normal;
    font-weight: 900;
}

.market-card.bear em {
    background: rgba(229, 72, 77, 0.12);
    color: var(--danger);
}

.market-card.large-card {
    min-height: 210px;
}

.market-card-head,
.market-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.market-card-foot {
    margin-top: 12px;
}

.coin-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #111827;
    color: var(--brand-2);
    font-weight: 900;
}

.mini-chart {
    width: 100%;
    height: 72px;
    margin-top: 8px;
    opacity: 0.95;
}

.trading-chart-panel {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        repeating-linear-gradient(to right, transparent 0 74px, rgba(17, 24, 39, 0.06) 75px 76px),
        repeating-linear-gradient(to bottom, transparent 0 48px, rgba(17, 24, 39, 0.06) 49px 50px),
        #ffffff;
    overflow: hidden;
}

.chart-toolbar {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
}

.chart-toolbar span {
    padding: 6px 8px;
    border-radius: 7px;
    background: #f3f6fb;
    color: #111827;
    font-size: 13px;
}

.candlestick-board {
    height: 320px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 28px 24px;
}

.candle {
    position: relative;
    width: 9px;
    min-height: 16px;
    border-radius: 2px;
}

.candle::before {
    content: "";
    position: absolute;
    left: 4px;
    top: -12px;
    width: 1px;
    height: calc(100% + 24px);
    background: currentColor;
}

.up-candle {
    color: #00a884;
    background: #00c49a;
}

.down-candle {
    color: #e5484d;
    background: #ff4d57;
}

.market-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.55fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: center;
}

.markets-terminal {
    padding: 0;
    overflow: hidden;
}

.tradingview-widget-container {
    width: 100%;
}

.tv-market-overview {
    height: calc(100vh - 170px);
    min-height: 780px;
}

.tv-market-overview .tradingview-widget-container__widget,
.tv-advanced-chart .tradingview-widget-container__widget,
.tv-mini-chart .tradingview-widget-container__widget,
.tv-ticker .tradingview-widget-container__widget {
    width: 100%;
    height: 100%;
}

.tv-advanced-chart iframe,
.tv-market-overview iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: inherit !important;
}

.tv-advanced-chart {
    height: 820px;
    min-height: 820px;
}

.tv-mini-chart {
    height: 420px;
    margin-top: 16px;
}

.tv-ticker {
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.market-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.market-tabs {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    min-height: 64px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.market-tabs label {
    display: inline-flex;
    min-height: 64px;
    align-items: center;
    color: #111827;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

#tab-track:checked ~ .market-tabs label[for="tab-track"],
#tab-chart:checked ~ .market-tabs label[for="tab-chart"] {
    color: #0f3b7a;
    border-bottom-color: #0f3b7a;
}

.market-tab-panel {
    display: none;
}

#tab-track:checked ~ .track-panel,
#tab-chart:checked ~ .chart-panel-tab {
    display: block;
}

.track-panel,
.chart-panel-tab {
    padding: 10px;
}

.matrix-wrap {
    max-width: 100%;
    overflow: auto;
    padding: 0 18px 18px;
}

.market-matrix {
    min-width: 940px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.market-matrix th,
.market-matrix td {
    min-width: 112px;
    height: 40px;
    padding: 9px 12px;
    border-right: 1px solid #edf0f5;
    border-bottom: 1px solid #edf0f5;
    text-align: center;
    background: #ffffff;
    vertical-align: middle;
}

.market-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #111827;
}

.market-matrix tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    background: #ffffff;
}

.coin-dot {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 7px;
    border-radius: 50%;
    background: #0f3b7a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.market-matrix .neutral-cell {
    background: #f0f4fc;
    color: #64748b;
}

.market-matrix .heat-up {
    background: #dff7ed;
}

.market-matrix .heat-down {
    background: #fde8eb;
}

.tradingview-shell {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 520px;
}

.chart-watchlist {
    border-right: 1px solid var(--line);
    background: #fafafa;
}

.search-line {
    display: flex;
    justify-content: space-between;
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 900;
}

.chart-watchlist a {
    display: grid;
    gap: 4px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.chart-watchlist a.active,
.chart-watchlist a:hover {
    background: #ffffff;
    box-shadow: inset 3px 0 0 #0f3b7a;
}

.personal-chart {
    min-width: 0;
    background: #ffffff;
}

.pro-toolbar {
    overflow-x: auto;
    white-space: nowrap;
}

.pro-toolbar a {
    margin-left: auto;
    color: #047857;
    font-weight: 900;
}

.price-line {
    display: flex;
    gap: 12px;
    padding: 8px 14px;
    color: #087d76;
    font-size: 13px;
}

.chart-canvas {
    position: relative;
    height: 430px;
    margin: 0 16px 20px;
    overflow: hidden;
    border: 1px solid #edf0f5;
    background:
        repeating-linear-gradient(to right, transparent 0 88px, rgba(15, 23, 42, 0.07) 89px 90px),
        repeating-linear-gradient(to bottom, transparent 0 40px, rgba(15, 23, 42, 0.07) 41px 42px),
        #ffffff;
}

.chart-canvas::before {
    content: "08:00   08:15   08:30   08:45   09:00   09:15   09:30   09:45   10:00";
    position: absolute;
    left: 42px;
    right: 24px;
    bottom: 8px;
    color: #111827;
    font-size: 12px;
    word-spacing: 30px;
}

.bb-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 95px;
    border: 1px solid #0c9395;
    border-left: 0;
    border-right: 0;
    border-radius: 48% 42% 45% 46%;
    opacity: 0.55;
}

.bb-line.upper {
    top: 78px;
}

.bb-line.middle {
    top: 150px;
    height: 70px;
    border-color: #923131;
}

.bb-line.lower {
    top: 230px;
}

.tv-candle {
    position: absolute;
    bottom: 88px;
    width: 7px;
    border-radius: 1px;
}

.tv-candle::before {
    content: "";
    position: absolute;
    left: 3px;
    top: -13px;
    width: 1px;
    height: calc(100% + 26px);
    background: currentColor;
}

.volume {
    position: absolute;
    bottom: 30px;
    width: 7px;
    opacity: 0.45;
}

.vol-up {
    background: #00a884;
}

.vol-down {
    background: #ff4d57;
}

.price-tag {
    position: absolute;
    right: 8px;
    min-width: 70px;
    padding: 3px 6px;
    color: white;
    background: #008b7c;
    font-size: 12px;
    font-weight: 900;
    text-align: right;
}

.tag-main {
    top: 248px;
}

.tag-high {
    top: 182px;
}

.tag-low {
    top: 288px;
}

.feature-band {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto 70px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-band article {
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.feature-band span,
.market-item span,
.muted {
    color: var(--muted);
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(0, 179, 134, 0.24), transparent 30%),
        var(--bg);
}

.auth-card {
    width: min(440px, 100%);
    padding: 34px;
    border-radius: 10px;
    background: white;
    box-shadow: var(--shadow);
}

.install-card {
    width: min(620px, 100%);
}

.auth-card h1 {
    text-align: center;
    margin: 26px 0 22px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.stacked-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ink);
    background: white;
}

hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
}

.check-row {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.kyc-files,
.kyc-admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kyc-files a,
.kyc-admin-links a {
    color: #047857;
    font-weight: 800;
}

textarea {
    resize: vertical;
}

.form-note {
    text-align: center;
    color: var(--muted);
}

.legal-disclosure {
    margin: 14px 0 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.form-note a,
.panel-head a,
.table-action {
    color: #047857;
    font-weight: 800;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    background: var(--design-surface, #eef2f7);
}

.sidebar {
    position: sticky;
    top: 0;
    grid-row: 1 / span 2;
    height: 100vh;
    padding: 22px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    color: white;
    background: #0b1220;
    border-right: 1px solid var(--line-dark);
    overflow: hidden;
}

.admin-sidebar {
    background: #111827;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    grid-column: 2;
    grid-row: 1;
    padding: 16px 30px 0;
    background: linear-gradient(180deg, var(--design-surface, #eef2f7) 0%, color-mix(in srgb, var(--design-surface, #eef2f7) 92%, transparent) 72%, transparent 100%);
}

.admin-topbar + .content {
    grid-row: 2;
    padding-top: 22px;
}

.admin-global-search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    max-width: 760px;
    padding: 10px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.admin-global-search input {
    min-height: 36px;
    border: 1px solid #dce3ee;
    border-radius: 7px;
    padding: 0 12px;
    background: #f8fafc;
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
}

.side-nav {
    display: grid;
    gap: 6px;
    margin-top: 34px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .55) transparent;
}

.side-nav::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .45);
    border-radius: 999px;
}

.side-nav a {
    padding: 12px 13px;
    border-radius: 8px;
    color: #c8d2e2;
    font-weight: 700;
}

.side-nav a.nav-with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.side-dropdown {
    display: grid;
    gap: 6px;
}

.side-dropdown summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 13px;
    border-radius: 8px;
    color: #c8d2e2;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.side-dropdown summary::-webkit-details-marker {
    display: none;
}

.side-dropdown summary::after {
    content: "v";
    color: #8fa3bd;
    font-size: 14px;
    font-weight: 900;
    transition: transform .18s ease;
}

.side-dropdown summary.nav-with-badge::after {
    order: 3;
}

.side-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.side-dropdown summary.active,
.side-dropdown summary:hover {
    background: rgba(0, 179, 134, 0.14);
    color: white;
}

.side-subnav {
    display: grid;
    gap: 5px;
    padding: 0 0 4px 12px;
}

.side-subnav a {
    min-height: 36px;
    padding: 9px 11px;
    border-left: 2px solid rgba(148, 163, 184, .22);
    border-radius: 7px;
    font-size: 13px;
}

.nav-badge {
    display: inline-grid;
    place-items: center;
    min-width: 23px;
    height: 23px;
    padding: 0 7px;
    border-radius: 999px;
    background: #e5484d;
    color: #ffffff;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.nav-badge[hidden] {
    display: none !important;
}

.side-nav a.active,
.side-nav a:hover {
    background: rgba(0, 179, 134, 0.14);
    color: white;
}

.side-user {
    position: static;
    margin-top: auto;
    display: grid;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--line-dark);
    color: #c8d2e2;
}

.side-user > span,
.side-user > small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-user > small {
    color: #91a1b8;
    font-size: 12px;
    font-weight: 700;
}

.side-user a {
    color: var(--brand-2);
    font-weight: 800;
}

.side-user > a:not(.user-badge) {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
}

.communication-option {
    display: block;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.communication-option:hover {
    border-color: var(--brand);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.dashboard-layout-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.dashboard-layout-tools.layout-edit-mode {
    border-color: color-mix(in srgb, var(--brand) 42%, #dce3ee);
    background: color-mix(in srgb, var(--brand) 8%, #ffffff);
}

.dashboard-layout-tools div {
    display: grid;
    gap: 3px;
}

.dashboard-layout-tools strong {
    color: #0f172a;
}

.dashboard-layout-tools span {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-layout-board {
    display: block;
}

.layout-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-layout-tools [data-dashboard-reset],
.dashboard-layout-tools .layout-edit-only {
    display: none;
}

.dashboard-layout-tools.layout-edit-mode [data-dashboard-reset],
.dashboard-layout-tools.layout-edit-mode .layout-edit-only {
    display: inline-flex;
}

.layout-save-status {
    min-width: 88px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.layout-save-status[data-state="saving"] {
    color: #0f3f74;
}

.layout-save-status[data-state="saved"] {
    color: #047857;
}

.layout-save-status[data-state="error"] {
    color: var(--danger);
}

.layout-hidden-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 18px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .68);
}

.layout-hidden-chip {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
}

.dashboard-movable-block {
    position: relative;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.dashboard-movable-block.is-dragging {
    opacity: .58;
    transform: scale(.992);
}

.dashboard-movable-block.drag-over {
    outline: 2px dashed color-mix(in srgb, var(--brand) 62%, #94a3b8);
    outline-offset: 5px;
}

.dashboard-layout-actions {
    display: none;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
}

.layout-edit-mode .dashboard-layout-actions {
    display: inline-flex;
}

.dashboard-drag-handle {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--brand) 28%, #cbd5e1);
    border-radius: 7px;
    background: color-mix(in srgb, var(--brand) 10%, #ffffff);
    color: #0f172a;
    font-size: 12px;
    font-weight: 850;
    cursor: grab;
}

.dashboard-drag-handle:active {
    cursor: grabbing;
}

.layout-icon-btn {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 850;
}

.layout-icon-btn:hover,
.layout-hidden-chip:hover {
    border-color: color-mix(in srgb, var(--brand) 45%, #cbd5e1);
    color: #064e3b;
}

.dashboard-movable-block > .dashboard-layout-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    margin: 0;
}

.layout-edit-mode .dashboard-movable-block:not(.panel) {
    padding-top: 42px;
}

@media (max-height: 820px) and (min-width: 761px) {
    .sidebar {
        padding: 16px;
    }

    .brand span,
    .brand img {
        width: 34px;
        height: 34px;
    }

    .side-nav {
        gap: 4px;
        margin-top: 20px;
        padding-bottom: 8px;
    }

    .side-nav a,
    .side-dropdown summary {
        min-height: 36px;
        padding: 9px 10px;
        border-radius: 7px;
        font-size: 13px;
    }

    .side-subnav {
        gap: 4px;
        padding-left: 8px;
    }

    .side-subnav a {
        min-height: 31px;
        padding: 7px 9px;
        font-size: 12px;
    }

    .side-user {
        gap: 6px;
        padding-top: 12px;
    }

    .user-badge {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 8px;
    }

    .avatar {
        width: 36px;
        height: 36px;
    }

    .side-user > a:not(.user-badge) {
        min-height: 32px;
        font-size: 13px;
    }
}

.user-badge {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    color: white;
}

.user-badge strong,
.user-badge small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge small {
    color: #91a1b8;
    font-size: 12px;
    font-weight: 600;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand);
    color: #03100c;
    font-weight: 900;
}

.avatar.large {
    width: 64px;
    height: 64px;
    font-size: 28px;
}

.avatar-fallback {
    overflow: hidden;
}

.user-silhouette {
    position: relative;
    display: block;
    width: 54%;
    height: 62%;
    color: currentColor;
}

.user-silhouette::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 42%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: currentColor;
    transform: translateX(-50%);
}

.user-silhouette::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 50%;
    border-radius: 50% 50% 22% 22%;
    background: currentColor;
}

.avatar-photo {
    overflow: hidden;
    padding: 0;
    background: #ffffff;
}

.avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-form {
    display: block;
    margin: 0;
}

.profile-photo-trigger {
    position: relative;
    display: inline-grid;
    place-items: center;
    margin: 0;
    cursor: pointer;
    border-radius: 50%;
}

.profile-photo-trigger .avatar.large {
    width: 76px;
    height: 76px;
    border: 3px solid #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}

.profile-photo-trigger input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.profile-photo-trigger .photo-action-label {
    position: absolute;
    inset: auto 6px 6px;
    display: grid;
    place-items: center;
    min-height: 22px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .78);
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease;
}

.profile-photo-trigger:hover .photo-action-label,
.profile-photo-trigger:focus-within .photo-action-label {
    opacity: 1;
    transform: translateY(0);
}

.profile-photo-trigger:hover .avatar,
.profile-photo-trigger:focus-within .avatar {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
}

.impersonation-banner {
    position: fixed;
    top: 12px;
    right: 18px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .12);
    font-size: 13px;
    font-weight: 850;
}

.impersonation-banner span {
    color: #92400e;
}

.impersonation-banner a {
    padding: 6px 8px;
    border-radius: 6px;
    background: #f59e0b;
    color: #111827;
    font-weight: 900;
}

.content {
    grid-column: 2;
    padding: 30px;
}

.markets-content {
    padding: 16px;
}

.markets-content .page-head {
    margin-bottom: 12px;
}

.markets-content .page-head h1 {
    font-size: 24px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-head h1 {
    margin: 0;
    font-size: 32px;
}

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

.section-title {
    margin: 0 0 12px;
    color: #0f3b7a;
    font-size: 22px;
}

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

.summary-card {
    min-height: 102px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(18, 24, 39, 0.04);
}

.summary-card span {
    display: block;
    margin-bottom: 8px;
    color: #778aa8;
    font-size: 16px;
    font-weight: 700;
}

.summary-card strong {
    color: #111827;
    font-size: 22px;
    font-weight: 500;
}

.summary-card i {
    display: inline-grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #24568f;
    color: #ffffff;
    font-style: normal;
    font-weight: 900;
}

.metric,
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(18, 24, 39, 0.05);
}

.metric {
    padding: 20px;
}

.metric span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.metric strong {
    font-size: 28px;
}

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

.panel h2 {
    margin: 0 0 18px;
    font-size: 21px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.panel-head h2 {
    margin: 0;
}

.panel-head .muted {
    margin: 5px 0 0;
}

.summary-grid.compact {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.summary-grid.compact .summary-card {
    min-height: 92px;
    padding: 16px;
}

.onboarding-card {
    display: grid;
    gap: 14px;
}

.onboarding-card .panel-head {
    margin-bottom: 0;
}

.onboarding-card .panel-head strong {
    color: #047857;
    font-size: 24px;
}

.onboarding-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.onboarding-list a {
    align-items: start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #172033;
    display: grid;
    gap: 7px;
    min-height: 126px;
    padding: 13px;
}

.onboarding-list a.done {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.onboarding-list a.todo:hover {
    background: #eef6ff;
    border-color: #bfdbfe;
}

.onboarding-list span {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    display: inline-flex;
    font-size: 11px;
    font-weight: 850;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.onboarding-list a.done span {
    background: #00b386;
    border-color: #00b386;
    color: #ffffff;
    font-size: 10px;
}

.onboarding-list strong {
    font-size: 14px;
}

.onboarding-list em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    line-height: 1.35;
}

.client-dashboard-page {
    display: grid;
    gap: 16px;
}

.client-premium-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 2px;
}

.client-premium-hero > div,
.client-premium-hero > aside {
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.client-premium-hero > div {
    padding: 22px;
}

.client-premium-hero h1 {
    margin: 4px 0 8px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1.1;
}

.client-premium-hero p {
    margin: 0;
    color: #64748b;
    font-weight: 650;
}

.client-premium-hero > aside {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 22px;
    background: #0f172a;
    color: #ffffff;
}

.client-premium-hero aside span,
.client-premium-hero aside small {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 800;
}

.client-premium-hero aside strong {
    font-size: 28px;
    line-height: 1.1;
}

.client-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.premium-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.premium-metrics article {
    display: grid;
    gap: 6px;
    min-height: 104px;
    padding: 15px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.premium-metrics span,
.premium-metrics em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.premium-metrics strong {
    color: #0f172a;
    font-size: 20px;
    font-weight: 850;
}

.client-premium-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
    gap: 16px;
}

.client-premium-grid.lower {
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1fr);
}

.premium-progress-card {
    display: grid;
    gap: 14px;
}

.premium-progress-card .panel-head {
    margin-bottom: 0;
}

.premium-progress-card .panel-head > strong {
    color: #047857;
    font-size: 28px;
}

.next-premium-action {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eef6ff;
}

.next-premium-action.done {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.next-premium-action span {
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.next-premium-action strong {
    color: #0f172a;
    font-size: 15px;
}

.next-premium-action em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    font-weight: 650;
}

.compact-checklist {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.compact-checklist a {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.compact-checklist a.done {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.compact-checklist i {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
}

.compact-checklist a.done i {
    background: #00a87e;
    color: #ffffff;
}

.compact-checklist span {
    overflow: hidden;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.premium-action-grid a {
    display: grid;
    gap: 5px;
    min-height: 78px;
    padding: 13px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #fbfdff;
}

.premium-action-grid a:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.premium-action-grid strong {
    color: #0f172a;
    font-size: 14px;
}

.premium-action-grid span {
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
}

.account-status-strip {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.account-status-strip span {
    display: flex;
    justify-content: space-between;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 850;
}

.account-status-strip .ok {
    background: #ecfdf5;
    color: #047857;
}

.account-status-strip .warn {
    background: #fff7ed;
    color: #9a3412;
}

.portfolio-mini-list,
.premium-activity-list {
    display: grid;
    gap: 9px;
}

.portfolio-mini-list div,
.premium-activity-list a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    padding: 10px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #fbfdff;
}

.portfolio-mini-list span,
.premium-activity-list span {
    display: grid;
    gap: 2px;
}

.portfolio-mini-list strong,
.premium-activity-list strong {
    color: #0f172a;
    font-size: 13px;
}

.portfolio-mini-list em,
.premium-activity-list em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    font-weight: 650;
}

.portfolio-mini-list b {
    color: #0f172a;
    font-size: 12px;
}

.portfolio-mini-list small {
    color: #047857;
    font-weight: 850;
}

.market-chip-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.market-chip-row a {
    display: grid;
    gap: 5px;
    min-height: 74px;
    padding: 11px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #fbfdff;
}

.market-chip-row span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.market-chip-row strong {
    color: #0f172a;
    font-size: 14px;
}

.market-chip-row em {
    font-size: 12px;
    font-style: normal;
    font-weight: 850;
}

.compact-tradingview {
    padding-bottom: 12px;
}

.portfolio-spec-page {
    display: grid;
    gap: 16px;
}

.portfolio-spec-hero {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.portfolio-spec-hero article {
    display: grid;
    gap: 6px;
    min-height: 106px;
    padding: 16px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.portfolio-spec-hero span,
.portfolio-spec-hero em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    font-weight: 850;
}

.portfolio-spec-hero strong {
    color: #0f172a;
    font-size: 22px;
    font-weight: 850;
}

.portfolio-spec-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.7fr) minmax(0, 1fr);
    gap: 16px;
}

.speculation-ticket {
    border-color: #bfdbfe;
}

.spec-side-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.spec-side-toggle label {
    position: relative;
    display: grid;
    align-content: center;
    min-height: 58px;
    gap: 3px;
    overflow: hidden;
    padding: 11px 12px 11px 42px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 900;
    cursor: pointer;
}

.spec-side-toggle label::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    transform: translateY(-50%);
}

.spec-side-toggle label::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transform: translateY(-50%);
}

.spec-side-toggle span {
    font-size: 13px;
}

.spec-side-toggle small {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.spec-side-toggle label:has(input:checked)::before {
    border-color: currentColor;
}

.spec-side-toggle label:has(input:checked)::after {
    background: currentColor;
}

.spec-side-toggle .buy-side:has(input:checked) {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, .16), #ffffff);
    color: #047857;
}

.spec-side-toggle .sell-side:has(input:checked) {
    border-color: #f43f5e;
    background: linear-gradient(135deg, rgba(244, 63, 94, .15), #ffffff);
    color: #be123c;
}

.spec-side-toggle input {
    position: absolute;
    opacity: 0;
}

.conditional-order-fields {
    display: grid;
    gap: 8px;
}

.conditional-order-fields label[hidden] {
    display: none;
}

.order-ticket-note {
    margin: 0;
    padding: 10px 11px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
}

.spec-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.spec-preview div {
    display: grid;
    gap: 4px;
    min-height: 66px;
    padding: 10px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #fbfdff;
}

.spec-preview span {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}

.spec-preview strong {
    color: #0f172a;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.spec-market-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.spec-market-list a {
    display: grid;
    gap: 5px;
    min-height: 84px;
    padding: 12px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #fbfdff;
}

.spec-market-list a:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.spec-market-list span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.spec-market-list strong {
    color: #0f172a;
    font-size: 15px;
}

.spec-market-list em {
    font-size: 12px;
    font-style: normal;
    font-weight: 850;
}

.portfolio-detail-grid {
    align-items: start;
}

.spec-trade-list {
    display: grid;
    gap: 9px;
}

.spec-trade-list div {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #fbfdff;
}

.spec-trade-list span {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.spec-trade-list strong {
    color: #0f172a;
    font-size: 13px;
}

.spec-trade-list em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    font-weight: 650;
}

.market-terminal-shell {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #cfd9e6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.terminal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .75fr);
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #1f2a3a;
    background: #0f172a;
}

.terminal-head h2,
.terminal-head p {
    margin: 0;
}

.terminal-head h2 {
    color: #ffffff;
    font-size: 22px;
}

.terminal-head > div > span {
    color: #9fb0c7;
    font-size: 13px;
    font-weight: 650;
}

.terminal-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.terminal-stats article {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #243247;
    border-radius: 8px;
    background: #121c2f;
}

.terminal-stats span,
.terminal-section-head span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.terminal-stats strong {
    color: #ffffff;
    font-size: 15px;
}

.terminal-layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr) 315px;
    min-height: 520px;
}

.market-watchlist,
.market-focus-panel,
.order-ticket-pro {
    padding: 16px;
}

.market-watchlist {
    border-right: 1px solid #1f2a3a;
    background: #111827;
}

.order-ticket-pro {
    border-left: 1px solid #d9e2ef;
    background: #f8fafc;
}

.terminal-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.terminal-section-head h3 {
    margin: 0;
    color: #0f172a;
    font-size: 15px;
}

.market-watchlist .terminal-section-head h3,
.order-book-panel .terminal-section-head h3 {
    color: #f8fafc;
}

.market-watchlist .terminal-section-head span,
.order-book-panel .terminal-section-head span {
    color: #8da2bd;
}

.market-watchlist button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    width: 100%;
    min-height: 64px;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid #243247;
    border-radius: 8px;
    background: #162033;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.market-watchlist button:hover,
.market-watchlist button.active {
    border-color: #14b8a6;
    background: #102f34;
    transform: translateY(-1px);
}

.market-watchlist span {
    display: grid;
    gap: 3px;
}

.market-watchlist strong {
    color: #f8fafc;
    font-size: 13px;
}

.market-watchlist em {
    color: #94a3b8;
    font-size: 11px;
    font-style: normal;
    font-weight: 650;
}

.market-watchlist b {
    color: #e2e8f0;
    font-size: 12px;
}

.market-watchlist i {
    grid-column: 2;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
    text-align: right;
}

.market-focus-panel {
    display: grid;
    grid-template-rows: auto auto minmax(320px, 1fr) auto auto;
    gap: 12px;
    background: #f5f8fc;
}

.market-focus-price {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.market-focus-price div {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    background: #ffffff;
}

.market-focus-price span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.market-focus-price strong {
    color: #0f172a;
    font-size: 16px;
}

.trading-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 12px;
    min-height: 330px;
}

.spec-chart-frame {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    border: 1px solid #1e293b;
    border-radius: 8px;
    background:
        radial-gradient(circle at 18% 18%, rgba(20, 184, 166, 0.08), transparent 26%),
        linear-gradient(180deg, #0b1220 0%, #101827 100%);
}

.spec-chart-toolbar {
    position: absolute;
    inset: 12px 12px auto 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spec-chart-toolbar div {
    display: grid;
    gap: 2px;
    margin-right: auto;
}

.spec-chart-toolbar small {
    color: #8da2bd;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.spec-chart-toolbar strong {
    color: #ffffff;
    font-size: 18px;
}

.spec-chart-toolbar button {
    min-width: 34px;
    padding: 5px 7px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 850;
    text-align: center;
}

.spec-chart-toolbar button:hover {
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .14);
}

.spec-chart-toolbar button.active {
    background: #00a87e;
    color: #03100c;
}

.chart-price-scale {
    position: absolute;
    inset: 68px 10px 70px auto;
    z-index: 2;
    display: grid;
    align-content: space-between;
    color: #8da2bd;
    font-size: 10px;
    font-weight: 850;
    text-align: right;
}

.candle-chart {
    position: absolute;
    inset: 66px 58px 76px 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    background:
        linear-gradient(rgba(148, 163, 184, 0.13) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.11) 1px, transparent 1px);
    background-size: 100% 25%, 10% 100%;
}

.candle-chart i {
    position: relative;
    display: block;
    width: 9px;
    height: var(--body);
    margin-bottom: var(--bottom);
    border-radius: 2px;
}

.candle-chart i::before {
    content: "";
    position: absolute;
    left: 4px;
    bottom: calc((var(--body) - var(--wick)) / 2);
    width: 1px;
    height: var(--wick);
}

.candle-chart i.up,
.candle-chart i.up::before {
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.candle-chart i.down,
.candle-chart i.down::before {
    background: #f43f5e;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}

.trade-chart-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.chart-position-line {
    position: absolute;
    right: 0;
    left: 0;
    height: 1px;
    background: rgba(250, 204, 21, .9);
    box-shadow: 0 0 16px rgba(250, 204, 21, .28);
}

.chart-position-line.open.buy {
    background: rgba(16, 185, 129, .95);
    box-shadow: 0 0 16px rgba(16, 185, 129, .3);
}

.chart-position-line.open.sell {
    background: rgba(239, 68, 68, .95);
    box-shadow: 0 0 16px rgba(239, 68, 68, .3);
}

.chart-position-line.closed {
    height: 0;
    border-top: 2px dashed rgba(100, 116, 139, .95);
    background: transparent;
    box-shadow: none;
    opacity: .9;
}

.chart-position-line.closed b {
    background: rgba(71, 85, 105, .94);
    color: #e2e8f0;
}

.chart-close-marker {
    position: absolute;
    right: 118px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    margin-top: -12px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 999px;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    font-size: 10px;
    font-weight: 950;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
}

.chart-close-marker.profit {
    background: rgba(5, 150, 105, .94);
}

.chart-close-marker.loss {
    background: rgba(220, 38, 38, .94);
}

.chart-close-marker em {
    font-style: normal;
    opacity: .9;
}

.chart-position-legend {
    position: absolute;
    left: 12px;
    bottom: 44px;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    pointer-events: none;
}

.chart-position-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .82);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 850;
}

.chart-position-legend i {
    width: 16px;
    height: 2px;
    display: inline-block;
    border-radius: 99px;
}

.chart-position-legend .open-buy {
    background: #10b981;
}

.chart-position-legend .open-sell {
    background: #ef4444;
}

.chart-position-legend .closed {
    border-top: 2px dashed #94a3b8;
}

.risk-reward-layer {
    z-index: 5;
}

.risk-reward-box {
    position: absolute;
    left: 18%;
    width: 42%;
    border-left: 1px solid rgba(15, 23, 42, .18);
    border-right: 1px solid rgba(15, 23, 42, .18);
}

.risk-reward-box.profit {
    background: rgba(16, 185, 129, .24);
    border-top: 1px solid rgba(16, 185, 129, .45);
}

.risk-reward-box.loss {
    background: rgba(239, 68, 68, .18);
    border-bottom: 1px solid rgba(239, 68, 68, .45);
}

.risk-reward-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(15, 23, 42, .05) 0 1px, transparent 1px 18px);
}

.risk-reward-label {
    position: absolute;
    left: 14%;
    width: 50%;
    min-height: 20px;
    display: grid;
    place-items: center;
    padding: 3px 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    transform: translateY(-50%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .16);
}

.risk-reward-label.target,
.risk-reward-label.entry {
    background: rgba(16, 185, 129, .92);
}

.risk-reward-label.stop {
    background: rgba(185, 28, 28, .94);
}

.risk-reward-label.entry {
    min-height: 36px;
}

.risk-reward-current {
    position: absolute;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    transform: translateY(-50%);
}

.risk-reward-current::before {
    content: "";
    position: absolute;
    right: 100%;
    width: 720px;
    height: 1px;
    background: rgba(15, 23, 42, .28);
}

.risk-reward-current em {
    color: #34d399;
    font-style: normal;
}

.chart-position-line b,
.chart-position-line em {
    position: absolute;
    right: 8px;
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(15, 23, 42, .92);
    color: #fde68a;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.chart-position-line b {
    top: -25px;
}

.chart-position-line em {
    top: 4px;
    color: #f8fafc;
}

.chart-order-marker {
    position: absolute;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid rgba(255, 255, 255, .88);
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 950;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .28);
}

.chart-order-marker.buy {
    background: #10b981;
}

.chart-order-marker.sell {
    background: #ef4444;
}

.chart-empty-overlay {
    position: absolute;
    left: 16px;
    bottom: 12px;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(15, 23, 42, .86);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 850;
}

.volume-bars {
    position: absolute;
    right: 58px;
    bottom: 18px;
    left: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 44px;
    opacity: .82;
}

.volume-bars i {
    display: block;
    width: 9px;
    height: var(--vol);
    border-radius: 2px 2px 0 0;
    background: rgba(34, 197, 94, 0.36);
}

.volume-bars i.down {
    background: rgba(244, 63, 94, 0.34);
}

.price-line {
    position: absolute;
    right: 8px;
    top: 46%;
    padding: 6px 9px;
    border-radius: 7px;
    background: #22c55e;
    color: #03100c;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .22), 0 10px 24px rgba(34, 197, 94, .22);
}

.order-book-panel {
    display: grid;
    grid-template-rows: auto auto 1fr auto auto 1fr;
    min-height: 330px;
    padding: 12px;
    border: 1px solid #1e293b;
    border-radius: 8px;
    background: #101827;
}

.terminal-section-head.compact {
    margin-bottom: 8px;
}

.order-book-list {
    display: grid;
    align-content: center;
    gap: 5px;
}

.order-book-header {
    display: flex;
    justify-content: space-between;
    padding: 0 6px 5px;
    color: #8da2bd;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.order-book-list div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 850;
}

.order-book-list.asks div {
    background: linear-gradient(90deg, rgba(244, 63, 94, 0.22), rgba(244, 63, 94, 0.04));
    color: #fecdd3;
}

.order-book-list.bids div {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.22), rgba(34, 197, 94, 0.04));
    color: #bbf7d0;
}

.order-book-mid {
    display: grid;
    gap: 3px;
    margin: 8px 0;
    padding: 9px;
    border-radius: 7px;
    border: 1px solid #243247;
    background: #0b1220;
    color: #ffffff;
    text-align: center;
}

.order-book-mid span {
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.order-book-mid strong {
    font-size: 14px;
}

.execution-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.execution-metrics div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    background: #fbfdff;
}

.execution-metrics span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.execution-metrics strong {
    color: #0f172a;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.chart-axis {
    position: absolute;
    right: 12px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    font-size: 10px;
    font-weight: 850;
}

.chart-axis.top {
    top: 18px;
}

.chart-axis.mid {
    top: 48%;
}

.chart-axis.low {
    bottom: 18px;
}

.risk-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.risk-strip span {
    padding: 9px 10px;
    border-radius: 8px;
    background: #e8f7f4;
    color: #0f766e;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.order-ticket-pro .panel-head {
    margin-bottom: 12px;
}

.order-ticket-pro .panel-head h2 {
    font-size: 20px;
}

.order-type-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.order-type-row button {
    min-height: 32px;
    border: 1px solid #dce3ee;
    border-radius: 7px;
    background: #ffffff;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.order-type-row button.active {
    border-color: #99f6e4;
    background: #ccfbf1;
    color: #0f766e;
}

.grid.two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
    gap: 18px;
}

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

.table-experience-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 8px;
    color: var(--pro-muted);
    font-size: 10px;
    font-weight: 700;
}

.table-experience-tools button {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--pro-line-strong);
    border-radius: 5px;
    background: #fff;
    color: #475467;
    font: 700 10px/1 inherit;
    cursor: pointer;
}

.table-experience-tools button:hover {
    border-color: #9eacbd;
    color: var(--pro-ink);
}

.empty-state {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 26px;
    text-align: center;
}

.empty-state.compact {
    justify-items: start;
    padding: 16px;
    text-align: left;
}

.empty-state strong {
    color: #0f172a;
    font-size: 15px;
}

.empty-state span {
    font-size: 13px;
}

.permission-editor summary {
    color: #047857;
    cursor: pointer;
    font-weight: 800;
}

.permission-editor form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 10px;
    min-width: min(520px, 72vw);
    padding: 12px;
}

.withdrawal-action-stack {
    display: grid;
    gap: 9px;
    min-width: 230px;
}

.withdrawal-action-stack form {
    display: grid;
    gap: 7px;
}

.withdrawal-action-stack textarea {
    min-height: 58px;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.up {
    color: #047857;
}

.down {
    color: var(--danger);
}

.balance-pill,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border-radius: 999px;
    padding: 7px 12px;
    background: #e8f8f2;
    color: #047857;
    font-weight: 800;
}

.status.pending {
    background: #fff7df;
    color: #92400e;
}

.status.in_review {
    background: #eef2ff;
    color: #3730a3;
}

.status.approved {
    background: #e8f8f2;
    color: #047857;
}

.status.rejected {
    background: #feecec;
    color: #b42318;
}

.status.sent {
    background: #e8f8f2;
    color: #047857;
}

.status.failed {
    background: #feecec;
    color: #b42318;
}

.status.info {
    background: #eef2ff;
    color: #3730a3;
}

.status.admin {
    background: #f3e8ff;
    color: #6d28d9;
}

.status.client {
    background: #ecfdf5;
    color: #047857;
}

.status.none {
    background: #eef2f7;
    color: #475569;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 8px;
    font-weight: 700;
}

.alert.success {
    background: #e8f8f2;
    color: #047857;
}

.alert.error {
    background: #feecec;
    color: #b42318;
}

.mini {
    min-height: 34px;
    border-radius: 7px;
    padding: 8px 10px;
    color: white;
    font-weight: 800;
}

.mini.approve {
    background: #047857;
}

.mini.reject {
    background: #b42318;
}

.table-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.finance-file-button {
    min-height: 31px;
    padding: 7px 12px;
    border: 1px solid #99f6e4;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
    box-shadow: 0 7px 16px rgba(15, 118, 110, 0.12);
}

.finance-file-button:hover {
    border-color: #5eead4;
    background: #99f6e4;
    color: #134e4a;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.withdrawal-file-button {
    border-color: #bfdbfe;
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: 0 7px 16px rgba(29, 78, 216, 0.12);
}

.withdrawal-file-button:hover {
    border-color: #93c5fd;
    background: #bfdbfe;
    color: #1e3a8a;
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.18);
}

.admin-users-page {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.admin-users-head h1 {
    margin-bottom: 8px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0;
}

.admin-users-head .muted,
.users-list-panel .panel-head .muted {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 400;
}

.admin-users-actions {
    align-items: stretch;
}

.user-action-card {
    border: 1px solid #e4eaf3;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.user-action-card h2,
.users-list-panel h2 {
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0;
}

.admin-users-page label {
    color: #5f6b7a;
    font-size: 13px;
    font-weight: 600;
}

.admin-users-page input,
.admin-users-page select {
    min-height: 40px;
    border-color: #e0e7f0;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 400;
}

.users-list-panel {
    padding: 0;
    overflow: hidden;
    border: 1px solid #e4eaf3;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}

.users-list-panel .panel-head {
    margin: 0;
    padding: 18px 20px;
    border-bottom: 1px solid #e7edf5;
}

.users-accordion-list {
    display: grid;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
}

.user-accordion-item {
    border: 1px solid #dfe7f2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
    overflow: hidden;
}

.user-accordion-item[open] {
    border-color: #bcd7f5;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.065);
}

.user-accordion-item summary {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 66px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
}

.user-accordion-item summary:hover {
    background: #fbfdff;
}

.user-accordion-item summary::-webkit-details-marker {
    display: none;
}

.accordion-arrow {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid #dbe7f3;
    border-radius: 50%;
    background: #fff;
}

.accordion-arrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid #0f3f74;
    border-bottom: 2px solid #0f3f74;
    transform: rotate(-45deg);
    transition: transform .16s ease;
}

.user-accordion-item[open] .accordion-arrow::before {
    transform: rotate(45deg);
}

.user-accordion-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #e8eef6;
    background: #f8fafc;
}

.accordion-detail-card {
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
    padding: 13px;
    border: 1px solid #e5edf6;
    border-radius: 8px;
    background: #fff;
}

.detail-label {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.user-accordion-item .status,
.user-accordion-item .mini,
.user-accordion-item .table-button {
    min-height: 28px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

.user-accordion-item .compact-actions {
    gap: 7px;
}

.user-accordion-item .table-button {
    justify-content: center;
}

.users-table {
    min-width: 1080px;
    font-size: 13px;
    color: #233044;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.users-table th {
    padding: 12px 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.users-table td {
    padding: 16px;
    border-top: 1px solid #e6edf6;
    border-bottom: 1px solid #e6edf6;
    background: #fff;
    vertical-align: middle;
    font-weight: 400;
}

.users-table td:first-child {
    border-left: 1px solid #e6edf6;
    border-radius: 10px 0 0 10px;
}

.users-table td:last-child {
    border-right: 1px solid #e6edf6;
    border-radius: 0 10px 10px 0;
}

.users-table tbody tr:hover {
    background: transparent;
}

.users-table tbody tr:hover td {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.user-id {
    color: #7b8796;
    font-size: 12px;
    font-weight: 600;
}

.user-cell {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 260px;
}

.user-cell strong,
.user-cell small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-cell strong {
    color: #172033;
    font-size: 15px;
    font-weight: 800;
}

.user-cell small {
    margin-top: 3px;
    color: #7b8796;
    font-size: 12px;
    font-weight: 400;
}

.avatar.small {
    width: 42px;
    height: 42px;
    font-size: 13px;
    font-weight: 900;
    background: linear-gradient(135deg, #e0f2fe, #dcfce7);
    color: #0f3f74;
}

.users-table .status,
.users-table .mini {
    min-height: 26px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

.users-table .role-status {
    background: #eef6ff;
    color: #1d4ed8;
    text-transform: capitalize;
}

.user-balance {
    color: #0f766e;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}

.account-stack,
.verification-stack,
.user-actions-stack {
    display: grid;
    gap: 8px;
    align-items: start;
}

.verification-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-meta {
    min-width: 170px;
}

.user-meta span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.7;
}

.modern-meta {
    min-width: 0;
    gap: 6px;
}

.modern-meta span {
    padding: 8px 10px;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: #f8fafc;
}

.modern-meta .detail-label {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

.modern-meta em {
    color: #7b8796;
    font-style: normal;
    font-weight: 800;
}

.user-meta strong {
    color: #243044;
    font-weight: 700;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-table .muted,
.user-accordion-item .muted {
    color: #7b8796;
    font-size: 12px;
    font-weight: 400;
}

.users-table .kyc-admin-links,
.user-accordion-item .kyc-admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.users-table .kyc-admin-links a,
.user-accordion-item .kyc-admin-links a {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 650;
}

.users-table .inline-form {
    gap: 8px;
    align-items: center;
}

.users-table .inline-form input {
    min-width: 190px;
    min-height: 34px;
    font-size: 12px;
}

.reset-inline-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
}

.client-danger-form,
.client-delete-form {
    display: grid;
    gap: 7px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.client-danger-form {
    grid-template-columns: minmax(160px, 1fr) auto;
    align-items: center;
}

.client-delete-form {
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
    align-items: center;
}

.client-danger-form input,
.client-delete-form input {
    min-height: 34px;
    font-size: 12px;
}

.client-delete-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
}

.admin-sensitive-editor .form-stack + .form-stack {
    margin-top: 10px;
}

.admin-delete-box {
    padding-top: 10px;
    border-top: 1px dashed #fecaca;
}

.manager-assign-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.manager-assign-form select {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
}

.manager-card {
    display: grid;
    gap: 10px;
    margin: 20px 0;
    padding: 14px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
    text-align: left;
}

.manager-card h3,
.manager-card p {
    margin: 0;
}

.manager-card h3 {
    font-size: 15px;
}

.manager-card p {
    color: #0f3b7a;
    font-weight: 800;
}

.order-card {
    align-self: start;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-header h2,
.profile-header p {
    margin: 0;
}

.profile-header .balance-pill {
    margin-left: auto;
}

.compact-actions {
    margin-top: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(18, 24, 39, 0.04);
}

.admin-tabs a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    color: #314158;
    font-weight: 800;
}

.admin-tabs a:hover {
    background: #eef6ff;
    color: #0f3b7a;
}

.admin-user-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-summary .summary-card {
    min-height: 86px;
    padding: 18px;
}

.admin-summary .summary-card span {
    font-size: 14px;
}

.admin-summary .summary-card strong {
    font-size: 18px;
}

.admin-summary .summary-card i {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
}

.detail-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-grid div {
    padding: 14px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.detail-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.detail-grid strong {
    display: block;
    overflow-wrap: anywhere;
    color: #111827;
}

.admin-forms-grid {
    margin-bottom: 18px;
}

.wide-inline {
    grid-template-columns: minmax(240px, 420px) auto;
}

.admin-profile-card {
    position: sticky;
    top: 24px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(18, 24, 39, 0.08);
    text-align: center;
}

.admin-profile-card h2 {
    margin: 14px 0 4px;
}

.avatar.xlarge {
    width: 86px;
    height: 86px;
    margin: 0 auto;
    font-size: 34px;
}

.profile-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 22px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.profile-status-grid div {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 16px 10px;
}

.profile-status-grid div + div {
    border-left: 1px solid var(--line);
}

.profile-status-grid small {
    color: var(--muted);
    font-weight: 800;
}

.kyc-box {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    text-align: left;
}

.kyc-box h3 {
    margin: 0 0 12px;
}

.kyc-box p {
    margin: 8px 0;
    overflow-wrap: anywhere;
}

.client-360-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.compact-list {
    display: grid;
    gap: 10px;
}

.compact-list-item {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 11px;
}

.compact-list-item strong {
    color: #0f172a;
    display: block;
    font-size: 14px;
}

.compact-list-item span {
    color: #64748b;
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.quick-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    margin: 16px 0;
}

.quick-actions a {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    color: #0f3f74;
    font-size: 12px;
    font-weight: 800;
    padding: 9px 10px;
    text-align: center;
}

.client-message-list {
    display: grid;
    gap: 10px;
}

.client-message-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 11px;
}

.client-message-item.admin {
    background: #f8fafc;
}

.client-message-item.client {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.client-message-item strong,
.client-message-item span {
    display: block;
    font-size: 12px;
}

.client-message-item p {
    color: #243044;
    font-size: 13px;
    line-height: 1.5;
    margin: 5px 0;
}

.kyc-box-mini {
    margin-top: 16px;
}

.kyc-box-mini h4 {
    margin: 0 0 10px;
}

.liveness-mini-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.liveness-mini-grid figure {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 0;
    overflow: hidden;
}

.liveness-mini-grid img {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    width: 100%;
}

.liveness-mini-grid figcaption {
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    padding: 7px;
}

.kyc-admin-links.stacked {
    display: grid;
    gap: 8px;
}

.kyc-filter-bar {
    display: grid;
    grid-template-columns: 180px minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.kyc-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.kyc-review-card {
    display: grid;
    gap: 16px;
}

.kyc-verification-panel {
    grid-column: 1 / -1;
    padding: 0;
    overflow: hidden;
}

.kyc-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    padding: 22px;
    border-bottom: 1px solid #e7edf5;
    background: #fbfdff;
}

.kyc-panel-head h2 {
    margin: 4px 0 6px;
}

.kyc-real-form {
    padding: 22px;
}

.kyc-step-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
    gap: 18px;
}

.kyc-step-card {
    position: relative;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.kyc-step-card h3 {
    margin: 0 0 16px;
    font-size: 17px;
}

.kyc-step-number {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #0f172a;
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.kyc-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.kyc-camera-frame {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 280px;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #0f172a;
}

.kyc-camera-frame video,
.kyc-camera-frame img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
}

.kyc-camera-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    padding: 24px;
    color: #e5edf7;
    text-align: center;
}

.kyc-camera-placeholder strong {
    font-size: 18px;
}

.kyc-camera-placeholder span {
    max-width: 310px;
    color: #aebbd0;
    font-size: 13px;
    line-height: 1.5;
}

.kyc-camera-overlay {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.kyc-camera-overlay strong {
    font-size: 18px;
    font-weight: 800;
}

.kyc-camera-overlay span {
    color: #dbeafe;
    font-size: 14px;
    line-height: 1.45;
}

.kyc-camera-actions {
    margin-top: 12px;
    flex-wrap: wrap;
}

.kyc-camera-actions .primary-action {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.kyc-liveness-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.kyc-liveness-steps li {
    min-height: 34px;
    display: grid;
    place-items: center;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
    background: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.kyc-liveness-steps li.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.kyc-liveness-steps li.done {
    border-color: #99f6e4;
    background: #ecfdf5;
    color: #047857;
}

.kyc-current-files {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.kyc-selfie-review {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.kyc-selfie-review img {
    width: 86px;
    height: 86px;
    border-radius: 8px;
    object-fit: cover;
}

.kyc-selfie-review span {
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.kyc-selfie-review.compact {
    grid-template-columns: 72px minmax(0, 1fr);
    margin: 12px 0;
}

.kyc-selfie-review.compact img {
    width: 72px;
    height: 72px;
}

.kyc-document-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.kyc-document-gallery figure {
    margin: 0;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.kyc-document-gallery figcaption {
    margin-bottom: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.kyc-document-gallery img {
    width: 100%;
    height: 180px;
    border-radius: 7px;
    object-fit: cover;
    background: #0f172a;
}

.kyc-document-gallery form {
    margin-top: 8px;
}

.kyc-document-gallery small {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.liveness-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kyc-pdf-preview {
    display: grid;
    place-items: center;
    height: 180px;
    border-radius: 7px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 900;
}

.kyc-liveness-admin {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
}

.kyc-liveness-admin span {
    font-size: 12px;
    color: #15803d;
}

.kyc-rejection-note,
.kyc-client-rejection {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    background: #fff1f2;
    color: #9f1239;
}

.kyc-rejection-note strong,
.kyc-client-rejection strong {
    color: #9f1239;
    font-size: 13px;
}

.kyc-rejection-note p,
.kyc-client-rejection span {
    margin: 0;
    color: #be123c;
    font-size: 13px;
    line-height: 1.55;
}

.kyc-reject-form {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.kyc-reject-form textarea {
    min-height: 36px;
    font-size: 12px;
}

.admin-dashboard-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.financial-dashboard-panel {
    margin-bottom: 18px;
}

.period-switcher {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #f8fafc;
}

.period-switcher button {
    min-height: 30px;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.period-switcher button.active,
.period-switcher button:hover {
    background: #00a87e;
    color: #03100c;
}

.finance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    gap: 10px;
}

.finance-kpi-grid article {
    display: grid;
    gap: 6px;
    min-height: 118px;
    padding: 14px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #fbfdff;
}

.finance-kpi-grid span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.finance-kpi-grid strong {
    color: #0f172a;
    font-size: 20px;
    font-weight: 850;
}

.finance-kpi-grid em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.dashboard-grid {
    margin-bottom: 18px;
}

.bar-chart {
    height: 280px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 18px;
    align-items: end;
    padding: 18px 8px 0;
    border-bottom: 1px solid var(--line);
}

.bar-group {
    display: grid;
    gap: 10px;
    align-items: end;
    height: 100%;
}

.bar-pair {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 8px;
    height: 220px;
}

.bar {
    width: 18px;
    min-height: 4px;
    border-radius: 8px 8px 0 0;
}

.deposit-bar,
.deposit-dot {
    background: #047857;
}

.withdrawal-bar,
.withdrawal-dot {
    background: #e5484d;
}

.bar-group small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.chart-legend {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    color: var(--muted);
    font-weight: 800;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chart-legend i {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 999px;
}

.status-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.status-stat-card {
    padding: 16px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.status-stat-card strong {
    display: block;
    margin-bottom: 12px;
    font-size: 18px;
}

.status-stat-card p {
    display: flex;
    justify-content: space-between;
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.status-stat-card b {
    color: var(--ink);
}

.stacked-bar {
    height: 16px;
    display: flex;
    overflow: hidden;
    border-radius: 999px;
    background: #e5eaf2;
}

.approved-part {
    background: #047857;
}

.pending-part {
    background: #f59e0b;
}

.review-part {
    background: #3b82f6;
}

.rejected-part {
    background: #e5484d;
}

.leaderboard {
    display: grid;
    gap: 12px;
}

.leaderboard a {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    overflow: hidden;
    padding: 14px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #ffffff;
}

.leaderboard a > span,
.leaderboard em {
    position: relative;
    z-index: 1;
}

.leaderboard strong,
.leaderboard small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard small {
    color: var(--muted);
}

.leaderboard em {
    color: #047857;
    font-style: normal;
    font-weight: 900;
}

.leaderboard i {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    background: #00b386;
}

.mini-activity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.mini-activity-grid h3 {
    margin: 0 0 12px;
}

.mini-activity-grid p {
    display: grid;
    gap: 4px;
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.mini-activity-grid span {
    color: var(--muted);
}

.admin-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 18px;
    margin-bottom: 18px;
}

.workbench-main,
.workbench-side {
    margin-bottom: 0;
}

.workbench-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.workbench-grid a {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fbff;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.workbench-grid a:hover,
.workbench-list a:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.workbench-grid span {
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.workbench-grid strong {
    color: #111827;
    font-size: 28px;
    font-weight: 750;
}

.workbench-grid em {
    color: #526072;
    font-size: 12px;
    font-style: normal;
    font-weight: 650;
}

.workbench-list {
    display: grid;
    gap: 9px;
}

.workbench-list a {
    display: grid;
    gap: 3px;
    padding: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.workbench-list strong {
    color: #172033;
    font-size: 13px;
    font-weight: 700;
}

.workbench-list span {
    color: #6f7b8e;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.action-list a {
    background: #f8fbff;
}

.notifications-panel {
    display: grid;
    gap: 10px;
}

.notification-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.notification-filter-bar a {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    color: #334155;
    display: inline-flex;
    gap: 8px;
    min-height: 36px;
    padding: 8px 11px;
}

.notification-filter-bar a.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.notification-filter-bar strong {
    align-items: center;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    justify-content: center;
    min-width: 24px;
    padding: 2px 7px;
}

.notification-filter-bar a.active strong {
    background: rgba(255, 255, 255, 0.18);
}

.notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #60a5fa;
    border-radius: 8px;
    background: #ffffff;
}

.notification-item.unread {
    background: #f8fbff;
    border-color: #bfdbfe;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.07);
}

.notification-main {
    align-items: flex-start;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
}

.notification-type-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    justify-content: center;
    min-width: 64px;
    padding: 5px 9px;
}

.notification-type-badge.deposit {
    background: #e0f2fe;
    color: #075985;
}

.notification-type-badge.withdrawal {
    background: #fef3c7;
    color: #92400e;
}

.notification-type-badge.kyc {
    background: #f3e8ff;
    color: #6d28d9;
}

.notification-type-badge.user,
.notification-type-badge.client {
    background: #ecfdf5;
    color: #047857;
}

.notification-type-badge.message {
    background: #ecfeff;
    color: #155e75;
}

.notification-type-badge.error {
    background: #fee2e2;
    color: #b42318;
}

.notification-type-badge.success {
    background: #dcfce7;
    color: #166534;
}

.notification-type-badge.info {
    background: #eef2ff;
    color: #3730a3;
}

.notification-item.success {
    border-left-color: #10b981;
}

.notification-item.error {
    border-left-color: #ef4444;
}

.notification-item.deposit {
    border-left-color: #0ea5e9;
}

.notification-item.withdrawal {
    border-left-color: #f59e0b;
}

.notification-item.kyc {
    border-left-color: #8b5cf6;
}

.notification-item strong {
    color: #172033;
    font-size: 14px;
}

.notification-item p {
    margin: 4px 0;
    color: #526072;
    font-size: 13px;
    line-height: 1.5;
}

.notification-item small {
    color: #7b8796;
    font-size: 11px;
}

.settings-section {
    padding: 0;
    overflow: hidden;
}

.settings-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(18, 24, 39, 0.06);
}

.settings-hero h1,
.settings-hero p {
    margin: 0;
}

.settings-hero h1 {
    margin-bottom: 6px;
}

.settings-health {
    display: grid;
    gap: 4px;
    min-width: 210px;
    padding: 14px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.settings-health span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.settings-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.settings-overview article {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
}

.settings-overview span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.settings-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.settings-index {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
}

.settings-index a {
    padding: 11px 12px;
    border-radius: 6px;
    color: #314158;
    font-weight: 800;
}

.settings-index a:hover {
    background: #eef6f3;
    color: #047857;
}

.settings-index a.active {
    background: #00b386;
    color: #03100c;
}

.settings-content {
    display: grid;
    gap: 18px;
}

.settings-card {
    padding: 0;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(18, 24, 39, 0.05);
    overflow: hidden;
}

.settings-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e6edf6;
    background: #fbfdff;
}

.settings-card-head h2,
.settings-card-head p {
    margin: 0;
}

.settings-card-head p {
    margin-top: 4px;
    color: var(--muted);
}

.settings-card-head > span {
    white-space: nowrap;
    padding: 6px 9px;
    border-radius: 999px;
    background: #eef6f3;
    color: #047857;
    font-size: 12px;
    font-weight: 900;
}

.settings-form {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.settings-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.settings-subsection {
    padding-top: 4px;
    border-top: 1px solid #eef2f6;
}

.settings-subsection h3 {
    margin: 0;
    font-size: 15px;
}

.settings-toggle-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-section-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.settings-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.settings-section-head h2 {
    margin: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 46px;
    padding: 26px 20px;
}

.settings-grid article {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px 14px;
    align-items: start;
}

.settings-grid i {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: #f2f5f9;
    color: #24568f;
    font-style: normal;
    font-weight: 900;
}

.settings-grid strong {
    color: #0f3b7a;
}

.settings-grid span {
    grid-column: 2;
    color: #314158;
    font-size: 14px;
}

.settings-grid .active-setting i {
    background: #e8f8f2;
    color: #047857;
}

.settings-manage-grid {
    align-items: start;
}

.settings-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.logo-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 12px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.logo-preview img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.app-logo-grid {
    margin-bottom: 18px;
}

.app-logo-preview {
    grid-column: span 1;
}

.design-preview-brand img,
.design-preview-brand > span:first-child {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--brand);
    color: #03100c;
    object-fit: contain;
    font-weight: 900;
}

.design-preview-brand img {
    padding: 4px;
    background: #fff;
    border: 1px solid #dce3ee;
}

.settings-tabs > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tab-switcher {
    display: inline-flex;
    width: fit-content;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.tab-switcher label {
    padding: 9px 13px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

#emailTabSend:checked ~ .tab-switcher label[for="emailTabSend"],
#emailTabSmtp:checked ~ .tab-switcher label[for="emailTabSmtp"] {
    background: var(--brand);
    color: #03100c;
}

.tab-panel {
    display: none;
}

#emailTabSend:checked ~ .email-send-panel,
#emailTabSmtp:checked ~ .email-smtp-panel {
    display: grid;
    gap: 14px;
}

button:disabled,
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.payment-method-list {
    display: grid;
    gap: 12px;
}

.payment-method-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.payment-method-item strong,
.payment-method-item span {
    display: block;
}

.payment-method-item span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payment-method-item p {
    margin: 10px 0 0;
    color: #314158;
    line-height: 1.5;
}

.method-actions {
    display: flex;
    align-items: start;
    gap: 8px;
}

.payment-help-list {
    display: grid;
    gap: 10px;
}

.method-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.method-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.method-card-icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    background: #e8f8f2;
    color: #047857;
    font-weight: 900;
}

.method-card-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.method-card strong,
.method-card p {
    margin: 0;
}

.method-card p {
    color: var(--muted);
    font-size: 13px;
}

.method-card ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.method-card li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.method-card b {
    color: var(--ink);
}

.payment-help-list article {
    padding: 12px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.payment-help-list strong {
    color: #0f3b7a;
}

.payment-help-list p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.selected-payment-panel {
    display: grid;
    gap: 14px;
    padding: 15px;
    border: 1px solid #dbe7f3;
    border-radius: 8px;
    background: #f8fbff;
    color: #5f6b7a;
}

.selected-payment-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}

.selected-payment-head span,
.payment-coordinate-grid span {
    display: block;
    color: #748195;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.selected-payment-head strong {
    display: block;
    margin-top: 2px;
    color: #172033;
    font-size: 17px;
    font-weight: 700;
}

.selected-payment-head em {
    min-height: 26px;
    display: inline-grid;
    place-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e8f8f2;
    color: #047857;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.payment-coordinate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.payment-coordinate-grid div {
    min-width: 0;
    padding: 10px;
    border: 1px solid #e4ebf4;
    border-radius: 7px;
    background: #ffffff;
}

.payment-coordinate-grid div.wide {
    grid-column: 1 / -1;
}

.payment-coordinate-grid strong {
    display: block;
    margin-top: 4px;
    color: #1f2937;
    font-size: 13px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.payment-barcode {
    display: inline-grid;
    width: fit-content;
    padding: 10px;
    border: 1px solid #e4ebf4;
    border-radius: 8px;
    background: #ffffff;
}

.payment-barcode img {
    width: 150px;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.selected-payment-panel p {
    margin: 0;
    color: #526072;
    font-size: 13px;
    line-height: 1.6;
}

.payment-summary-box {
    display: grid;
    gap: 12px;
    padding: 15px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
}

.payment-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.payment-summary-head span {
    color: #15803d;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-summary-head strong {
    color: #14532d;
    font-size: 16px;
}

.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.payment-summary-grid div {
    padding: 10px;
    border: 1px solid #dcfce7;
    border-radius: 7px;
    background: #ffffff;
}

.payment-summary-grid span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.payment-summary-grid strong {
    display: block;
    margin-top: 4px;
    color: #172033;
    font-size: 14px;
    font-weight: 750;
}

.payment-summary-box p {
    margin: 0;
    color: #166534;
    font-size: 13px;
    font-weight: 650;
}

.payment-summary-box p.error {
    color: #be123c;
}

.chat-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.chat-layout.single-chat {
    grid-template-columns: minmax(0, 900px);
}

.conversations-panel {
    max-height: calc(100vh - 120px);
    overflow: auto;
}

.conversation-list {
    display: grid;
    gap: 8px;
}

.conversation-list a {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.conversation-list a.active,
.conversation-list a:hover {
    border-color: #dbeafe;
    background: #eef6ff;
}

.conversation-list strong,
.conversation-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-list small {
    color: var(--muted);
}

.conversation-list em {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
}

.chat-panel {
    padding: 0;
    overflow: hidden;
}

.chat-head {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.chat-head h2,
.chat-head p {
    margin: 0;
}

.chat-client-avatar,
.chat-client-profile-link {
    color: inherit;
    text-decoration: none;
}

.chat-client-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    border-radius: 50%;
}

.chat-client-profile-link {
    display: inline-flex;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: color 160ms ease, border-color 160ms ease;
}

.chat-client-profile-link:hover,
.chat-client-profile-link:focus-visible {
    color: var(--brand);
    border-bottom-color: currentColor;
}

.chat-client-avatar:focus-visible,
.chat-client-profile-link:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
    outline-offset: 3px;
}

.chat-head .btn {
    margin-left: auto;
}

.chat-thread {
    height: 520px;
    overflow-y: auto;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(244, 247, 251, 0.8), rgba(255, 255, 255, 0.92));
}

.chat-message {
    display: flex;
    margin-bottom: 12px;
}

.chat-message.mine {
    justify-content: flex-end;
}

.chat-message.pending {
    opacity: 0.68;
}

.chat-message.theirs {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: min(620px, 82%);
    padding: 12px 14px;
    border: 1px solid #dce3ee;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(18, 24, 39, 0.04);
}

.chat-message.mine .chat-bubble {
    border-color: rgba(0, 179, 134, 0.35);
    background: #e8f8f2;
}

.chat-bubble strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.chat-bubble p {
    margin: 0;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.client-message-item p {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-bubble small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.chat-message-meta {
    display: flex !important;
    flex-wrap: wrap;
    gap: 5px 9px;
    align-items: center;
}

.chat-message-edited {
    font-style: italic;
}

.chat-message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 7px;
    opacity: 0;
    transition: opacity 150ms ease;
}

.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions {
    opacity: 1;
}

.chat-message-actions button,
.chat-edit-controls button {
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #566277;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.chat-message-actions button:hover,
.chat-edit-cancel:hover {
    border-color: #cdd6e3;
    background: rgba(255, 255, 255, 0.72);
}

.chat-message-actions [data-message-delete]:hover {
    border-color: #fecaca;
    color: #b42318;
    background: #fff1f2;
}

.chat-message.deleted .chat-bubble {
    box-shadow: none;
    opacity: 0.82;
}

.chat-message.deleted [data-message-body] {
    color: var(--muted);
    font-style: italic;
}

.chat-message-editor {
    display: grid;
    gap: 7px;
    min-width: min(440px, 65vw);
}

.chat-edit-input {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    border: 1px solid #9aa9bc;
    border-radius: 7px;
    background: #ffffff;
}

.chat-edit-controls {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.chat-edit-controls .chat-edit-save {
    color: #ffffff;
    background: var(--primary, #00a982);
}

.chat-edit-controls button:disabled,
.chat-message-actions button:disabled {
    cursor: wait;
    opacity: 0.55;
}

@media (hover: none) {
    .chat-message-actions {
        opacity: 1;
    }
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.chat-attachment-picker {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #334155;
    background: #ffffff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.chat-attachment-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.chat-attachment {
    display: flex;
    margin-top: 9px;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.chat-reply-reference {
    display: block;
    margin-bottom: 7px;
    padding: 6px 8px;
    border-left: 3px solid var(--brand, #00a982);
    color: #526176;
    background: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 700;
}

.chat-reply-preview {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-left: 3px solid var(--brand, #00a982);
    background: #f4f8fb;
    font-size: 12px;
    font-weight: 700;
}

.chat-reply-preview[hidden] {
    display: none;
}

.chat-reply-preview button {
    border: 0;
    background: transparent;
    cursor: pointer;
}


.chat-thread-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.chat-thread-controls label {
    display: grid;
    gap: 3px;
    min-width: 130px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.chat-thread-controls select {
    min-height: 36px;
    padding: 6px 28px 6px 8px;
}

.chat-search-form {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.chat-search-form input,
.chat-message-search {
    width: 100%;
    min-height: 38px;
}

.chat-search-form button {
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #334155;
    font-weight: 800;
}

.chat-message-search {
    border-width: 0 0 1px;
    border-radius: 0;
}

.conversation-tags {
    display: flex !important;
    gap: 5px;
    margin-top: 3px;
}

.conversation-tags b,
.chat-client-status {
    padding: 2px 6px;
    border-radius: 999px;
    color: #475569;
    background: #e7edf5;
    font-size: 10px;
}

.conversation-tags .priority-high,
.conversation-tags .priority-urgent {
    color: #9f1239;
    background: #ffe4e6;
}

.chat-presence {
    color: #64748b;
}

.chat-presence.online {
    color: #047857;
}

.chat-presence.typing {
    color: #2563eb;
}

.chat-notification-toggle {
    margin-left: auto;
    padding: 6px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.chat-notification-toggle.active {
    border-color: #86efac;
    color: #047857;
    background: #ecfdf5;
}

.chat-load-older {
    display: block;
    margin: 0 auto 14px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    background: #ffffff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.chat-audit {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.chat-audit summary {
    font-weight: 800;
    cursor: pointer;
}

.chat-audit p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 720px) {
    .conversations-panel {
        max-height: 310px;
    }

    .chat-thread-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .chat-thread-controls .btn,
    .chat-thread-controls label:last-of-type {
        grid-column: 1 / -1;
    }

    .chat-head {
        flex-wrap: wrap;
    }

    .chat-notification-toggle {
        margin-left: 0;
    }

    .chat-form {
        grid-template-columns: 1fr auto;
        position: sticky;
        bottom: 0;
        z-index: 3;
    }

    .chat-form textarea,
    .chat-reply-preview {
        grid-column: 1 / -1;
    }

    .chat-bubble {
        max-width: 92%;
    }
}

/* Support workspace: operations, previews and internal collaboration. */
.support-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.support-stats > div {
    border: 1px solid #dce5ee;
    background: #fff;
    padding: 13px 15px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.support-stats small { color: #64748b; font-weight: 700; }
.support-stats strong { font-size: 21px; color: #0f172a; }
.chat-search-form { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.chat-search-form > input:first-child { grid-column: 1 / -1; }
.chat-search-form select, .chat-search-form input[type="search"] { min-width: 0; }
.chat-search-form button { grid-column: 1; }
.chat-search-form > a { align-self: center; text-align: center; font-size: 12px; }
.chat-unread-filter { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.conversation-wait { color: #8a5a00 !important; font-weight: 700; }
.conversation-wait.breached { color: #c62828 !important; }
.chat-bubble > p { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.internal .chat-bubble { background: #fff8d9; border-color: #e9c95f; color: #3d330d; }
.chat-message.pinned .chat-bubble { box-shadow: inset 3px 0 0 #4f46e5; }
.chat-internal-label, .chat-pinned-label {
    display: inline-flex;
    margin-left: 7px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #765c00;
    background: #ffed9b;
}
.chat-pinned-label { color: #3730a3; background: #e0e7ff; }
.chat-internal-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.chat-attachment-wrap { display: block; margin-top: 8px; }
.chat-attachment-preview-link { display: block; margin-bottom: 6px; }
.chat-attachment-preview { display: block; width: min(320px, 100%); max-height: 220px; object-fit: cover; border: 1px solid #d7e0e8; border-radius: 6px; }
.chat-export-client { align-self: flex-end; margin: 0 16px 8px; }
.chat-retention-panel { margin-top: 14px; }
.chat-retention-panel summary { cursor: pointer; font-weight: 800; }
.chat-retention-panel form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
.chat-retention-panel label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; }
.chat-retention-panel input { width: 150px; }
@media (max-width: 980px) { .support-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .support-stats { grid-template-columns: 1fr; } .chat-search-form { grid-template-columns: 1fr; } .chat-search-form > * { grid-column: 1 !important; } }

/* 2026 premium workspace system */
:root {
    --pro-ink: #101828;
    --pro-muted: #667085;
    --pro-line: #e3e8ef;
    --pro-line-strong: #cfd8e5;
    --pro-canvas: #f4f7fb;
    --pro-panel: #ffffff;
    --pro-sidebar: #0b1324;
    --pro-sidebar-soft: #121e34;
    --pro-success: #00966d;
    --pro-danger: #d92d45;
    --pro-warning: #d97706;
    --pro-blue: #2563eb;
    --pro-shadow: 0 1px 2px rgba(16, 24, 40, .035), 0 8px 24px rgba(16, 24, 40, .045);
}

body.app-shell {
    background: var(--pro-canvas);
    color: var(--pro-ink);
    transition: grid-template-columns .2s ease;
}

body.app-shell::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    z-index: -1;
    height: 220px;
    background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(244,247,251,0));
    pointer-events: none;
}

.sidebar,
.client-app .sidebar {
    border-right: 1px solid rgba(255,255,255,.07);
    background: var(--pro-sidebar) !important;
    box-shadow: 10px 0 30px rgba(8, 15, 30, .05);
    transition: width .2s ease, padding .2s ease, transform .2s ease;
}

.sidebar .brand,
.client-app .sidebar .brand {
    margin-bottom: 4px;
    border-bottom-color: rgba(255,255,255,.08);
}

.side-nav a,
.side-nav summary,
.client-app .side-nav a {
    position: relative;
    overflow: hidden;
    min-height: 40px;
    border-radius: 6px !important;
    color: #aebbd0 !important;
}

.side-nav a::after,
.side-nav summary::before {
    content: "";
    position: absolute;
    inset: 8px auto 8px 0;
    width: 2px;
    border-radius: 2px;
    background: transparent;
}

.side-nav a.active::after,
.side-nav summary.active::before {
    background: var(--brand);
}

.side-nav a.active,
.side-nav summary.active,
.client-app .side-nav a.active {
    border-color: rgba(255,255,255,.06) !important;
    background: rgba(255,255,255,.075) !important;
    box-shadow: none !important;
}

.admin-topbar,
.client-topbar {
    min-height: 68px;
    border-bottom-color: rgba(207,216,229,.8);
    background: rgba(255,255,255,.88);
    box-shadow: 0 1px 0 rgba(16,24,40,.025), 0 8px 30px rgba(16,24,40,.025);
    backdrop-filter: blur(18px) saturate(1.2);
}

.experience-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
}

.experience-icon-button,
.experience-command-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pro-line);
    border-radius: 6px;
    background: #fff;
    color: #475467;
    cursor: pointer;
    font: inherit;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.experience-icon-button {
    width: 38px;
    padding: 0;
    font-size: 18px;
}

.experience-command-button {
    gap: 14px;
    padding: 0 10px 0 12px;
    font-size: 11px;
    font-weight: 750;
}

.experience-command-button kbd,
.command-dialog kbd {
    padding: 2px 6px;
    border: 1px solid #d8e0ea;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #f7f9fc;
    color: #7a8798;
    font: 9px/1.5 inherit;
}

.experience-icon-button:hover,
.experience-command-button:hover {
    border-color: #aebbc9;
    background: #f9fbfd;
    color: var(--pro-ink);
}

.admin-global-search {
    margin-right: auto;
}

.admin-global-search input,
input,
select,
textarea {
    min-height: 42px;
    border-color: var(--pro-line-strong);
    background: #fff;
}

textarea { min-height: 92px; }

.content,
.client-app .content {
    max-width: 1680px;
    margin-inline: auto;
    padding: 24px 26px 36px;
}

.page-head {
    min-height: 64px;
    padding-bottom: 4px;
}

.page-head h1 {
    font-size: clamp(23px, 2vw, 29px);
    font-weight: 780;
}

.panel,
.metric,
.summary-card,
.premium-metrics article,
.client-premium-hero,
.trade-watchlist,
.trade-chart-panel,
.trade-ticket,
.trade-desk-summary article {
    border-color: var(--pro-line) !important;
    box-shadow: var(--pro-shadow) !important;
}

.panel {
    padding: 20px;
}

.panel-head {
    padding-bottom: 2px;
}

.panel-head h2,
.panel h2 {
    font-weight: 780;
}

.metrics,
.premium-metrics,
.admin-dashboard-summary,
.finance-kpi-grid {
    gap: 12px;
}

.metric,
.premium-metrics article,
.finance-kpi-grid article,
.summary-card {
    position: relative;
    overflow: hidden;
}

.metric::after,
.premium-metrics article::after,
.finance-kpi-grid article::after,
.summary-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), transparent 72%);
    opacity: .55;
}

.client-premium-hero {
    position: relative;
    overflow: hidden;
    border-color: #22304a !important;
    background: linear-gradient(120deg, #0c172b 0%, #14233d 64%, #123347 100%) !important;
}

.client-premium-hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -110px 35%;
    height: 160px;
    border-top: 1px solid rgba(67,214,175,.28);
    transform: rotate(-6deg);
    pointer-events: none;
}

.client-premium-hero aside {
    position: relative;
    z-index: 1;
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.055);
    backdrop-filter: blur(10px);
}

.table-wrap {
    border-color: var(--pro-line);
    box-shadow: 0 1px 2px rgba(16,24,40,.025);
}

.table-wrap thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

th {
    height: 42px;
    background: #f7f9fc;
    color: #667085;
}

td {
    height: 48px;
    font-variant-numeric: tabular-nums;
}

tbody tr {
    transition: background .14s ease;
}

.btn {
    box-shadow: 0 1px 2px rgba(16,24,40,.08);
}

.btn:not(.secondary):not(.danger) {
    background: color-mix(in srgb, var(--brand) 88%, #063f38);
}

.status,
.balance-pill {
    border: 1px solid currentColor;
    background: color-mix(in srgb, currentColor 7%, #fff);
}

.alert {
    position: relative;
    padding-right: 44px;
    border-width: 1px;
    box-shadow: 0 8px 24px rgba(16,24,40,.05);
}

.alert [data-alert-close] {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: currentColor;
    font-size: 20px;
    transform: translateY(-50%);
    cursor: pointer;
}

.command-palette[hidden] { display: none; }
.command-palette { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: start center; padding-top: min(16vh, 140px); }
.command-palette-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(10,18,32,.58); backdrop-filter: blur(5px); cursor: default; }
.command-dialog { position: relative; width: min(620px, calc(100vw - 28px)); overflow: hidden; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; background: #fff; box-shadow: 0 28px 80px rgba(8,15,30,.28); animation: command-in .16s ease-out; }
.command-search { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; min-height: 62px; padding: 10px 14px; border-bottom: 1px solid var(--pro-line); }
.command-search > span { color: #667085; font-size: 24px; }
.command-search input { min-height: 40px; padding: 0; border: 0; box-shadow: none !important; font-size: 15px; }
.command-results { max-height: min(54vh, 470px); overflow-y: auto; padding: 8px; }
.command-results a { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; align-items: center; min-height: 52px; padding: 9px 12px; border-radius: 6px; color: var(--pro-ink); }
.command-results a strong { font-size: 13px; }
.command-results a small { color: #7b8797; font-size: 10px; }
.command-results a.active { background: color-mix(in srgb, var(--brand) 10%, #f7f9fc); color: color-mix(in srgb, var(--brand) 75%, #0f172a); }
.command-results > p { padding: 28px; color: var(--pro-muted); text-align: center; }
.command-dialog footer { display: flex; gap: 18px; padding: 9px 14px; border-top: 1px solid var(--pro-line); background: #f8fafc; color: #7b8797; font-size: 9px; }
@keyframes command-in { from { opacity: 0; transform: translateY(-10px) scale(.985); } }

.platform-toast-stack { position: fixed; z-index: 1200; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.platform-toast { padding: 13px 15px; border: 1px solid #b7dfd3; border-left: 3px solid var(--pro-success); border-radius: 6px; background: #fff; color: #24463c; box-shadow: 0 16px 40px rgba(16,24,40,.16); font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.platform-toast.visible { opacity: 1; transform: translateY(0); }
.platform-toast.error { border-color: #f2c3ca; border-left-color: var(--pro-danger); color: #7e2532; }

.sidebar-overlay { display: none; }

body.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { width: 76px; padding-inline: 10px; }
body.sidebar-collapsed .sidebar .brand { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .sidebar .brand img { max-width: 42px; object-fit: contain; object-position: left; }
body.sidebar-collapsed .admin-brand-copy,
body.sidebar-collapsed .client-brand-copy,
body.sidebar-collapsed .side-nav-label,
body.sidebar-collapsed .side-user span,
body.sidebar-collapsed .side-user small,
body.sidebar-collapsed .side-user > a:not(.user-badge),
body.sidebar-collapsed .side-nav a > span,
body.sidebar-collapsed .side-nav summary > span,
body.sidebar-collapsed .side-nav .nav-badge { display: none !important; }
body.sidebar-collapsed .side-nav { padding-right: 0; }
body.sidebar-collapsed .side-nav a,
body.sidebar-collapsed .side-nav summary { display: flex; width: 54px; align-items: center; justify-content: center; padding: 8px 4px; color: transparent !important; font-size: 0; }
body.sidebar-collapsed .side-nav a::before,
body.sidebar-collapsed .side-nav summary::after { content: attr(data-nav-short); position: static; display: block; width: auto; height: auto; background: transparent; color: #aebbd0; font-size: 10px; font-weight: 850; }
body.sidebar-collapsed .side-nav a.active::before,
body.sidebar-collapsed .side-nav summary.active::after { color: #fff; }
body.sidebar-collapsed .side-nav a.active::before { display: block !important; }
body.sidebar-collapsed .side-subnav { margin-left: 0; padding-left: 0; border-left: 0; }
body.sidebar-collapsed .side-user { align-items: center; }
body.sidebar-collapsed .side-user .user-badge { justify-content: center; padding: 0; }

body.ui-compact .content,
body.ui-compact .client-app .content { padding-top: 16px; }
body.ui-compact .panel { margin-bottom: 11px; padding: 14px; }
body.ui-compact .metric,
body.ui-compact .premium-metrics article,
body.ui-compact .summary-card { min-height: 76px; padding: 12px 14px; }
body.ui-compact td { height: 40px; padding-block: 8px; }
body.ui-compact th { height: 36px; padding-block: 8px; }
body.ui-compact .page-head { min-height: 52px; margin-bottom: 12px; }

@media (max-width: 1180px) {
    .experience-command-button span { display: none; }
    .experience-command-button { padding-inline: 8px; }
}

@media (max-width: 900px) {
    body.app-shell { display: block; }
    body.app-shell .sidebar,
    body.app-shell .client-app .sidebar {
        position: fixed;
        z-index: 80;
        inset: 0 auto 0 0;
        width: min(290px, 86vw);
        height: 100dvh;
        padding: 14px;
        transform: translateX(-105%);
    }
    body.mobile-nav-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; z-index: 70; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(8,15,30,.52); backdrop-filter: blur(2px); }
    body.mobile-nav-open .sidebar-overlay { display: block; }
    body.sidebar-collapsed .sidebar { width: min(290px, 86vw); padding: 14px; }
    body.sidebar-collapsed .admin-brand-copy,
    body.sidebar-collapsed .client-brand-copy,
    body.sidebar-collapsed .side-nav-label,
    body.sidebar-collapsed .side-user span,
    body.sidebar-collapsed .side-user small,
    body.sidebar-collapsed .side-user > a:not(.user-badge),
    body.sidebar-collapsed .side-nav a > span,
    body.sidebar-collapsed .side-nav summary > span,
    body.sidebar-collapsed .side-nav .nav-badge { display: initial !important; }
    body.sidebar-collapsed .side-nav a,
    body.sidebar-collapsed .side-nav summary { width: auto; justify-content: initial; padding: 9px 11px; color: #aebbd0 !important; font-size: 12px; }
    body.sidebar-collapsed .side-nav a::before,
    body.sidebar-collapsed .side-nav summary::after { display: none; }
    .admin-topbar,
    .client-topbar { padding-inline: 12px; }
    .experience-command-button { display: none; }
    .content,
    .client-app .content { padding: 18px 14px 30px; }
}

@media (max-width: 640px) {
    .experience-tools { gap: 5px; }
    .experience-icon-button { width: 36px; min-height: 36px; }
    .admin-global-search { display: none; }
    .topbar-actions { gap: 5px; }
    .topbar-link { width: 36px; min-height: 36px; justify-content: center; padding: 0; }
    .page-head { margin-bottom: 14px; }
    .page-head h1 { font-size: 22px; }
    .panel { padding: 14px; }
    .command-palette { padding-top: 8vh; }
}

/* Messaging workspace refinement */
.chat-layout {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    gap: 14px;
}

.chat-layout.single-chat {
    grid-template-columns: minmax(0, 1120px);
}

.conversations-panel,
.chat-panel {
    padding: 0;
    overflow: hidden;
    border-color: #dbe3ed;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(23, 32, 51, 0.06);
}

.conversations-panel {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
}

.conversation-panel-head {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e6ebf2;
}

.conversation-panel-head .eyebrow {
    margin-bottom: 1px;
    font-size: 10px;
}

.conversation-panel-head h2 {
    margin: 0;
    font-size: 17px;
}

.conversation-panel-head > span {
    display: grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #334155;
    font-size: 11px;
    font-weight: 800;
}

.chat-search-form {
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid #e6ebf2;
    background: #f8fafc;
}

.chat-search-form input {
    min-width: 0;
    border-color: #d7e0eb;
    background: #ffffff;
}

.chat-search-form button {
    padding-inline: 10px;
    color: #334155;
    border: 1px solid #d7e0eb;
    background: #ffffff;
}

.conversation-list {
    gap: 2px;
    padding: 7px;
}

.conversation-list a {
    min-height: 67px;
    padding: 9px 10px;
    border-radius: 7px;
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.conversation-list a:hover {
    transform: translateX(2px);
}

.conversation-list a.active {
    border-color: #a8d8cd;
    background: #edf9f6;
    box-shadow: inset 3px 0 0 var(--brand, #00a982);
}

.conversation-list .avatar {
    width: 38px;
    height: 38px;
}

.conversation-list strong {
    color: #172033;
    font-size: 13px;
}

.conversation-list small {
    font-size: 11px;
}

.conversation-list em {
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #ffffff;
    background: #e5484d;
    box-shadow: 0 3px 8px rgba(229, 72, 77, 0.24);
    font-size: 10px;
}

.conversation-tags b {
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 750;
}

.chat-head {
    min-height: 76px;
    gap: 11px;
    padding: 13px 16px;
    border-bottom: 1px solid #e6ebf2;
    background: #ffffff;
}

.chat-head h2 {
    margin-bottom: 1px;
    font-size: 16px;
}

.chat-head .muted {
    margin: 0;
    font-size: 11px;
}

.chat-presence {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
}

.chat-presence::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    content: "";
}

.chat-presence.online::before,
.chat-presence.typing::before {
    background: #12a579;
    box-shadow: 0 0 0 3px rgba(18, 165, 121, 0.12);
}

.chat-notification-toggle,
.chat-head .btn.small {
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 10px;
}

.chat-thread-controls {
    min-height: 58px;
    padding: 8px 12px;
    border-bottom-color: #e6ebf2;
    background: #f8fafc;
}

.chat-thread-controls label {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.chat-thread-controls select {
    min-height: 32px;
    max-width: 150px;
    border-color: #d7e0eb;
    background-color: #ffffff;
    font-size: 11px;
}

.chat-message-search {
    min-height: 39px;
    padding-inline: 16px;
    border: 0;
    border-bottom: 1px solid #e6ebf2;
    background: #ffffff;
    font-size: 12px;
}

.chat-thread {
    height: min(58vh, 580px);
    min-height: 420px;
    padding: 18px 20px;
    background: #f4f7fb;
    scrollbar-color: #bcc8d6 transparent;
    scrollbar-width: thin;
}

.chat-message {
    margin-bottom: 10px;
}

.chat-bubble {
    position: relative;
    max-width: min(590px, 76%);
    padding: 10px 12px 8px;
    border-color: #dce4ee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(23, 32, 51, 0.045);
}

.chat-message.mine .chat-bubble {
    border-color: #b8ddd4;
    background: #eaf7f3;
}

.chat-bubble strong {
    margin-bottom: 4px;
    color: #526176;
    font-size: 10px;
    text-transform: uppercase;
}

.chat-bubble p {
    color: #1f2937;
    font-size: 13px;
    line-height: 1.48;
}

.chat-message-meta {
    justify-content: flex-end;
    margin-top: 5px !important;
    font-size: 9px !important;
}

.chat-read-receipt.read {
    color: #087e62;
    font-weight: 800;
}

.chat-message-actions {
    position: absolute;
    top: -29px;
    right: 0;
    z-index: 2;
    padding: 2px;
    border: 1px solid #dbe3ed;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 7px 18px rgba(23, 32, 51, 0.1);
}

.chat-message.theirs .chat-message-actions {
    right: auto;
    left: 0;
}

.chat-message-actions button {
    min-height: 24px;
    padding: 2px 6px;
    font-size: 10px;
}

.chat-reply-reference {
    margin: 0 0 6px;
    padding: 5px 7px;
    border-left-width: 2px;
    border-radius: 3px;
    font-size: 10px;
}

.chat-attachment {
    margin-top: 7px;
    padding: 7px 9px;
    border-style: dashed;
    font-size: 11px;
}

.chat-load-older {
    margin-bottom: 18px;
    border-color: #d7e0eb;
    box-shadow: 0 4px 10px rgba(23, 32, 51, 0.04);
}

.chat-form {
    gap: 8px;
    padding: 11px 13px;
    border-top-color: #dfe6ef;
    background: #ffffff;
}

.chat-form textarea {
    min-height: 54px;
    max-height: 150px;
    padding: 10px 12px;
    resize: vertical;
    border-color: #cfd9e6;
    border-radius: 7px;
    background: #f9fbfd;
}

.chat-form textarea:focus {
    border-color: var(--brand, #00a982);
    background: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #00a982) 13%, transparent);
}

.chat-attachment-picker,
.chat-form > .btn {
    min-height: 40px;
    align-self: end;
}

.chat-attachment-picker {
    max-width: 150px;
    overflow: hidden;
    border-color: #d2dce8;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-audit {
    border-top-color: #e6ebf2;
    background: #fbfcfe;
}

@media (max-width: 980px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .conversations-panel {
        position: static;
        max-height: 330px;
    }
}

@media (max-width: 720px) {
    .chat-thread {
        height: 54vh;
        min-height: 350px;
        padding: 15px 12px;
    }

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

    .chat-message-actions {
        position: static;
        width: fit-content;
        margin-top: 5px;
        opacity: 1;
        box-shadow: none;
    }

    .chat-head .btn.small {
        display: none;
    }

    .chat-thread-controls {
        grid-template-columns: 1fr;
    }

    .chat-thread-controls .btn,
    .chat-thread-controls label:last-of-type {
        grid-column: auto;
    }
}

.chat-form textarea {
    min-height: 76px;
}

.empty-chat {
    display: grid;
    min-height: 180px;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}

/* Global professional polish */
body {
    font-family: "Segoe UI", Inter, Arial, Helvetica, sans-serif;
    color: #172033;
    background: var(--design-surface, #f3f6fb);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
strong {
    letter-spacing: 0;
}

h1 {
    font-weight: 700;
}

h2,
h3 {
    font-weight: 650;
}

p,
small,
span,
td,
th,
label,
input,
select,
textarea,
button,
a {
    letter-spacing: 0;
}

.muted {
    color: #6f7b8e;
    font-weight: 400;
}

.eyebrow {
    color: #00a87e;
    font-size: 11px;
    font-weight: 800;
}

.btn,
.mini,
.table-button,
button {
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn {
    min-height: 40px;
    border-radius: 7px;
    padding: 10px 16px;
    background: #00a87e;
    color: #04130f;
    font-size: 13px;
    font-weight: 750;
    box-shadow: 0 8px 18px rgba(0, 168, 126, 0.18);
}

.btn:hover {
    background: #00936f;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 168, 126, 0.22);
}

.btn.small {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
}

.btn.danger {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(229, 72, 77, 0.18);
}

.btn.danger:hover {
    background: #c92f35;
    box-shadow: 0 12px 24px rgba(229, 72, 77, 0.22);
}

.mini {
    min-height: 29px;
    border-radius: 6px;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.09);
}

.mini:hover,
.table-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(15, 23, 42, 0.13);
}

.mini.approve {
    background: #059669;
}

.mini.reject {
    background: #dc2626;
}

.kyc-document-gallery .mini.reject,
.inline-actions .mini.reject {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    box-shadow: none;
}

.kyc-document-gallery .mini.reject:hover,
.inline-actions .mini.reject:hover {
    background: #ffe4e6;
    border-color: #fda4af;
}

input,
select,
textarea {
    min-height: 41px;
    border-color: #dbe3ee;
    border-radius: 7px;
    padding: 9px 11px;
    color: #172033;
    font-size: 13px;
    background: #ffffff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

label {
    color: #596579;
    font-size: 13px;
    font-weight: 600;
}

.check-row {
    font-weight: 600;
}

.metric,
.panel,
.market-card,
.summary-card,
.auth-card {
    border-color: #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.panel {
    padding: 20px;
}

.panel h2 {
    color: #172033;
    font-size: 18px;
    font-weight: 650;
}

.page-head h1 {
    color: #111827;
    font-size: 30px;
    font-weight: 700;
}

.page-head p {
    color: #6f7b8e;
}

.metric {
    padding: 17px;
}

.metric span {
    color: #6f7b8e;
    font-size: 12px;
    font-weight: 600;
}

.metric strong {
    color: #111827;
    font-size: 24px;
    font-weight: 700;
}

table {
    font-size: 13px;
}

th {
    color: #667085;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

td {
    color: #243044;
    font-weight: 400;
}

th,
td {
    padding: 12px 10px;
    border-bottom-color: #e8edf4;
}

tbody tr {
    transition: background 0.16s ease;
}

tbody tr:hover {
    background: #f8fbff;
}

.balance-pill,
.status {
    min-height: 27px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 750;
}

.alert {
    border-radius: 7px;
    font-size: 13px;
    font-weight: 650;
}

.side-nav a {
    border-radius: 7px;
    font-size: 13px;
    font-weight: 650;
}

.side-user a,
.form-note a,
.panel-head a,
.table-action,
.kyc-files a,
.kyc-admin-links a {
    font-weight: 700;
}

.kyc-document-gallery figure,
.kyc-current-files,
.kyc-selfie-review,
.kyc-step-card,
.status-stat-card {
    border-radius: 8px;
    border-color: #e2e8f0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.kyc-document-gallery figcaption {
    font-size: 11px;
    font-weight: 750;
}

.notification-detail {
    display: grid;
    gap: 18px;
}

.notification-detail-head {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.notification-detail-head h2 {
    margin: 4px 0 8px;
}

.notification-field-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notification-detail-layout {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.notification-info-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 16px;
}

.notification-info-card.emphasis {
    background: #f8fbff;
    border-color: #bfdbfe;
}

.notification-info-card h3 {
    color: #0f172a;
    font-size: 20px;
    margin: 0;
}

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

.notification-field {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.notification-field.wide {
    grid-column: 1 / -1;
}

.notification-field span {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 750;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.notification-field strong {
    color: #0f172a;
    display: block;
    font-size: 13px;
    font-weight: 720;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.notification-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-actions .table-button {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    color: #0f3f74;
    font-weight: 750;
    box-shadow: none;
}

.notification-actions .table-button:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #0b315f;
}

.global-search-panel {
    margin-bottom: 18px;
}

.global-search-large {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.global-search-large label {
    display: grid;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.global-search-large input {
    min-height: 44px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    padding: 0 14px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
}

.global-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.search-result-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.search-result-card > a {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #e6edf6;
    border-radius: 8px;
    background: #fbfdff;
}

.search-result-card > a:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.search-result-card strong {
    color: #0f172a;
    font-size: 13px;
}

.search-result-card span {
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
}

.export-link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.export-link-grid a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #fbfdff;
    color: #0f3f74;
    font-size: 13px;
    font-weight: 850;
}

.export-link-grid a:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
    color: #0f766e;
}

.notification-message-preview {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    color: #172033;
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
    padding: 14px;
}

.email-log-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.email-log-summary article {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
}

.email-log-summary span {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.email-log-summary strong {
    color: #0f172a;
    display: block;
    font-size: 24px;
    margin-top: 5px;
}

.account-status-hero {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, .55fr) minmax(0, 1fr);
}

.account-status-hero span {
    color: #64748b;
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.account-status-hero strong {
    color: #0f172a;
    display: block;
    font-size: 36px;
    margin: 4px 0 10px;
}

.status-progress {
    background: #e2e8f0;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.status-progress i {
    background: #00b386;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.status-step-row {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-step-row span {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.status-step-row span.done {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.status-step-row span.todo {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.account-status-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 18px 0;
}

.status-card {
    display: grid;
    gap: 12px;
}

.status-card-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.status-card-head h2,
.status-card p {
    margin: 0;
}

.status-card p {
    color: #64748b;
    line-height: 1.5;
}

.status-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-metrics div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
}

.status-metrics span {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-metrics strong {
    color: #0f172a;
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.status-list,
.next-action-list,
.status-timeline {
    display: grid;
    gap: 10px;
}

.status-list div,
.status-timeline div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 11px;
}

.status-list strong {
    color: #0f172a;
    display: block;
    margin-top: 7px;
}

.next-action-list a {
    background: #eef6ff;
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    color: #0f3f74;
    font-weight: 800;
    padding: 12px;
}

.next-action-list a.important {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.status-timeline span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.status-timeline strong {
    color: #0f172a;
    display: block;
    margin-top: 4px;
}

.status-timeline p {
    color: #64748b;
    margin: 4px 0 0;
}

@media (max-width: 1040px) {
    .hero,
    .grid.two,
    .summary-grid.compact,
    .account-status-grid,
    .account-status-hero,
    .admin-workbench,
    .feature-band,
    .metrics,
    .account-summary,
    .market-strip,
    .market-hero,
    .upload-grid,
    .admin-user-layout,
    .admin-summary,
    .admin-dashboard-summary,
    .client-360-grid,
    .detail-grid,
    .form-grid,
    .logo-upload-grid,
    .status-stat-grid,
    .email-log-summary,
    .mini-activity-grid,
    .settings-grid,
    .settings-layout,
    .settings-overview,
    .settings-split,
    .onboarding-list,
    .payment-method-item,
    .payment-coordinate-grid,
    .payment-summary-grid,
    .chat-layout,
    .kyc-filter-bar,
    .kyc-step-grid,
    .kyc-upload-grid,
    .kyc-liveness-steps,
    .kyc-document-gallery,
    .liveness-gallery,
    .workbench-grid,
    .notification-detail-layout,
    .notification-field-grid,
    .finance-kpi-grid,
    .global-results-grid,
    .global-search-large,
    .admin-global-search,
    .export-link-grid,
    .client-premium-hero,
    .client-premium-grid,
    .client-premium-grid.lower,
    .portfolio-spec-hero,
    .portfolio-spec-grid,
    .terminal-head,
    .terminal-layout,
    .market-focus-price,
    .trading-workspace,
    .execution-metrics,
    .risk-strip,
    .chat-layout.single-chat {
        grid-template-columns: 1fr;
    }

    .premium-metrics,
    .compact-checklist,
    .market-chip-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

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

    .admin-topbar,
    .content {
        grid-column: 1;
    }

    .admin-topbar {
        padding: 12px 16px 0;
    }

    .settings-index {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-user {
        position: static;
        margin-top: 24px;
    }

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

    .admin-profile-card {
        position: static;
    }

    .conversations-panel {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .landing-nav,
    .page-head,
    .hero-actions,
    .settings-hero,
    .settings-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .notification-detail-head {
        align-items: stretch;
        flex-direction: column;
    }

    .landing-nav {
        padding: 18px 0;
        gap: 18px;
    }

    .landing-nav nav {
        width: 100%;
        justify-content: space-between;
    }

    .hero {
        margin-top: 28px;
    }

    .hero h1 {
        font-size: 46px;
    }

    .content {
        padding: 18px;
    }

    .side-nav {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px;
    }

    .summary-card {
        padding: 20px;
    }

    .onboarding-list {
        grid-template-columns: 1fr;
    }

    .chat-head,
    .chat-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .chat-head {
        flex-wrap: wrap;
    }

    .chat-head .btn {
        width: 100%;
        margin-left: 0;
    }

    .chat-form {
        display: grid;
    }

    .chat-thread {
        height: 460px;
    }

    .chat-bubble {
        max-width: 94%;
    }

    .bar-chart {
        gap: 10px;
        overflow-x: auto;
    }

    .bar-group {
        min-width: 58px;
    }

    .settings-index {
        grid-template-columns: 1fr;
    }

    .settings-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tab-switcher {
        width: 100%;
    }

    .tab-switcher label {
        flex: 1;
        text-align: center;
    }

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

    .client-premium-hero > div,
    .client-premium-hero > aside,
    .premium-metrics article,
    .premium-action-grid a,
    .portfolio-mini-list div,
    .premium-activity-list a,
    .market-chip-row a {
        padding: 12px;
    }

    .client-premium-hero h1 {
        font-size: 24px;
    }

    .client-premium-hero aside strong {
        font-size: 24px;
    }

    .premium-metrics,
    .premium-action-grid,
    .market-chip-row {
        gap: 8px;
    }

    .premium-metrics strong {
        font-size: 16px;
    }

    .compact-checklist {
        grid-template-columns: 1fr;
    }

    .portfolio-mini-list div,
    .premium-activity-list a {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .portfolio-mini-list small,
    .premium-activity-list em {
        grid-column: 1 / -1;
    }
}

/* Accusés de lecture de la messagerie */
.chat-bubble .chat-message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    color: #7b8799;
    line-height: 1.25;
}

.chat-message.theirs .chat-message-meta {
    justify-content: flex-start;
}

.chat-read-receipt {
    color: #7b8799;
    font-weight: 600;
}

.chat-read-receipt.read {
    color: #008f73;
}

/* Avatar utilisateur neutre, distinct de la couleur des actions */
.avatar.avatar-fallback {
    background: #e7edf6 !important;
    border: 1px solid #c7d2e3 !important;
    color: #334155 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.avatar.avatar-fallback:hover {
    background: #dce5f1 !important;
    border-color: #aebdd2 !important;
    color: #1e3a5f !important;
}

.trade-duration-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}

.trade-duration-field > label,
.trade-duration-field > small {
    display: block;
}

.trade-field-label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.trade-duration-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.trade-duration-modes label {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.trade-duration-modes input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.trade-duration-modes span {
    display: grid;
    place-items: center;
    min-height: 40px;
    padding: 7px 9px;
    border: 1px solid #d6e1ed;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.trade-duration-modes input:checked + span {
    border-color: #2563eb;
    background: #eaf2ff;
    color: #174b91;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.trade-duration-modes input:focus-visible + span {
    outline: 3px solid rgba(37, 99, 235, 0.15);
    outline-offset: 2px;
}

[data-duration-seconds-field][hidden] {
    display: none !important;
}

.trade-duration-field > label {
    margin-bottom: 6px;
}

.trade-duration-field > small {
    margin-top: 6px;
    color: var(--muted);
}

.trade-duration-input input {
    min-width: 0;
    border-radius: 6px 0 0 6px;
}

.trade-duration-input span {
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 6px 6px 0;
    background: #eef2f7;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 760px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body.app-shell {
        background: var(--design-surface, #f5f7fb);
    }

    .content,
    .markets-content {
        padding: 14px;
    }

    .page-head {
        gap: 10px;
        margin-bottom: 14px;
    }

    .page-head h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .page-head .balance-pill,
    .page-head .status {
        align-self: flex-start;
    }

    .dashboard-layout-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-layout-tools .btn {
        width: 100%;
    }

    .layout-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .layout-save-status {
        min-width: 0;
        text-align: left;
    }

    .dashboard-layout-actions {
        flex-wrap: wrap;
    }

    .panel {
        padding: 16px;
    }

    .sidebar {
        border-radius: 0 0 12px 12px;
        padding: 14px;
    }

    .sidebar .brand {
        min-height: 44px;
    }

    .side-nav {
        display: flex;
        gap: 8px;
        margin-top: 14px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .side-nav a {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 9px 11px;
        white-space: nowrap;
    }

    .side-user {
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        margin-top: 12px;
        padding-top: 12px;
    }

    label,
    input,
    select,
    textarea,
    button,
    .btn {
        font-size: 16px;
    }

    input,
    select,
    textarea {
        min-height: 46px;
    }

    textarea {
        line-height: 1.45;
    }

    .btn,
    button.btn {
        width: 100%;
        min-height: 46px;
    }

    .grid.two,
    .account-summary,
    .market-grid,
    .method-card-grid,
    .payment-coordinate-grid,
    .payment-summary-grid,
    .kyc-step-grid,
    .kyc-upload-grid,
    .kyc-liveness-steps,
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-height: 82px;
        padding: 16px;
    }

    .summary-card strong {
        font-size: 19px;
    }

    .method-card-grid {
        display: grid;
        gap: 10px;
    }

    .method-card,
    .selected-payment-panel,
    .payment-summary-box {
        border-radius: 8px;
        padding: 13px;
    }

    .selected-payment-head,
    .payment-summary-head {
        align-items: stretch;
        flex-direction: column;
    }

    .payment-coordinate-grid strong,
    .payment-summary-grid strong {
        overflow-wrap: anywhere;
    }

    .payment-barcode {
        justify-self: center;
        width: 100%;
    }

    .payment-barcode img {
        width: min(220px, 100%);
        margin: 0 auto;
    }

    .table-wrap {
        margin: 0 -4px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 560px;
    }

    th,
    td {
        padding: 10px 9px;
    }

    .kyc-verification-panel,
    .kyc-step-card {
        padding: 14px;
    }

    .kyc-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .kyc-camera-frame {
        min-height: auto;
        aspect-ratio: 3 / 4;
        border-radius: 10px;
    }

    .kyc-camera-frame video,
    .kyc-camera-frame img {
        min-height: 0;
        height: 100%;
        object-fit: cover;
    }

    .kyc-camera-placeholder {
        padding: 18px;
    }

    .kyc-camera-overlay {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 12px;
    }

    .kyc-camera-overlay strong {
        font-size: 15px;
    }

    .kyc-camera-overlay span {
        font-size: 12px;
    }

    .kyc-camera-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .kyc-camera-actions .btn {
        width: 100%;
    }

    .kyc-liveness-steps {
        gap: 8px;
    }

    .kyc-liveness-steps span {
        min-height: 36px;
        padding: 8px 10px;
    }

    .market-card,
    .order-card,
    .chart-panel {
        min-height: auto;
    }

    .chart-lines.large {
        min-height: 210px;
    }

    .market-item,
    .ticker-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .market-item .btn,
    .ticker-row .btn {
        grid-column: 1 / -1;
    }

    .chat-thread {
        height: min(58vh, 440px);
        padding: 14px;
    }

    .chat-form textarea {
        min-height: 54px;
    }
}

/* Client workspace refresh */
body.client-app {
    grid-template-columns: 232px minmax(0, 1fr);
    background: #f4f7fb;
    color: #172033;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.client-app .sidebar {
    width: 232px;
    padding: 18px 12px;
    border-right: 1px solid #1e293b;
    background: #101827;
    box-shadow: none;
}

.client-app .sidebar .brand {
    min-height: 54px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.client-app .sidebar .brand strong {
    color: #f8fafc;
    font-size: 15px;
    letter-spacing: 0;
}

.client-app .side-nav {
    display: grid;
    gap: 3px;
    padding-top: 14px;
}

.client-app .side-nav a {
    position: relative;
    min-height: 40px;
    padding: 10px 12px;
    border: 0;
    border-radius: 6px;
    color: #aebbd0;
    font-size: 13px;
    font-weight: 650;
}

.client-app .side-nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #ffffff;
}

.client-app .side-nav a.active {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: none;
}

.client-app .side-nav a.active::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #5eead4;
    content: "";
}

.client-app .side-user {
    margin: auto 0 0;
    padding: 14px 8px 0;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.client-app .side-user a,
.client-app .side-user small {
    color: #aebbd0;
}

.client-app .side-user strong {
    color: #f8fafc;
}

.client-app .nav-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid #101827;
    border-radius: 10px;
    background: #e11d48;
    color: #ffffff;
    font-size: 10px;
    line-height: 16px;
}

.client-app .content {
    grid-column: 2;
    width: auto;
    max-width: none;
    margin-left: 0;
    padding: 24px clamp(18px, 2.4vw, 38px) 40px;
}

.client-app h1,
.client-app h2,
.client-app h3,
.client-app strong {
    letter-spacing: 0;
}

.client-app h1 {
    font-size: 28px;
    line-height: 1.2;
}

.client-app h2 {
    font-size: 17px;
    line-height: 1.3;
}

.client-app .panel {
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

.client-app .client-premium-hero > div,
.client-app .client-premium-hero > aside,
.client-app .premium-metrics article {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

.client-app .client-premium-hero > aside {
    background: #172033;
}

.client-app .premium-metrics article {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 17px;
}

.client-app .premium-metrics article::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: #14b8a6;
    content: "";
}

.client-app .premium-metrics article:nth-child(2)::after { background: #2563eb; }
.client-app .premium-metrics article:nth-child(3)::after { background: #f59e0b; }
.client-app .premium-metrics article:nth-child(4)::after { background: #e11d48; }

.client-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 16px;
}

.client-chart-card {
    min-width: 0;
    padding: 18px;
}

.client-chart-card .panel-head {
    margin-bottom: 12px;
}

.client-chart-card .panel-head h2,
.client-chart-card .panel-head p {
    margin: 0;
}

.client-financial-chart {
    width: 100%;
    height: 275px;
}

.chart-legend-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

.chart-legend::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    content: "";
}

.chart-legend.deposits::before { background: #059669; }
.chart-legend.withdrawals::before { background: #e11d48; }

.chart-attribution,
.trade-chart-disclaimer {
    margin: -7px 2px 0;
    color: #8290a5;
    font-size: 11px;
    text-align: right;
}

.chart-attribution a,
.trade-chart-disclaimer a {
    color: #2563eb;
    font-weight: 700;
}

.client-app .trade-desk-page {
    gap: 16px;
}

.client-app .trade-desk-hero {
    border: 1px solid #dbe3ee;
    background: #ffffff;
    color: #172033;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

.client-app .trade-desk-hero h1,
.client-app .trade-desk-hero p {
    color: #172033;
}

.client-app .trade-desk-balance {
    border-left: 1px solid #dbe3ee;
}

.client-app .trade-desk-balance span,
.client-app .trade-desk-balance small {
    color: #64748b;
}

.client-app .trade-desk-shell {
    grid-template-columns: 238px minmax(500px, 1fr) 300px;
}

.client-app .trade-watchlist,
.client-app .trade-chart-panel,
.client-app .trade-ticket {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.client-app .trade-chart-panel {
    grid-template-rows: auto auto minmax(480px, 1fr) auto auto;
}

.client-app .trade-main-chart {
    min-height: 500px;
    background: #0b1220;
}

.client-app .trade-main-chart .candle-chart[data-professional="1"] {
    position: absolute;
    inset: 0;
}

.client-app .trade-main-chart:has(.candle-chart[data-professional="1"]) .trade-grid-lines,
.client-app .trade-main-chart:has(.candle-chart[data-professional="1"]) .volume-bars,
.client-app .trade-main-chart:has(.candle-chart[data-professional="1"]) .price-line {
    display: none;
}

.trade-chart-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
}

.trade-chart-loading[hidden] {
    display: none;
}

.client-app .trade-chart-disclaimer {
    margin: 0;
    padding: 8px 14px;
    border-top: 1px solid #e6edf5;
    background: #f8fafc;
}

.client-app .table-wrap,
.client-app table {
    border-radius: 6px;
}

.client-app table th {
    background: #f7f9fc;
    color: #526078;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.client-app table td {
    border-color: #edf1f6;
}

@media (max-width: 1380px) {
    .client-app .trade-desk-shell {
        grid-template-columns: 210px minmax(460px, 1fr) 280px;
    }
}

@media (max-width: 1180px) {
    .client-chart-grid,
    .client-app .trade-desk-shell {
        grid-template-columns: 1fr;
    }

    .client-app .trade-watch-scroll {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: 260px;
    }
}

@media (max-width: 760px) {
    body.client-app {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-app .sidebar {
        width: 100%;
    }

    .client-app .content {
        grid-column: 1;
        width: 100%;
        margin-left: 0;
        padding: 16px 12px 32px;
    }

    .client-app .trade-watch-scroll {
        grid-template-columns: 1fr;
    }

    .client-financial-chart {
        height: 235px;
    }

    .client-app .trade-chart-panel {
        grid-template-rows: auto auto minmax(390px, 1fr) auto auto;
    }

    .client-app .trade-main-chart {
        min-height: 390px;
    }
}

@media (max-width: 420px) {
    .content,
    .markets-content {
        padding: 10px;
    }

    .panel {
        padding: 13px;
    }

    .page-head h1 {
        font-size: 22px;
    }

    .brand strong {
        font-size: 14px;
    }

    .summary-card i {
        display: none;
    }

    .kyc-camera-frame {
        aspect-ratio: 9 / 13;
    }

    .payment-summary-grid div,
    .payment-coordinate-grid div {
        padding: 9px;
    }

    .method-card ul {
        grid-template-columns: 1fr;
    }

    .status-step-row,
    .status-metrics {
        grid-template-columns: 1fr;
    }
}

/* Theme system: strong visual application across admin and client */
body,
body.app-shell,
.app-shell {
    background: var(--design-surface, var(--soft)) !important;
}

.sidebar,
.admin-sidebar,
.design-preview-nav {
    background: var(--design-dark, var(--bg)) !important;
    border-color: color-mix(in srgb, var(--brand) 24%, #223049) !important;
}

.admin-topbar {
    background: linear-gradient(180deg, var(--design-surface, #eef2f7) 0%, color-mix(in srgb, var(--design-surface, #eef2f7) 90%, transparent) 74%, transparent 100%) !important;
}

.btn,
button.btn,
input[type="submit"],
.mini.approve,
.table-button,
.chat-head .btn,
.chat-form .btn,
.kyc-camera-actions .primary-action,
.market-item .btn,
.ticker-row .btn {
    border-color: var(--brand) !important;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%) !important;
    color: #03100c !important;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 24%, transparent) !important;
}

.btn:hover,
button.btn:hover,
.mini.approve:hover,
.table-button:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 86%, #000) 0%, var(--brand-2) 100%) !important;
    transform: translateY(-1px);
}

.btn.secondary,
.mini,
.period-switcher button.active,
.notification-filter-bar a.active,
.order-type-row button.active,
.spec-side-toggle label:has(input:checked),
.theme-card:has(input:checked),
.status.info,
.status.sent,
.status.admin,
.status.client {
    border-color: color-mix(in srgb, var(--brand) 36%, #dce3ee) !important;
    background: color-mix(in srgb, var(--brand) 14%, #ffffff) !important;
    color: color-mix(in srgb, var(--brand) 62%, #0f172a) !important;
}

.side-nav a.active,
.side-nav a:hover,
.settings-index a.active,
.settings-index a:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, #ffffff) 0%, var(--brand-2) 100%) !important;
    color: #03100c !important;
}

.brand span,
.avatar,
.balance-pill,
.status.approved,
.status-step-row span.done,
.status-progress i,
.price-line,
.spec-chart-toolbar button.active,
.notification-type-badge.success,
.notification-type-badge.info {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #03100c !important;
}

.panel,
.settings-card,
.status-card,
.status-stat-card,
.notification-detail,
.notification-info-card,
.client-message-item,
.payment-method-item,
.market-card,
.premium-progress-card,
.order-ticket-pro,
.market-focus-price div,
.execution-metrics div,
.spec-preview div {
    border-color: color-mix(in srgb, var(--brand) 18%, #dce3ee) !important;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--brand) 9%, transparent) !important;
}

.settings-card-head,
.panel-head,
.status-card-head,
.notification-detail-head,
.market-focus-panel,
.chat-form,
.client-message-item.admin,
.notification-item.unread {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 8%, #ffffff) 0%, #ffffff 100%) !important;
}

.alert,
.notification-message-preview,
.kyc-liveness-admin,
.kyc-current-files,
.status-step-row span.todo {
    border-color: color-mix(in srgb, var(--brand) 35%, #dce3ee) !important;
    background: color-mix(in srgb, var(--brand) 12%, #ffffff) !important;
    color: color-mix(in srgb, var(--brand) 55%, #172033) !important;
}

.alert.success,
.notification-item.success {
    border-color: var(--brand) !important;
    background: color-mix(in srgb, var(--brand) 16%, #ffffff) !important;
    color: color-mix(in srgb, var(--brand) 62%, #0f172a) !important;
}

.alert.error,
.notification-item.error,
.kyc-rejection-note,
.kyc-client-rejection {
    border-left: 5px solid var(--brand) !important;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 10%, transparent) !important;
}

.chat-message.mine .chat-bubble,
.client-message-item.client,
.notification-type-badge.deposit,
.notification-type-badge.withdrawal,
.notification-type-badge.kyc,
.notification-type-badge.user,
.notification-type-badge.client,
.notification-type-badge.message {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, #ffffff), color-mix(in srgb, var(--brand-2) 14%, #ffffff)) !important;
    border-color: color-mix(in srgb, var(--brand) 26%, #dce3ee) !important;
    color: #172033 !important;
}

.form-note a,
.panel-head a,
.table-action,
.permission-editor summary,
.side-user a,
.up,
.positive,
.eyebrow,
.notification-filter-bar a.active strong,
.notification-item strong,
.status-stat-card b {
    color: color-mix(in srgb, var(--brand) 74%, #0f172a) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent) !important;
    outline: none;
}

.permission-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.permission-matrix .check-row {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--brand) 18%, #dce3ee);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 750;
}

.permission-matrix.compact {
    grid-template-columns: 1fr;
    max-height: 260px;
    overflow: auto;
    padding-right: 4px;
}

.ticket-meta-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--brand) 16%, #dce3ee);
    border-radius: 8px;
    background: color-mix(in srgb, var(--brand) 6%, #fff);
}

.ticket-meta-bar label {
    margin: 0;
    font-size: 12px;
}

.client-crm-panel {
    margin-top: 18px;
}

.sensitive-password {
    min-height: 34px;
    max-width: 190px;
    padding: 8px 10px;
    font-size: 12px;
}

.inline-sensitive-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.business-action-row {
    text-decoration: none;
    color: inherit;
}

.business-action-row b {
    min-width: 38px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 14%, #fff);
    color: color-mix(in srgb, var(--brand) 72%, #0f172a);
}

.chart-risk-line {
    border-style: dashed !important;
    opacity: .95;
}

.chart-risk-line.sl {
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

.chart-risk-line.tp {
    border-color: #10b981 !important;
    color: #047857 !important;
}

.compact-check {
    min-width: 92px;
    margin: 0;
}

.position-cockpit-list {
    display: grid;
    gap: 12px;
}

.position-cockpit {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dbe7f3;
    border-left: 4px solid #10b981;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.position-cockpit.sell {
    border-left-color: #ef4444;
}

.position-cockpit-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.position-cockpit-main h3 {
    margin: 3px 0;
    font-size: 17px;
}

.position-cockpit-main h3 small {
    color: #64748b;
    font-size: 12px;
}

.position-cockpit-main p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.position-cockpit-main > strong {
    font-size: 20px;
    white-space: nowrap;
}

.position-market {
    color: var(--brand);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.position-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.position-metrics div {
    padding: 10px;
    border: 1px solid #e2eaf3;
    border-radius: 8px;
    background: #fff;
}

.position-metrics span,
.position-exit-plan span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.position-metrics strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 14px;
}

.position-exit-plan {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--brand) 8%, #fff);
}

.position-exit-plan strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    font-size: 13px;
}

.position-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.position-levels span {
    padding: 5px 7px;
    border-radius: 999px;
    background: #eef6ff;
    text-transform: none;
}

.position-levels .danger {
    color: #991b1b;
    background: #fee2e2;
}

.position-levels .success {
    color: #047857;
    background: #d1fae5;
}

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

@media (max-width: 760px) {
    .user-accordion-item summary {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .user-accordion-item summary .user-balance {
        grid-column: 2;
    }

    .user-accordion-details {
        grid-template-columns: 1fr;
    }

    .position-cockpit-main,
    .position-exit-plan {
        grid-template-columns: 1fr;
        display: grid;
    }

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

    .position-levels,
    .position-close-form {
        justify-content: stretch;
    }

    .position-close-form .btn {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .admin-sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
        padding: 12px;
    }

    .app-shell {
        display: block;
    }

    .admin-topbar {
        position: static;
        padding: 10px 12px;
    }

    .admin-global-search {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .side-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .side-dropdown,
    .side-subnav {
        grid-column: 1 / -1;
    }

    .ticket-meta-bar {
        grid-template-columns: 1fr;
    }

    .permission-matrix {
        grid-template-columns: 1fr;
    }

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

.table-wrap table {
        min-width: 760px;
    }
}

.trade-desk-page {
    display: grid;
    gap: 18px;
}

.text-success {
    color: #059669 !important;
}

.text-danger {
    color: #dc2626 !important;
}

.btn.full {
    width: 100%;
    justify-content: center;
}

.trade-desk-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: stretch;
    padding: 22px;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(22, 78, 99, .9)),
        #0f172a;
    color: #fff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
}

.trade-desk-hero h1 {
    margin: 4px 0 8px;
    color: #fff;
}

.trade-desk-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, .76);
}

.trade-desk-balance {
    display: grid;
    gap: 6px;
    align-content: center;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
}

.trade-desk-balance span,
.trade-desk-balance small {
    color: rgba(255, 255, 255, .68);
}

.trade-desk-balance strong {
    font-size: 30px;
    letter-spacing: 0;
}

.trade-desk-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.trade-desk-summary article {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

.trade-desk-summary span {
    color: #64748b;
    font-size: 13px;
}

.trade-desk-summary strong {
    color: #102033;
    font-size: 22px;
}

.trade-desk-shell {
    display: grid;
    grid-template-columns: 260px minmax(520px, 1fr) 320px;
    gap: 14px;
    align-items: stretch;
}

.trade-watchlist,
.trade-chart-panel,
.trade-ticket {
    border: 1px solid #d6e1ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .09);
}

.trade-watchlist,
.trade-ticket {
    overflow: hidden;
}

.trade-box-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e6edf5;
    background: #f8fafc;
}

.trade-box-head span,
.trade-chart-head span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.trade-box-head strong {
    display: block;
    margin-top: 3px;
    color: #102033;
}

.trade-watch-scroll {
    max-height: 640px;
    overflow: auto;
    padding: 8px;
}

.trade-market-tools {
    display: grid;
    gap: 7px;
    padding: 10px;
    border-bottom: 1px solid #e6edf5;
    background: #ffffff;
}

.trade-market-tools input,
.trade-market-tools select {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d6e1ed;
    border-radius: 6px;
    background: #f8fafc;
    color: #102033;
    font-size: 12px;
}

.trade-market-tools input:focus,
.trade-market-tools select:focus {
    border-color: #7aa7df;
    outline: 3px solid rgba(37, 99, 235, 0.10);
}

.trade-market-empty {
    margin: 12px 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.trade-market-row {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #102033;
    text-align: left;
    cursor: pointer;
}

.trade-market-row:hover,
.trade-market-row.active {
    border-color: #bcd4f6;
    background: #eef6ff;
}

.market-logo {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #2563eb);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.trade-market-row strong,
.trade-market-row small,
.trade-market-row em,
.trade-market-row b {
    display: block;
    font-style: normal;
}

.trade-market-row small {
    color: #64748b;
}

.trade-market-row em {
    color: #102033;
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.trade-market-row b.up,
.trade-price-box .up {
    color: #059669;
}

.trade-market-row b.down,
.trade-price-box .down {
    color: #dc2626;
}

.trade-chart-panel {
    display: grid;
    grid-template-rows: auto auto minmax(420px, 1fr) auto;
    overflow: hidden;
}

.trade-chart-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
}

.trade-chart-head h2 {
    margin: 4px 0;
    color: #102033;
    font-size: 22px;
}

.trade-chart-head p {
    margin: 0;
    color: #64748b;
}

.trade-price-box {
    display: grid;
    gap: 4px;
    align-content: center;
    justify-items: end;
}

.trade-price-box strong {
    color: #102033;
    font-size: 24px;
}

.trade-price-box small {
    font-weight: 900;
}

.trade-range-buttons {
    display: flex;
    gap: 6px;
    padding: 10px 18px;
    border-bottom: 1px solid #e6edf5;
}

.trade-range-buttons button {
    min-width: 42px;
    padding: 7px 10px;
    border: 1px solid #dbe5f0;
    border-radius: 7px;
    background: #fff;
    color: #475569;
    font-weight: 800;
    cursor: pointer;
}

.trade-range-buttons button.active,
.trade-range-buttons button:hover {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.trade-main-chart {
    position: relative;
    min-height: 500px;
    background: #fbfdff;
    overflow: hidden;
}

.trade-main-chart .candle-chart {
    inset: 36px 72px 84px 28px;
}

.trade-main-chart .volume-bars {
    right: 72px;
    bottom: 20px;
    left: 28px;
}

.trade-grid-lines {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(148, 163, 184, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px);
    background-size: 100% 20%, 12.5% 100%;
}

.trade-chart-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #e6edf5;
    background: #f8fafc;
}

.trade-chart-footer span {
    padding: 12px 16px;
    color: #64748b;
    font-size: 13px;
}

.trade-chart-footer strong {
    color: #102033;
}

.trade-ticket {
    align-self: start;
}

.trade-ticket form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.trade-ticket label {
    display: grid;
    gap: 7px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.trade-ticket select,
.trade-ticket input[type="number"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfd9e6;
    border-radius: 8px;
    background: #fff;
    color: #102033;
    font-weight: 800;
}

.trade-side-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.trade-side-switch label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #102033;
}

.trade-side-switch input {
    margin-right: 7px;
}

.trade-ticket-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.trade-ticket-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.trade-ticket-preview span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #e4ebf3;
    border-radius: 8px;
    background: #f8fafc;
}

.trade-ticket-preview small {
    color: #64748b;
    font-size: 12px;
}

.trade-ticket-preview strong {
    color: #102033;
    font-size: 15px;
}

.trade-positions-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
}

.trade-position-list,
.trade-activity-list {
    display: grid;
    gap: 12px;
}

.trade-position-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.3fr) repeat(4, minmax(100px, 1fr)) auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid #e3ebf5;
    border-radius: 8px;
    background: #fff;
}

.trade-position-row strong,
.trade-position-row b {
    color: #102033;
}

.trade-position-row span,
.trade-position-row small {
    display: block;
    color: #64748b;
}

.trade-activity-list > div:not(.panel-header) {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #edf2f7;
}

@media (max-width: 1240px) {
    .trade-desk-shell,
    .trade-positions-grid {
        grid-template-columns: 1fr;
    }

    .trade-watch-scroll {
        max-height: 280px;
    }
}

@media (max-width: 760px) {
    .trade-desk-hero,
    .trade-desk-summary,
    .trade-chart-footer,
    .trade-ticket-grid,
    .trade-ticket-preview,
    .trade-side-switch {
        grid-template-columns: 1fr;
    }

    .trade-chart-head {
        display: grid;
    }

    .trade-price-box {
        justify-items: start;
    }

    .trade-main-chart {
        min-height: 420px;
    }

    .trade-position-row {
        grid-template-columns: 1fr;
    }
}

/* Refined client order controls */
.client-app .trade-side-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.client-app .trade-side-option {
    position: relative;
    min-height: 58px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d7e0eb;
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
}

.client-app .trade-side-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.client-app .trade-side-option span {
    position: relative;
    display: grid;
    gap: 2px;
    width: 100%;
    min-height: 58px;
    align-content: center;
    padding: 8px 10px 8px 38px;
    color: #475569;
}

.client-app .trade-side-option span::before {
    position: absolute;
    top: 50%;
    left: 11px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    transform: translateY(-50%);
    border-radius: 50%;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.client-app .trade-side-option.buy span::before {
    background: #059669;
    content: "\2191";
}

.client-app .trade-side-option.sell span::before {
    background: #e11d48;
    content: "\2193";
}

.client-app .trade-side-option b {
    color: #172033;
    font-size: 13px;
}

.client-app .trade-side-option small {
    color: #7b8799;
    font-size: 10px;
    font-weight: 650;
}

.client-app .trade-side-option.buy:has(input:checked) {
    border-color: #059669;
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px #059669;
}

.client-app .trade-side-option.sell:has(input:checked) {
    border-color: #e11d48;
    background: #fff1f2;
    box-shadow: inset 0 0 0 1px #e11d48;
}

.client-app .trade-side-option.buy:has(input:checked) b { color: #047857; }
.client-app .trade-side-option.sell:has(input:checked) b { color: #be123c; }

.client-app .trade-risk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.client-app .trade-risk-field {
    position: relative;
    padding: 10px;
    border: 1px solid #dbe3ed;
    border-radius: 7px;
    background: #f8fafc;
}

.client-app .trade-risk-field.stop-loss { border-left: 3px solid #f59e0b; }
.client-app .trade-risk-field.take-profit { border-left: 3px solid #10b981; }

.client-app .trade-risk-field input {
    min-height: 38px;
    padding: 7px 8px;
    background: #ffffff;
}

.client-app .trade-risk-field small {
    color: #7b8799;
    font-size: 10px;
    font-weight: 650;
}

.client-app .position-duration {
    margin-top: 4px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 750;
}

@media (max-width: 480px) {
    .client-app .trade-side-switch,
    .client-app .trade-risk-grid {
        grid-template-columns: 1fr;
    }
}

/* Polished client navigation */
.client-app .sidebar {
    padding: 14px 10px 12px;
    background: #101827 !important;
    border-right-color: #233047 !important;
}

.client-app .sidebar .brand {
    display: flex;
    min-height: 58px;
    padding: 5px 7px 14px;
    gap: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.client-app .sidebar .brand > span,
.client-app .sidebar .brand > img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 7px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 22%, transparent);
}

.client-app .sidebar .brand > img.brand-logo-default {
    padding: 5px;
    border-color: rgba(255, 255, 255, .72);
    border-radius: 9px;
    background: #f8fafc;
    box-shadow: 0 7px 18px rgba(2, 6, 23, .28);
}

.client-brand-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
    align-content: center;
}

.client-app .client-brand-copy strong {
    overflow: hidden;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-app .client-brand-copy small {
    color: #7f91aa;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

.client-app .side-nav {
    margin-top: 10px;
    padding: 0 2px 10px 0;
    gap: 2px;
    scrollbar-color: rgba(148, 163, 184, .3) transparent;
}

.client-app .side-nav a {
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid transparent !important;
    border-radius: 6px;
    background: transparent !important;
    color: #aebbd0 !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    box-shadow: none !important;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.client-app .side-nav a:hover {
    border-color: rgba(148, 163, 184, .12) !important;
    background: rgba(255, 255, 255, .055) !important;
    color: #ffffff !important;
}

.client-app .side-nav a.active {
    border-color: color-mix(in srgb, var(--brand) 34%, transparent) !important;
    background: color-mix(in srgb, var(--brand) 15%, #101827) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 var(--brand) !important;
}

.client-app .side-nav a.active::before {
    display: none;
}

.client-app .nav-badge {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 0;
    background: #e11d48 !important;
    color: #ffffff !important;
    font-size: 10px;
    line-height: 19px;
    text-align: center;
}

.client-app .side-user {
    gap: 9px;
    margin-top: auto;
    padding: 12px 3px 0;
    border-top-color: rgba(148, 163, 184, .16);
}

.client-app .user-badge {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 2px;
}

.client-app .user-badge .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
}

.client-app .user-badge strong {
    color: #f8fafc;
    font-size: 12px;
}

.client-app .user-badge small {
    margin-top: 1px;
    color: #7f91aa;
    font-size: 10px;
}

.client-app .side-user > a:not(.user-badge) {
    min-height: 34px;
    border-color: rgba(148, 163, 184, .2);
    border-radius: 6px;
    background: rgba(255, 255, 255, .035);
    color: #8de1c9;
    font-size: 11px;
    box-shadow: none;
}

.client-app .side-user > a:not(.user-badge):hover {
    border-color: rgba(94, 234, 212, .35);
    background: rgba(94, 234, 212, .08);
    color: #ccfbf1;
}

@media (max-width: 900px) {
    .client-app .sidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: auto;
    }

    .client-app .side-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .client-app .side-user {
        margin-top: 8px;
    }
}

/* ExTrade Pro interface system */
:root {
    --ui-canvas: #f4f7fb;
    --ui-sidebar: #0b1426;
    --ui-sidebar-soft: #111d33;
    --ui-ink: #142033;
    --ui-muted: #68778d;
    --ui-line: #dce4ee;
    --ui-line-soft: #eaf0f6;
    --ui-white: #ffffff;
    --ui-blue: #2563eb;
    --ui-green: #059669;
    --ui-red: #dc2626;
    --ui-orange: #d97706;
    --ui-shadow: 0 8px 24px rgba(15, 23, 42, .055);
}

html {
    min-width: 320px;
    background: var(--ui-canvas);
}

body {
    color: var(--ui-ink);
    background: var(--ui-canvas);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
}

body.app-shell {
    grid-template-columns: 224px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    background: var(--ui-canvas) !important;
}

.app-shell > * {
    min-width: 0;
}

.sidebar,
.client-app .sidebar {
    width: 224px;
    padding: 16px 12px 12px;
    color: #fff;
    background: var(--ui-sidebar) !important;
    border-right: 1px solid #1e2b42 !important;
    box-shadow: none !important;
}

.sidebar .brand,
.client-app .sidebar .brand {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 10px;
    padding: 4px 7px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.sidebar .brand > img,
.client-app .sidebar .brand > img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

.admin-brand-copy,
.client-brand-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
    align-content: center;
}

.sidebar .admin-brand-copy strong,
.sidebar .client-brand-copy strong {
    overflow: hidden;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar .admin-brand-copy small,
.sidebar .client-brand-copy small {
    color: #8190a8;
    font-size: 10px;
    font-weight: 650;
}

.side-nav,
.client-app .side-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin-top: 10px;
    padding: 0 2px 12px 0;
}

.side-nav-label {
    display: block;
    margin: 13px 10px 5px;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.side-nav > .side-nav-label:first-child {
    margin-top: 5px;
}

.side-nav a,
.side-nav summary,
.client-app .side-nav a {
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid transparent !important;
    border-radius: 6px;
    background: transparent !important;
    color: #aebbd0 !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    box-shadow: none !important;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.side-nav a:hover,
.side-nav summary:hover,
.client-app .side-nav a:hover {
    border-color: rgba(148, 163, 184, .12) !important;
    background: rgba(255, 255, 255, .055) !important;
    color: #fff !important;
}

.side-nav a.active,
.side-nav summary.active,
.client-app .side-nav a.active {
    border-color: color-mix(in srgb, var(--brand) 30%, transparent) !important;
    background: color-mix(in srgb, var(--brand) 14%, var(--ui-sidebar)) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--brand) !important;
}

.side-nav a.active::before,
.side-nav summary.active::before {
    display: none !important;
}

.side-dropdown {
    gap: 2px;
}

.side-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.side-dropdown summary::-webkit-details-marker {
    display: none;
}

.side-dropdown summary::after {
    content: "+";
    color: #71829c;
    font-size: 15px;
    font-weight: 500;
}

.side-dropdown[open] summary::after {
    content: "−";
}

.side-subnav {
    margin: 2px 0 4px 10px;
    padding-left: 8px;
    border-left: 1px solid #263650;
}

.side-subnav a {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 11px;
}

.side-user,
.client-app .side-user {
    gap: 8px;
    margin-top: auto;
    padding: 12px 3px 0;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.side-user > a:not(.user-badge),
.client-app .side-user > a:not(.user-badge) {
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 6px;
    background: rgba(255, 255, 255, .035);
    color: #8de1c9;
    font-size: 11px;
    box-shadow: none;
}

.admin-topbar,
.client-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    grid-column: 2;
    grid-row: 1;
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 22px;
    border-bottom: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .035);
    backdrop-filter: blur(12px);
}

.admin-topbar + .content,
.client-topbar + .content {
    grid-column: 2;
    grid-row: 2;
    padding-top: 22px;
}

.admin-global-search {
    display: grid;
    width: min(620px, 58vw);
    max-width: 620px;
    grid-template-columns: minmax(190px, 1fr) auto;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.admin-global-search input {
    min-height: 40px;
    border-color: var(--ui-line);
    background: #f7f9fc;
}

.topbar-context {
    display: grid;
    gap: 1px;
}

.topbar-context span {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.topbar-context strong {
    color: var(--ui-ink);
    font-size: 14px;
}

.topbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.topbar-link {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--ui-line);
    border-radius: 6px;
    background: #fff;
    color: #526178;
    font-size: 11px;
    font-weight: 750;
}

.topbar-link:hover {
    border-color: #b9c6d8;
    color: var(--ui-ink);
}

.topbar-profile {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding-left: 4px;
}

.topbar-profile .avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
}

.topbar-profile > span {
    display: grid;
    min-width: 0;
}

.topbar-profile strong,
.topbar-profile small {
    overflow: hidden;
    max-width: 150px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-profile strong {
    color: var(--ui-ink);
    font-size: 11px;
}

.topbar-profile small {
    color: var(--ui-muted);
    font-size: 9px;
}

.nav-badge,
.client-app .nav-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #e11d48 !important;
    color: #fff !important;
    font-size: 9px;
    font-style: normal;
    line-height: 14px;
    text-align: center;
}

.content,
.client-app .content {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 22px;
}

.page-head {
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 18px;
}

.page-head h1 {
    color: var(--ui-ink);
    font-size: 26px;
    line-height: 1.18;
    letter-spacing: 0;
}

.page-head .eyebrow {
    margin: 0 0 4px;
    color: var(--brand) !important;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.muted,
.page-head .muted {
    color: var(--ui-muted);
}

.page-head .muted {
    margin: 5px 0 0;
    font-size: 12px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.btn {
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid var(--brand);
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: none;
    transition: transform .14s ease, filter .14s ease, border-color .14s ease;
}

.btn:hover {
    filter: brightness(.94);
}

.btn:active {
    transform: translateY(1px);
}

.btn.small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 11px;
}

.btn.secondary {
    border-color: #cfd9e6;
    background: #fff;
    color: #334155;
}

.btn.secondary:hover {
    border-color: #aebdce;
    background: #f8fafc;
    color: #172033;
}

.btn.danger {
    border-color: var(--ui-red);
    background: var(--ui-red);
    color: #fff;
}

.panel,
.metric,
.summary-card,
.premium-metrics article,
.client-premium-hero,
.trade-watchlist,
.trade-chart-panel,
.trade-ticket,
.trade-desk-summary article {
    border: 1px solid var(--ui-line) !important;
    border-radius: 8px !important;
    background: var(--ui-white);
    box-shadow: var(--ui-shadow) !important;
}

.panel {
    margin-bottom: 16px;
    padding: 18px;
}

.panel-head {
    gap: 14px;
    margin-bottom: 14px;
}

.panel h2,
.panel-head h2 {
    color: var(--ui-ink);
    font-size: 16px;
    line-height: 1.3;
}

.panel h3 {
    color: var(--ui-ink);
    font-size: 14px;
}

.metrics,
.premium-metrics,
.admin-dashboard-summary {
    gap: 12px;
    margin-bottom: 16px;
}

.metric,
.premium-metrics article,
.summary-card {
    min-height: 92px;
    padding: 16px;
}

.metric span,
.premium-metrics span,
.summary-card span {
    margin-bottom: 6px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
}

.metric strong,
.premium-metrics strong,
.summary-card strong {
    color: var(--ui-ink);
    font-size: 21px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.premium-metrics em,
.summary-card em {
    color: #8491a3;
    font-size: 10px;
    font-style: normal;
}

.summary-card i {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 7px;
    background: #eef4ff;
    color: var(--ui-blue);
    font-size: 12px;
}

.client-premium-hero {
    min-height: 0;
    padding: 20px;
    background: #101b30 !important;
    color: #fff;
}

.client-premium-hero h1 {
    margin: 2px 0 6px;
    color: #fff;
    font-size: 27px;
}

.client-premium-hero p {
    color: #a9b7ca;
}

.client-premium-hero aside {
    border-color: #31405a;
    border-radius: 7px;
    background: #16233a;
}

.client-premium-hero aside strong {
    font-variant-numeric: tabular-nums;
}

.client-premium-grid,
.client-chart-grid,
.client-premium-grid.lower {
    gap: 14px;
}

.premium-action-grid a,
.next-premium-action,
.compact-checklist a,
.market-chip-row a,
.detail-grid > div,
.settings-overview article {
    border-color: var(--ui-line-soft) !important;
    border-radius: 7px !important;
    background: #f8fafc !important;
    box-shadow: none !important;
}

input,
select,
textarea {
    border-color: #cfd9e6;
    border-radius: 6px;
    background: #fff;
    color: var(--ui-ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--brand) 72%, #8ea2bb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

label {
    color: #4d5d73;
    font-size: 12px;
}

.table-wrap {
    border: 1px solid var(--ui-line);
    border-radius: 7px;
    background: #fff;
    overflow: auto;
}

.table-wrap table {
    margin: 0;
}

table {
    font-size: 12px;
}

th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--ui-line);
    background: #f7f9fc;
    color: #68778d;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .035em;
}

td {
    padding: 12px;
    border-bottom-color: var(--ui-line-soft);
    color: #344258;
    vertical-align: middle;
}

tbody tr:hover td {
    background: #fafcff;
}

.status,
.balance-pill {
    min-height: 25px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.admin-tabs {
    position: sticky;
    top: 76px;
    z-index: 8;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--ui-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
    backdrop-filter: blur(8px);
}

.admin-tabs a {
    min-height: 34px;
    padding: 8px 11px;
    border-radius: 5px;
    color: #59687d;
    font-size: 11px;
    font-weight: 750;
}

.admin-tabs a:hover {
    background: #eef4fb;
    color: var(--ui-ink);
}

.user-accordion-item {
    border-color: var(--ui-line) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

.user-accordion-item summary {
    min-height: 58px;
    padding: 10px 12px;
    background: #fff;
}

.user-accordion-item[open] summary {
    border-bottom: 1px solid var(--ui-line);
    background: #f8fafc;
}

.user-accordion-details {
    background: #fff;
}

.trade-desk-page {
    gap: 14px;
}

.trade-desk-hero {
    padding: 18px;
    border-color: #25334b;
    background: #101b30;
    box-shadow: var(--ui-shadow);
}

.trade-desk-hero h1 {
    font-size: 26px;
}

.trade-desk-summary {
    gap: 10px;
}

.trade-desk-summary article {
    min-height: 88px;
    padding: 14px;
}

.trade-desk-shell {
    grid-template-columns: 224px minmax(450px, 1fr) 300px;
    gap: 12px;
}

.trade-box-head,
.trade-chart-head,
.trade-range-buttons,
.trade-chart-footer {
    border-color: var(--ui-line-soft);
}

.trade-box-head,
.trade-chart-footer {
    background: #f7f9fc;
}

.trade-main-chart {
    min-height: 480px;
}

.trade-position-row {
    border-color: var(--ui-line);
    border-radius: 7px;
    box-shadow: none;
}

.alert {
    border-radius: 7px;
    box-shadow: none;
}

@media (max-height: 820px) and (min-width: 901px) {
    .sidebar,
    .client-app .sidebar {
        padding-top: 10px;
    }

    .sidebar .brand,
    .client-app .sidebar .brand {
        min-height: 50px;
        padding-bottom: 10px;
    }

    .side-nav-label {
        margin-top: 9px;
        margin-bottom: 3px;
    }

    .side-nav a,
    .side-nav summary,
    .client-app .side-nav a {
        min-height: 34px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .side-user,
    .client-app .side-user {
        padding-top: 8px;
    }
}

@media (max-width: 1180px) and (min-width: 901px) {
    body.app-shell {
        grid-template-columns: 204px minmax(0, 1fr);
    }

    .sidebar,
    .client-app .sidebar {
        width: 204px;
    }

    .content,
    .client-app .content {
        padding: 18px;
    }

    .topbar-link span {
        display: none;
    }

    .trade-desk-shell {
        grid-template-columns: 200px minmax(420px, 1fr) 286px;
    }
}

@media (max-width: 900px) {
    body.app-shell {
        display: block;
    }

    .sidebar,
    .client-app .sidebar,
    .admin-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 12px;
    }

    .side-nav,
    .client-app .side-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .side-nav-label {
        grid-column: 1 / -1;
    }

    .side-dropdown,
    .side-subnav {
        grid-column: 1 / -1;
    }

    .side-user,
    .client-app .side-user {
        margin-top: 8px;
    }

    .admin-topbar,
    .client-topbar {
        position: sticky;
        top: 0;
        display: flex;
        width: 100%;
        min-height: 58px;
        padding: 8px 12px;
    }

    .admin-global-search {
        width: min(560px, 100%);
    }

    .admin-topbar + .content,
    .client-topbar + .content,
    .content,
    .client-app .content {
        padding: 18px;
    }

    .admin-tabs {
        top: 66px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .trade-desk-shell,
    .trade-positions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-topbar,
    .client-topbar {
        align-items: center;
        gap: 8px;
    }

    .admin-global-search {
        grid-template-columns: 1fr;
    }

    .admin-global-search .btn,
    .topbar-context,
    .topbar-profile > span,
    .topbar-link span {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .side-nav,
    .client-app .side-nav {
        grid-template-columns: 1fr;
    }

    .content,
    .client-app .content,
    .admin-topbar + .content,
    .client-topbar + .content {
        padding: 14px;
    }

    .page-head {
        align-items: stretch;
    }

    .page-head h1 {
        font-size: 23px;
    }

    .inline-actions {
        justify-content: flex-start;
    }

    .panel {
        padding: 14px;
    }

    .trade-main-chart {
        min-height: 390px;
    }
}

/* Keep the messaging workspace stable after global responsive rules. */
@media (max-width: 980px) {
    .chat-layout,
    .chat-layout.single-chat {
        grid-template-columns: 1fr;
    }

    .conversations-panel,
    .chat-panel {
        padding: 0;
    }
}

@media (max-width: 720px) {
    .chat-thread {
        height: 54vh;
        min-height: 350px;
        padding: 15px 12px;
    }

    .chat-form {
        grid-template-columns: 1fr auto;
        gap: 7px;
        padding: 10px;
    }

    .chat-form textarea,
    .chat-reply-preview {
        grid-column: 1 / -1;
    }

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