* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    background: #fff;
    color: #000;
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.trial-banner {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 0.35rem 1rem;
    font-size: 11px;
}

.trial-link {
    color: #fff;
    text-decoration: underline;
}

.reconnect-banner {
    background: #f5f5f5;
    color: #000;
    text-align: center;
    padding: 0.5rem 2rem;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #000;
}

.reconnect-banner a {
    color: #000;
    font-weight: 600;
}

.banner-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #000;
    padding: 0 0.25rem;
    line-height: 1;
}

.spot-banner {
    background: #f5f5f5;
    border-bottom: 1px solid #000;
    padding: 0.25rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 12px;
}

.spot-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spot-label {
    color: #666;
    font-weight: 500;
}

.spot-price {
    color: #000;
    font-weight: 600;
}

.spot-divider {
    color: #999;
}

.navbar {
    background: #fff;
    border-bottom: 2px solid #000;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    position: relative;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #000;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.nav-overlay.active {
    display: block;
}

.nav-brand a {
    color: #000;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.nav-brand .logo-x {
    color: #191970;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
}

.nav-links a:hover {
    color: #000;
}

.nav-links a.active {
    color: #000;
    font-weight: 600;
    text-decoration: underline;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 10px;
}

.broker-status-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border: 1px solid #000;
}

.broker-status-text.connected {
    color: #228B22;
    border-color: #228B22;
}

.broker-status-text.disconnected {
    color: #DC3545;
    border-color: #DC3545;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 13px;
}

.user-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.user-name {
    color: #000;
}

.user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #000;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #000;
    min-width: 140px;
    z-index: 100;
}

.user-dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #000;
    text-decoration: none;
    font-size: 12px;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header .page-title {
    margin-bottom: 0;
}

.algo-link {
    color: #000;
    text-decoration: underline;
    font-weight: 500;
}

.algo-link:hover {
    color: #666;
}

.algo-status-bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #000;
    font-size: 12px;
}

.status-item {
    color: #666;
}

.status-count {
    font-weight: 600;
    color: #000;
    margin-right: 0.25rem;
}

.row-closed {
    opacity: 0.7;
}

.row-closed td {
    color: #666;
}

.algo-info {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-row {
    padding: 0.5rem 0;
}

.info-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

.algo-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.last-update {
    font-size: 10px;
    color: #999;
    margin-top: 0.5rem;
}

.status-bar {
    display: flex;
    gap: 2rem;
    font-size: 11px;
    color: #666;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #000;
}

.status-bar strong {
    color: #000;
}

.status-bar strong.on {
    color: #000;
}

.status-bar strong.off {
    color: #999;
}

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 13px;
    border: 2px solid #000;
}

.alert-error {
    background: #fff;
    border-color: #DC3545;
    color: #DC3545;
}

.alert-success {
    background: #fff;
    border-color: #228B22;
    color: #228B22;
}

.alert-warning, .alert-info {
    background: #fff;
    border-color: #000;
    color: #000;
}

.section {
    margin-bottom: 2rem;
    width: 100%;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #000;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    background: #fff;
}

.filter-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select,
    .filter-group input[type="date"] {
        width: 100%;
    }
    
    .filter-actions {
        flex-direction: row;
        width: 100%;
    }
    
    .filter-actions button {
        flex: 1;
    }
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #000;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
}

.data-item {
    padding: 1rem;
    border: 1px solid #000;
}

.data-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.data-value {
    font-size: 16px;
    font-weight: 500;
}

.positive {
    color: #228B22;
    font-weight: 500;
}

.negative {
    color: #DC3545;
}

.status-good {
    color: #228B22;
}

.status-bad {
    color: #DC3545;
}

.status-neutral {
    color: #000;
}

.text-green {
    color: #228B22;
}

.text-red {
    color: #DC3545;
}

.text-navy {
    color: #191970;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    padding: 0.5rem 0.25rem;
    border-bottom: 2px solid #000;
    white-space: nowrap;
}

td {
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
    border-bottom: 1px solid #ccc;
}

td.empty {
    text-align: center;
    color: #666;
    padding: 2rem 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 11px;
    color: #000;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #000;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    background: #fff;
}

.form-group input:focus,
.form-select:focus {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
}

.btn:hover {
    background: #000;
    color: #fff;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
}

.btn-danger {
    border-color: #DC3545;
    color: #DC3545;
}

.btn-danger:hover {
    background: #DC3545;
    color: #fff;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 10px;
}

.btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 10px;
}

.login-form {
    display: flex;
    gap: 1rem;
    max-width: 300px;
}

.login-form input {
    flex: 1;
    text-align: center;
    letter-spacing: 0.3em;
    font-size: 16px;
}

.code-block {
    background: #f5f5f5;
    padding: 1rem;
    font-size: 12px;
    overflow-x: auto;
    border: 1px solid #000;
}

.code-block pre {
    margin: 0;
}

.webhook-url {
    background: #f5f5f5;
    padding: 0.75rem 1rem;
    font-size: 11px;
    word-break: break-all;
    border: 1px solid #000;
}

.hint {
    color: #666;
    font-size: 11px;
    margin-top: 0.25rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ccc;
}

.status-row:last-child {
    border-bottom: none;
}

.status-label {
    color: #666;
    font-size: 12px;
}

.status-value {
    font-weight: 500;
    font-size: 12px;
}

.status-value.on {
    color: #000;
}

.status-value.off {
    color: #999;
}

.controls-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.landing-page {
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-container {
    text-align: center;
    max-width: 500px;
}

.landing-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.landing-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 3rem;
}

.landing-features {
    text-align: left;
    margin: 2rem 0;
}

.feature-item {
    padding: 1rem 0;
    border-bottom: 1px solid #000;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.feature-desc {
    color: #666;
    font-size: 13px;
}

.info-box {
    background: #f5f5f5;
    padding: 1rem;
    font-size: 13px;
    border: 1px solid #000;
}

.info-box a {
    color: #000;
}

.account-form {
    max-width: 500px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 12px;
}

.checkbox-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border: 2px solid #000;
    max-width: 350px;
    width: 100%;
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer {
    border-top: 2px solid #000;
    padding: 0.5rem 2rem;
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-link {
    color: #666;
    text-decoration: none;
}

.footer-link:hover {
    color: #000;
    text-decoration: underline;
}

.footer-made {
    font-size: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-flag {
    height: 12px;
    width: auto;
    vertical-align: middle;
}

.footer-legal {
    display: flex;
    gap: 1rem;
}

.footer-legal a {
    color: #666;
    text-decoration: none;
    font-size: 9px;
}

.footer-legal a:hover {
    color: #000;
    text-decoration: underline;
}

.footer-contact {
    font-size: 9px;
    color: #999;
    margin-top: 0.25rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.footer-contact a {
    color: #999;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
}

.footer-contact a:hover {
    color: #000;
    text-decoration: underline;
}

.broker-grid {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.broker-card {
    border: 1px solid #000;
    padding: 1.25rem;
    width: 200px;
}

.broker-card.connected {
    border-color: #228B22;
    border-width: 2px;
}

.broker-card.paper-card {
    background: #f5f5f5;
}

.broker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.broker-type {
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.broker-status {
    font-size: 9px;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border: 1px solid;
}

.broker-status.connected {
    color: #228B22;
    border-color: #228B22;
}

.broker-status.disconnected {
    color: #DC3545;
    border-color: #DC3545;
}

.broker-status.enabled {
    color: #228B22;
    border-color: #228B22;
}

.broker-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.broker-title {
    font-size: 14px;
    font-weight: 600;
}

.broker-desc {
    font-size: 11px;
    color: #666;
}

.broker-client {
    font-size: 12px;
    color: #000;
    font-weight: 500;
}

.totp-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.totp-form input {
    width: 70px;
    padding: 0.4rem;
    border: 1px solid #000;
    font-size: 12px;
    text-align: center;
    font-family: 'Fira Code', monospace;
}

.totp-form input:focus {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #000;
    color: #000;
}

.btn-outline:hover {
    background: #000;
    color: #fff;
}

.algo-state {
    font-size: 11px;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border: 1px solid;
    font-weight: 600;
}

.algo-state.idle {
    color: #666;
    border-color: #666;
}

.algo-state.armed {
    color: #000;
    border-color: #000;
}

.algo-state.live {
    color: #228B22;
    border-color: #228B22;
}

.algo-state.error {
    color: #DC3545;
    border-color: #DC3545;
}

.log-panel {
    background: #f5f5f5;
    border: 1px solid #000;
    padding: 1rem;
    font-size: 11px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
}

.log-entry {
    padding: 0.25rem 0;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 1rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #666;
    min-width: 80px;
}

.log-message {
    flex: 1;
}

.order-status {
    font-size: 10px;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border: 1px solid;
}

.order-status.sent {
    color: #666;
    border-color: #666;
}

.order-status.acknowledged {
    color: #000;
    border-color: #000;
}

.order-status.filled {
    color: #228B22;
    border-color: #228B22;
}

.order-status.rejected {
    color: #DC3545;
    border-color: #DC3545;
}

.signal-timestamp {
    font-size: 10px;
    color: #666;
    font-family: 'Fira Code', monospace;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #000;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: #666;
}

.tab:hover {
    color: #000;
}

.tab.active {
    color: #000;
    font-weight: 600;
    border-color: #000;
    background: #fff;
    margin-bottom: -2px;
    border-bottom: 2px solid #fff;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.card {
    border: 1px solid #000;
    padding: 1rem;
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 18px;
    font-weight: 600;
}

.debug-info {
    font-size: 10px;
    color: #999;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 48px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        border-bottom: 2px solid #000;
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links a {
        padding: 0.75rem 0;
        border-bottom: 1px solid #ccc;
        font-size: 14px;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .spot-banner {
        display: none;
    }
    
    .container {
        padding: 1rem;
    }
    
    .algo-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .broker-grid {
        flex-direction: column;
    }
    
    .broker-card {
        width: 100%;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
    
    .footer {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }
}

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ccc;
}

.filter-btn {
    padding: 0.25rem 0.5rem;
    font-size: 11px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    color: #666;
}

.filter-btn:hover {
    color: #000;
}

.filter-btn.active {
    color: #000;
    border-color: #000;
    font-weight: 600;
}

.mtm-value {
    font-weight: 600;
    font-family: 'Fira Code', monospace;
}

.mtm-value.positive {
    color: #228B22;
}

.mtm-value.negative {
    color: #DC3545;
}

.copy-btn {
    padding: 0.2rem 0.4rem;
    font-size: 10px;
    background: #f5f5f5;
    border: 1px solid #000;
    cursor: pointer;
    margin-left: 0.5rem;
}

.copy-btn:hover {
    background: #000;
    color: #fff;
}

.truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mono {
    font-family: 'Fira Code', monospace;
}

.text-muted {
    color: #666;
}

.text-small {
    font-size: 11px;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
