:root {
    color-scheme: dark;
    --bg: #090b10;
    --surface: #11151d;
    --surface-soft: #171c26;
    --border: #252c39;
    --text: #f5f7fb;
    --muted: #8f98a9;
    --primary: #f7a600;
    --primary-hover: #ffb627;
    --green: #23c98b;
    --red: #ff6473;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body.is-loading {
    overflow: hidden;
}

.page-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(9, 11, 16, 0.88);
}

.page-loading.is-visible {
    display: flex !important;
}

.page-loading[hidden] {
    display: none !important;
}

.page-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(360px, 100%);
    padding: 28px 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(17, 21, 29, 0.96);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.page-loading-card strong {
    font-size: 1.05rem;
}

.page-loading-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.page-loading-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(247, 166, 0, 0.18);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: page-loading-spin 0.8s linear infinite;
}

@keyframes page-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(247, 166, 0, 0.08), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    appearance: none;
    -webkit-appearance: none;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 4vw, 3.25rem);
    letter-spacing: -0.04em;
}

h2 {
    margin-bottom: 0;
    font-size: 1.35rem;
}

.muted,
.field-help {
    color: var(--muted);
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

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

.auth-card {
    width: min(100%, 430px);
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(17, 21, 29, 0.92);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
}

.brand-mark {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 26px;
    border-radius: 15px;
    background: var(--primary);
    color: #17120a;
    font-weight: 900;
    place-items: center;
}

.brand-mark-small {
    width: 34px;
    height: 34px;
    margin: 0;
    border-radius: 10px;
    font-size: 0.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
}

.stack,
.trade-form {
    display: grid;
    gap: 20px;
}

.stack {
    margin-top: 30px;
}

label > span {
    display: block;
    margin-bottom: 8px;
    color: #c9d0dc;
    font-size: 0.84rem;
    font-weight: 650;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: #0c1017;
    color: var(--text);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(247, 166, 0, 0.13);
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
}

.checkbox input {
    width: 17px;
    min-height: 17px;
    accent-color: var(--primary);
}

.checkbox span {
    margin: 0;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 750;
}

.button-primary {
    background: var(--primary);
    color: #19140a;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-large {
    min-height: 52px;
    margin-top: 4px;
}

.button-ghost {
    border: 1px solid var(--border);
    background: transparent;
    color: #cad1dc;
}

.button-ghost:hover {
    background: var(--surface-soft);
}

.button-danger {
    border: 1px solid rgba(255, 100, 115, 0.35);
    background: rgba(255, 100, 115, 0.1);
    color: var(--red);
}

.button-danger:hover {
    background: rgba(255, 100, 115, 0.18);
}

.button-success {
    border: 1px solid rgba(35, 201, 139, 0.35);
    background: rgba(35, 201, 139, 0.1);
    color: var(--green);
}

.button-success:hover {
    background: rgba(35, 201, 139, 0.18);
}

.button-small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.75rem;
}

.button.disabled {
    cursor: default;
    opacity: 0.4;
}

.button.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.button.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: page-loading-spin 0.7s linear infinite;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 250px;
    flex-direction: column;
    padding: 24px 18px;
    border-right: 1px solid var(--border);
    background: rgba(9, 11, 16, 0.92);
    backdrop-filter: blur(16px);
}

.sidebar .brand {
    padding: 4px 10px 26px;
}

.sidebar-menu {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.burger {
    display: none;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
}

.burger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 180ms ease, opacity 180ms ease;
}

.sidebar.open .burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidebar.open .burger span:nth-child(2) {
    opacity: 0;
}

.sidebar.open .burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.main-nav {
    display: grid;
    gap: 4px;
}

.main-nav a {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.main-nav a:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.main-nav a.active {
    background: rgba(247, 166, 0, 0.11);
    color: var(--primary);
}

.nav-icon {
    display: grid;
    width: 22px;
    font-size: 0.95rem;
    place-items: center;
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding: 16px 4px 0;
    border-top: 1px solid var(--border);
}

.sidebar-footer .demo-badge {
    justify-self: start;
}

.button-block {
    width: 100%;
}

.user-email {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-badge,
.status {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 750;
}

.demo-badge {
    background: rgba(247, 166, 0, 0.12);
    color: var(--primary);
}

.container {
    max-width: 1280px;
    margin: 0 auto 0 250px;
    padding: 52px 32px 80px;
}

.hero {
    margin-bottom: 36px;
}

.hero-with-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.date-filter {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.date-filter label {
    min-width: 145px;
}

.date-filter input,
.date-filter select {
    color-scheme: dark;
}

.date-filter select {
    min-width: 120px;
}

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

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

.balance-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1.1fr) minmax(300px, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.balance-primary {
    display: grid;
    min-height: 240px;
    align-content: center;
    gap: 16px;
    padding: 32px;
    border: 1px solid rgba(247, 166, 0, 0.25);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 85% 10%, rgba(247, 166, 0, 0.18), transparent 16rem),
        var(--surface);
}

.balance-primary span {
    color: var(--muted);
    font-size: 0.85rem;
}

.balance-primary strong {
    font-size: clamp(2rem, 4vw, 3.1rem);
    letter-spacing: -0.04em;
}

.balance-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.balance-details .stat-card {
    min-height: 0;
}

.balance-form-panel {
    max-width: 520px;
}

.balance-form-panel .field-help {
    margin: 0 0 18px;
}

.stat-card {
    display: grid;
    min-height: 120px;
    align-content: center;
    gap: 12px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 21, 29, 0.88);
}

.stat-card > span {
    color: var(--muted);
    font-size: 0.78rem;
}

.stat-card > strong {
    font-size: 1.45rem;
}

.panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 21, 29, 0.88);
}

.history-panel {
    overflow: visible;
}

.order-panel {
    max-width: 520px;
    overflow: visible;
}

.cleanup-panel {
    max-width: 680px;
}

.cleanup-content {
    display: grid;
    gap: 20px;
    padding: 24px;
}

.cleanup-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.cleanup-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--muted);
}

.cleanup-count strong {
    color: var(--red);
    font-size: 2rem;
}

.cleanup-form {
    display: grid;
    gap: 14px;
    max-width: 420px;
}

.settings-toggle {
    margin-bottom: 14px;
}

.settings-group {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.settings-group legend {
    padding: 0 8px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 750;
}

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

.settings-margin-hint {
    margin: 12px 0 0;
    font-size: 0.82rem;
}

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

.symbol-field > span {
    display: block;
    margin-bottom: 8px;
    color: #c9d0dc;
    font-size: 0.84rem;
    font-weight: 650;
}

.symbol-combobox {
    position: relative;
}

.symbol-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 20;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0f141d;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.symbol-option {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    padding: 0 14px;
    border: 0;
    border-bottom: 1px solid rgba(37, 44, 57, 0.7);
    cursor: pointer;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
}

.symbol-option.is-hidden {
    display: none !important;
}

.symbol-option:last-child {
    border-bottom: 0;
}

.symbol-option:hover,
.symbol-option.active,
.symbol-option.focused {
    background: rgba(247, 166, 0, 0.1);
    color: var(--primary);
}

.symbol-empty {
    padding: 16px 14px;
    color: var(--muted);
    font-size: 0.84rem;
}

.panel-heading {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.panel-heading .eyebrow {
    margin-bottom: 5px;
}

.panel-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.history-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    padding: 14px 16px 10px;
}

.history-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.history-title h2 {
    font-size: 1.15rem;
}

.history-count {
    display: inline-flex;
    min-width: 24px;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.history-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    margin-left: auto;
    gap: 8px;
}

.history-actions form {
    display: inline-flex;
    margin: 0;
}

.icon-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.icon-glyph {
    display: block;
    font-size: 1.15rem;
    line-height: 1;
}

.icon-button-primary {
    border-color: rgba(247, 166, 0, 0.55);
    background: var(--primary);
    color: #19140a;
}

.icon-button-primary:hover {
    background: var(--primary-hover);
}

.icon-button-success {
    border-color: rgba(35, 201, 139, 0.55);
    background: rgba(35, 201, 139, 0.2);
    color: var(--green);
}

.icon-button-success:hover {
    background: rgba(35, 201, 139, 0.32);
}

.icon-button:active {
    transform: scale(0.96);
}

.icon-button.is-loading,
.filter-chip.is-loading {
    pointer-events: none;
}

.icon-button.is-loading .icon-glyph {
    display: none;
}

.icon-button.is-loading::after,
.filter-chip.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: page-loading-spin 0.7s linear infinite;
}

.filter-chip.is-loading {
    gap: 8px;
    opacity: 0.8;
}

.history-filters {
    display: flex;
    gap: 6px;
    padding: 0 16px 12px;
    overflow-x: auto;
}

.filter-chip {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: #c9d0dc;
    font-size: 0.8rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.filter-chip:hover,
.filter-chip.active {
    border-color: var(--primary);
    color: #fff;
}

.filter-chip.active {
    background: rgba(247, 166, 0, 0.18);
}

.trade-form {
    padding: 24px;
}

.field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #c9d0dc;
    font-size: 0.84rem;
    font-weight: 650;
}

.mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #0c1017;
}

.mode-switch label {
    position: relative;
    cursor: pointer;
}

.mode-switch input {
    position: absolute;
    opacity: 0;
}

.mode-switch span {
    display: grid;
    min-height: 38px;
    margin: 0;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    place-items: center;
}

.mode-switch input:checked + span {
    background: rgba(247, 166, 0, 0.12);
    color: var(--primary);
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card > span {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #0c1017;
}

.radio-card small {
    opacity: 0.7;
}

.radio-buy input:checked + span {
    border-color: var(--green);
    background: rgba(35, 201, 139, 0.09);
    color: var(--green);
}

.radio-sell input:checked + span {
    border-color: var(--red);
    background: rgba(255, 100, 115, 0.09);
    color: var(--red);
}

.field-help {
    display: block;
    margin-top: 7px;
    font-size: 0.74rem;
    line-height: 1.5;
}

.input-suffix {
    position: relative;
}

.input-suffix input {
    padding-right: 70px;
}

.input-suffix strong {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--muted);
    font-size: 0.75rem;
    transform: translateY(-50%);
}

.hidden {
    display: none;
}

.alert {
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.alert ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.alert-error {
    border: 1px solid rgba(255, 100, 115, 0.26);
    background: rgba(255, 100, 115, 0.09);
    color: #ff9ca5;
}

.alert-success {
    margin-bottom: 22px;
    border: 1px solid rgba(35, 201, 139, 0.26);
    background: rgba(35, 201, 139, 0.09);
    color: #6ee7b7;
}

.alert-warning {
    margin-bottom: 22px;
    border: 1px solid rgba(247, 166, 0, 0.26);
    background: rgba(247, 166, 0, 0.09);
    color: var(--primary);
}

.counter {
    display: grid;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.78rem;
    place-items: center;
}

.empty-state {
    display: grid;
    min-height: 350px;
    padding: 30px;
    text-align: center;
    place-content: center;
}

.empty-state h3 {
    margin-bottom: 7px;
}

.empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--primary);
    font-size: 1.35rem;
    place-items: center;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th,
td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

td {
    font-size: 0.82rem;
}

td small {
    color: var(--muted);
}

.text-buy {
    color: var(--green);
}

.text-sell {
    color: var(--red);
}

.status-open {
    background: rgba(35, 201, 139, 0.1);
    color: var(--green);
}

.status-pending {
    background: rgba(247, 166, 0, 0.1);
    color: var(--primary);
}

.status-closed {
    background: rgba(143, 152, 169, 0.12);
    color: #bdc5d1;
}

.status-approved {
    background: rgba(35, 201, 139, 0.1);
    color: var(--green);
}

.status-accepted {
    background: rgba(35, 201, 139, 0.1);
    color: var(--green);
}

.status-rejected {
    background: rgba(255, 100, 115, 0.1);
    color: var(--red);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.table-access-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.table-actions select,
.table-access-form select {
    width: auto;
    min-width: 128px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.75rem;
}

.access-until {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.access-until.is-expired {
    color: var(--red);
}

.signal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 260px)) minmax(180px, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.signal-filter {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.signal-filter select {
    max-width: 220px;
}

.signal-reason {
    display: block;
    max-width: 260px;
    margin-top: 6px;
    white-space: normal;
}

.price-arrow {
    margin: 0 5px;
    color: var(--muted);
}

.trade-time {
    display: block;
}

.active-trades-table {
    table-layout: fixed;
}

.trade-timeframe {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.trade-summary-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.trade-summary-row:hover,
.trade-summary-row:focus {
    outline: none;
    background: rgba(247, 166, 0, 0.07);
}

.trade-dialog {
    width: min(620px, calc(100% - 28px));
    max-height: calc(100vh - 40px);
    padding: 0;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #11151d;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.trade-dialog::backdrop {
    background: rgba(3, 6, 11, 0.78);
    backdrop-filter: blur(4px);
}

.trade-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}

.trade-dialog-heading h3 {
    margin: 3px 0 0;
}

.dialog-close {
    display: grid;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    place-items: center;
}

.trade-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    background: var(--border);
}

.trade-details > div {
    padding: 16px 24px;
    background: #11151d;
}

.trade-details dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.72rem;
}

.trade-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    font-weight: 700;
}

.trade-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 18px;
    color: var(--muted);
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .sidebar {
        position: sticky;
        top: 0;
        bottom: auto;
        z-index: 40;
        width: auto;
        padding: 10px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar .brand {
        padding: 0;
    }

    .burger {
        display: flex;
    }

    .sidebar-menu {
        display: none;
    }

    .sidebar.open .sidebar-menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        padding: 14px 16px 18px;
        border-bottom: 1px solid var(--border);
        background: rgba(9, 11, 16, 0.97);
        backdrop-filter: blur(16px);
        box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);
    }

    .main-nav a {
        min-height: 46px;
    }

    .sidebar-footer {
        margin-top: 14px;
    }

    .container {
        margin-left: auto;
        padding: 16px 12px 40px;
    }

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

    .hero-with-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .balance-grid {
        grid-template-columns: 1fr;
    }

    .signal-summary {
        grid-template-columns: 1fr 1fr;
    }

    .signal-filter {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .signal-filter select {
        max-width: none;
    }
}

@media (max-width: 600px) {
    .auth-card {
        padding: 28px 22px;
    }

    .date-filter {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .date-filter label:nth-child(n+3),
    .date-filter .button {
        grid-column: 1 / -1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .signal-summary {
        grid-template-columns: 1fr;
    }

    .signal-filter {
        grid-column: auto;
    }

    .history-bar {
        padding: 10px 12px 8px;
    }

    .history-filters {
        padding: 0 12px 10px;
    }

    .history-panel .empty-state {
        min-height: 220px;
        padding: 24px 16px;
    }

    .history-panel th,
    .history-panel td {
        padding: 12px 10px;
        font-size: 0.88rem;
    }

    .history-panel .pair-quote,
    .history-panel .pnl-unit {
        display: none;
    }

    .panel-heading,
    .trade-form {
        padding-right: 18px;
        padding-left: 18px;
    }

    .trade-details {
        grid-template-columns: 1fr;
    }

    .trade-dialog-heading,
    .trade-details > div,
    .trade-dialog-actions {
        padding-right: 18px;
        padding-left: 18px;
    }

    .trade-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .trade-dialog-actions form,
    .trade-dialog-actions .button {
        width: 100%;
    }
}
