:root {
    --bg: #07111f;
    --panel: #0e1c30;
    --panel-2: #12253e;
    --line: #233b5a;
    --text: #e7eef9;
    --muted: #91a4bc;
    --green: #35d07f;
    --red: #ff667d;
    --yellow: #f6c85f;
    --blue: #55a8ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 22px max(20px, calc((100vw - 1400px) / 2));
    background: rgba(7, 17, 31, 0.95);
    position: sticky;
    top: 0;
    z-index: 5;
}

.eyebrow {
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

h1, h2, p {
    margin: 0;
}

h1 {
    font-size: 22px;
    margin-top: 4px;
}

h2 {
    font-size: 18px;
}

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

.connection-status {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--yellow);
    padding: 8px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.container {
    max-width: 1400px;
    margin: auto;
    padding: 24px 20px 50px;
}

.notice {
    background: rgba(85, 168, 255, 0.12);
    border: 1px solid rgba(85, 168, 255, 0.35);
    border-radius: 12px;
    color: #cce3ff;
    padding: 14px 16px;
    margin-bottom: 20px;
}

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

.card,
.market-card,
.table-card,
.terminal-card,
.event-card,
.empty-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.card {
    padding: 17px;
}

.card span {
    color: var(--muted);
    font-size: 12px;
    display: block;
    margin-bottom: 9px;
}

.card strong {
    font-size: 19px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin: 30px 0 12px;
}

.section-title p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 5px;
}

#lastUpdate {
    color: var(--muted);
    font-size: 12px;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
}

.market-card {
    padding: 17px;
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.market-symbol {
    font-size: 18px;
    font-weight: 700;
}

.market-price {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.market-row {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line);
    padding: 8px 0 0;
    margin-top: 8px;
}

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

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

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 13px 14px;
    font-size: 13px;
}

th {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.empty-row {
    color: var(--muted);
    text-align: center;
    padding: 28px;
}

.buy {
    color: var(--green);
    font-weight: 700;
}

.sell {
    color: var(--red);
    font-weight: 700;
}

.profit-plus {
    color: var(--green);
    font-weight: 700;
}

.profit-minus {
    color: var(--red);
    font-weight: 700;
}

.terminal-card,
.event-card,
.empty-card {
    padding: 18px;
    color: var(--muted);
}

.terminal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.terminal-item {
    border-left: 3px solid var(--blue);
    padding-left: 10px;
}

.terminal-item span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 5px;
}

.event-item {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.event-item:last-child {
    border-bottom: 0;
}

.event-time {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 4px;
}

.login-overlay {
    align-items: center;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 10;
}

.login-overlay.hidden {
    display: none;
}

.login-card {
    width: min(420px, calc(100vw - 36px));
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px;
}

.brand-icon {
    color: var(--green);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 14px;
}

.login-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 10px 0 22px;
}

.login-card label {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-bottom: 7px;
}

.login-card input {
    background: #07111f;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    padding: 12px;
    width: 100%;
}

.login-card button {
    background: var(--green);
    border: 0;
    border-radius: 8px;
    color: #04120b;
    cursor: pointer;
    font-weight: 800;
    margin-top: 14px;
    padding: 12px;
    width: 100%;
}

.login-error {
    color: var(--red);
    font-size: 12px;
    margin-top: 12px;
    min-height: 16px;
}

@media (max-width: 1100px) {
    .grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }
}

@media (max-width: 650px) {
    .topbar,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

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