* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0f172a;
    color: #e5e7eb;
}

.app-root {
    min-height: 100vh;
}

.app-header {
    height: 76px;
    background: #020617;
    border-bottom: 1px solid #1e293b;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
}

.header-brand h1 {
    margin: 0;
    font-size: 22px;
}

.header-brand p {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 13px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-nav-btn {
    width: auto;
    height: 42px;
    margin: 0;
    padding: 0 18px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.page-nav-btn:hover {
    background: #0f172a;
    color: #f8fafc;
}

.page-nav-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.page-view {
    display: none;
}

.page-view.active {
    display: block;
}

.app-shell {
    min-height: calc(100vh - 76px);
    display: flex;
}

.sidebar {
    width: 340px;
    background: #020617;
    border-right: 1px solid #1e293b;
    padding: 24px;
    flex-shrink: 0;
}

.panel {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
}

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

label {
    display: block;
    margin-bottom: 7px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
}

select,
input,
button {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
}

select,
input {
    background: #020617;
    color: #f8fafc;
    border: 1px solid #334155;
    padding: 0 12px;
    margin-bottom: 14px;
}

button {
    background: #2563eb;
    color: white;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    margin-top: 6px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.symbol-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.symbol-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    color: #cbd5e1;
}

.symbol-grid input {
    width: auto;
    height: auto;
    margin: 0;
}

.rules p {
    margin: 8px 0;
    color: #94a3b8;
    font-size: 14px;
}

.main {
    flex: 1;
    padding: 28px;
    min-width: 0;
}

.page-main {
    padding: 28px;
}

.topbar {
    margin-bottom: 24px;
}

.topbar h2 {
    margin: 0;
    font-size: 28px;
}

.topbar p {
    margin: 6px 0 0;
    color: #94a3b8;
}

.cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 18px;
}

.card span {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 10px;
}

.card strong {
    display: block;
    font-size: 24px;
    white-space: nowrap;
}

.tabs-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    overflow: hidden;
}

.tabs {
    display: flex;
    gap: 0;
    background: #020617;
    border-bottom: 1px solid #1f2937;
}

.tab-btn {
    width: auto;
    min-width: 140px;
    height: 48px;
    margin: 0;
    padding: 0 22px;
    border-radius: 0;
    background: transparent;
    color: #94a3b8;
    border-right: 1px solid #1f2937;
    font-size: 14px;
    font-weight: 700;
}

.tab-btn:hover {
    background: #0f172a;
    color: #e5e7eb;
}

.tab-btn.active {
    background: #111827;
    color: #f8fafc;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.table-head {
    padding: 18px 20px;
    border-bottom: 1px solid #1f2937;
}

.table-head h3 {
    margin: 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.trades-table {
    min-width: 1640px;
}

.strategies-table {
    min-width: 1600px;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid #1f2937;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    background: #020617;
    font-weight: 700;
}

.strategies-table td {
    white-space: normal;
    line-height: 1.35;
}

.strategies-table th {
    white-space: nowrap;
}

.trades-table th:nth-child(1),
.trades-table td:nth-child(1) {
    width: 90px;
}

.trades-table th:nth-child(2),
.trades-table td:nth-child(2),
.trades-table th:nth-child(3),
.trades-table td:nth-child(3) {
    width: 125px;
}

.trades-table th:nth-child(4),
.trades-table td:nth-child(4),
.trades-table th:nth-child(5),
.trades-table td:nth-child(5) {
    width: 105px;
}

.trades-table th:nth-child(6),
.trades-table td:nth-child(6) {
    width: 80px;
    text-align: right;
}

.trades-table th:nth-child(7),
.trades-table td:nth-child(7) {
    width: 125px;
    text-align: right;
}

.trades-table th:nth-child(8),
.trades-table td:nth-child(8),
.trades-table th:nth-child(9),
.trades-table td:nth-child(9),
.trades-table th:nth-child(10),
.trades-table td:nth-child(10),
.trades-table th:nth-child(11),
.trades-table td:nth-child(11),
.trades-table th:nth-child(12),
.trades-table td:nth-child(12) {
    width: 120px;
    text-align: right;
}

.trades-table th:nth-child(13),
.trades-table td:nth-child(13) {
    width: 110px;
}

.trades-table th:nth-child(14),
.trades-table td:nth-child(14) {
    width: 130px;
}

.strategies-table th:nth-child(1),
.strategies-table td:nth-child(1) {
    width: 55px;
    text-align: right;
}

.strategies-table th:nth-child(2),
.strategies-table td:nth-child(2) {
    width: 95px;
}

.strategies-table th:nth-child(3),
.strategies-table td:nth-child(3) {
    width: 220px;
    white-space: normal;
    line-height: 1.35;
}

.strategies-table th:nth-child(4),
.strategies-table td:nth-child(4) {
    width: 85px;
    text-align: right;
}

.strategies-table th:nth-child(5),
.strategies-table td:nth-child(5) {
    width: 90px;
    text-align: right;
}

.strategies-table th:nth-child(6),
.strategies-table td:nth-child(6),
.strategies-table th:nth-child(7),
.strategies-table td:nth-child(7),
.strategies-table th:nth-child(8),
.strategies-table td:nth-child(8) {
    width: 85px;
    text-align: right;
}

.strategies-table th:nth-child(9),
.strategies-table td:nth-child(9) {
    width: 105px;
    text-align: right;
}

.strategies-table th:nth-child(10),
.strategies-table td:nth-child(10) {
    width: 100px;
    text-align: right;
}

.strategies-table th:nth-child(11),
.strategies-table td:nth-child(11) {
    width: 95px;
    text-align: right;
}

.strategies-table th:nth-child(12),
.strategies-table td:nth-child(12) {
    width: 85px;
    text-align: right;
}

.strategies-table th:nth-child(13),
.strategies-table td:nth-child(13) {
    width: 95px;
    text-align: right;
}

.strategies-table th:nth-child(14),
.strategies-table td:nth-child(14),
.strategies-table th:nth-child(15),
.strategies-table td:nth-child(15),
.strategies-table th:nth-child(17),
.strategies-table td:nth-child(17) {
    width: 120px;
    text-align: right;
}

.strategies-table th:nth-child(16),
.strategies-table td:nth-child(16) {
    width: 90px;
    text-align: right;
}

.empty {
    text-align: center;
    color: #94a3b8;
    padding: 32px;
}

.badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.win {
    color: #22c55e;
}

.loss {
    color: #ef4444;
}

.badge.win {
    background: rgba(34, 197, 94, 0.15);
}

.badge.loss {
    background: rgba(239, 68, 68, 0.15);
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
}

.placeholder-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 22px;
}

.placeholder-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.placeholder-card p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .cards {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

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

@media (max-width: 900px) {
    .app-header {
        height: auto;
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-nav {
        width: 100%;
        overflow-x: auto;
    }

    .page-nav-btn {
        flex-shrink: 0;
    }

    .app-shell {
        min-height: auto;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

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

    .tab-btn {
        min-width: 120px;
    }
}