/* Professional Trading Client Styles */
/* Modern, clean design with Inter font */

/* CSS property for animated gradient rotation */
@property --rotate {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

:root {
    /* Primary palette - softer, more professional */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;

    /* Status colors - softer versions */
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --error: #ef4444;
    --error-soft: rgba(239, 68, 68, 0.1);

    /* Neutral palette */
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Text colors */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-on-dark: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    /* Spacing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-brand img {
    height: 28px;
}

.brand-emoji {
    font-size: 2rem;
    line-height: 1;
}

.brand-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.navbar-spacer {
    flex: 1;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-org {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   MAIN CONTENT & GRID
   ============================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.column-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.column-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.card-title-sm {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.card-badges {
    display: flex;
    gap: 8px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

.badge-synthetic {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.badge-route {
    background: var(--border-light);
    color: var(--text-secondary);
}

.badge-bridge {
    background: rgba(0, 133, 192, 0.1);
    color: #0085c0;
}

.badge-count {
    background: var(--border-light);
    color: var(--text-secondary);
    min-width: 24px;
    justify-content: center;
}
/* ============================================
   TRADING CARD - PRICE DISPLAY
   ============================================ */
.card-trading {
    background: var(--surface);
}

.price-display {
    display: flex;
    padding: 0;
}

.price-side {
    flex: 1;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.price-side:hover {
    filter: brightness(1.05);
}

.price-sell {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 0 0 0 var(--radius);
}

.price-buy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 0 0 var(--radius) 0;
}

.price-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
}

.price-size {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.price-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 0 4px;
}

.spread-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.spread-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.spread-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================
   LEGS CARD
   ============================================ */
.legs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px 20px;
}

.leg-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.leg-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.leg-prices {
    display: flex;
    gap: 16px;
}

.leg-price {
    flex: 1;
}

.leg-price-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    display: block;
}

.leg-bid .leg-price-label {
    color: var(--error);
}

.leg-ask .leg-price-label {
    color: var(--success);
}

.leg-price-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   ROUTE CARD - EXECUTION TIMELINE
   ============================================ */
.card-route .card-header {
    border-bottom: none;
    padding-bottom: 8px;
}

.route-step {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    position: relative;
}

.route-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 28px;
    bottom: -12px;
    width: 2px;
    background: var(--border);
}

.route-step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.route-step-content {
    flex: 1;
    min-width: 0;
}

.route-step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.route-step-venue {
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.route-step-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.route-step-flow {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
}

.route-step-pair {
    font-size: 0.6875rem;
    background: var(--border-light);
    color: var(--text-secondary);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.route-step-pricing {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.route-step-pricing .loading {
    color: var(--text-muted);
    font-style: italic;
}

.route-step-pricing .na {
    color: var(--text-muted);
}

.route-hint {
    padding: 12px 20px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

.route-summary {
    display: none;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.summary-item .material-icons-outlined {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Venue colors for route steps */
.venue-monex { background: #1976d2; }
.venue-ripple { background: #0085c0; }
.venue-cypator { background: #6b4fbb; }
.venue-circle { background: #2775ca; }
.venue-internal { background: #5e676e; }

/* Dot colors match venue */
.route-step-dot.monex { background: #1976d2; }
.route-step-dot.ripple { background: #0085c0; }
.route-step-dot.cypator { background: #6b4fbb; }
.route-step-dot.circle { background: #2775ca; }
.route-step-dot.internal { background: #5e676e; }

/* ============================================
   FLOW NODE VISUALIZATION
   ============================================ */
.route-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 160px 20px; /* Extra bottom padding for payment states and transaction IDs */
    gap: 16px;
    min-height: 260px; /* Increased height to fit all content including transaction IDs */
}

/* Row containing all flow boxes and arrows */
.flow-boxes-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Default state - gray boxes (waiting for transaction) */
.flow-node-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background: #f1f5f9;
    min-width: 80px;
    text-align: center;
    position: relative;
    z-index: 1;
    filter: grayscale(100%);
    transition: background-color 0.3s ease, border-color 0.3s ease, filter 0.3s ease;
}

/* Default text colors - muted */
.flow-node-currency,
.flow-node-location {
    transition: color 0.3s ease;
}

.flow-node-currency {
    color: #94a3b8;
}

.flow-node-location {
    color: #94a3b8;
}

/* Flow animation - chasing light border effect (Ripple teal theme) */
.flow-node.animating .flow-node-box {
    border: 2px solid rgba(0, 133, 192, 0.3);
    overflow: hidden;
    background: white;
    filter: grayscale(0%);
}

.flow-node.animating .flow-node-currency {
    color: var(--text-primary);
}

.flow-node.animating .flow-node-location {
    color: var(--text-secondary);
}

/* Chasing light spans - top edge */
.flow-node.animating .border-light-1 {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0085c0);
    animation: chase-top 1s linear infinite;
}

@keyframes chase-top {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* Right edge */
.flow-node.animating .border-light-2 {
    position: absolute;
    top: -100%;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, #0085c0);
    animation: chase-right 1s linear infinite;
    animation-delay: 0.25s;
}

@keyframes chase-right {
    0% { top: -100%; }
    50%, 100% { top: 100%; }
}

/* Bottom edge */
.flow-node.animating .border-light-3 {
    position: absolute;
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(270deg, transparent, #0085c0);
    animation: chase-bottom 1s linear infinite;
    animation-delay: 0.5s;
}

@keyframes chase-bottom {
    0% { right: -100%; }
    50%, 100% { right: 100%; }
}

/* Left edge */
.flow-node.animating .border-light-4 {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(0deg, transparent, #0085c0);
    animation: chase-left 1s linear infinite;
    animation-delay: 0.75s;
}

@keyframes chase-left {
    0% { bottom: -100%; }
    50%, 100% { bottom: 100%; }
}

/* Completed state - solid green border */
.flow-node.completed .flow-node-box {
    border: 2px solid #10b981;
    background: white;
    filter: grayscale(0%);
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.3),
                0 0 15px rgba(16, 185, 129, 0.2);
}

.flow-node.completed .flow-node-currency {
    color: var(--text-primary);
}

.flow-node.completed .flow-node-location {
    color: var(--text-secondary);
}

/* Hide chasing lights when completed */
.flow-node.completed .border-light-1,
.flow-node.completed .border-light-2,
.flow-node.completed .border-light-3,
.flow-node.completed .border-light-4 {
    display: none;
}

/* Arrow states */
.flow-arrow.pending {
    color: #cbd5e1;
}

.flow-arrow.animating {
    color: #0085c0;
}

.flow-arrow.completed {
    color: #10b981;
}

@keyframes spin {
    0% {
        --rotate: 0deg;
    }
    100% {
        --rotate: 360deg;
    }
}



.flow-node-currency {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.flow-node-location {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    position: relative;
}

/* Transaction ID - positioned well below the boxes */
.transaction-id {
    position: absolute;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    color: transparent;
    background: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.3s ease, background 0.3s ease;
    cursor: default;
    z-index: 5;
}

.transaction-id.visible {
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
}

/* Payment states - positioned absolutely well below all boxes */
.payment-states {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 1;
    transition: opacity 1.5s ease-out;
    z-index: 10;
}

.payment-states.fade-out {
    opacity: 0;
}

/* Individual payment state */
.payment-state {
    color: transparent;
    transition: color 0.3s ease;
    line-height: 1.4;
}

/* Active state - professional, no animation */
.payment-state.active {
    color: #0085c0;
}

/* Done state - green checkmark feel */
.payment-state.done {
    color: #10b981;
}

/* Pending - hide all states */
.payment-states.pending .payment-state {
    color: transparent;
}

/* Animating - show states as they activate */
.payment-states.animating .payment-state.active {
    color: #0085c0;
}

.payment-states.animating .payment-state.done {
    color: #10b981;
}

/* Ripple bounding box for middle nodes */
.ripple-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    padding: 16px 20px;
    border: 2px solid #0085c0;
    border-radius: 12px;
    background: rgba(0, 133, 192, 0.03);
    position: relative;
}

.ripple-container::before {
    content: "Ripple";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #0085c0;
    letter-spacing: 0.5px;
}

/* Async wrapper - contains two horizontal rows stacked vertically */
.async-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 100px; /* Large gap to prevent payment states from overlapping with bottom row */
    padding: 20px 20px 160px 20px;
}

/* Async Grid Layout - CSS Grid for precise positioning */
.async-grid-wrapper {
    display: grid;
    grid-template-columns: auto auto auto auto auto;
    grid-template-rows: auto auto;
    gap: 40px;
    align-items: center;
    padding: 20px 20px 160px 20px;
}

/* Async mode alignment - Arrow 1 is ~88px higher than Arrow 2 due to grid row heights */
/* Transaction ID alignment */
.async-grid-arrow1 .transaction-id {
    top: 268px;
    left: 30%;
}
.async-grid-arrow2 .transaction-id {
    top: 180px;
    left: 70%;
}

/* Payment states alignment */
.async-grid-arrow1 .payment-states {
    top: 208px;
}
.async-grid-arrow2 .payment-states {
    top: 120px;
}

/* MXN node - top left (row 1, col 1) */
.async-grid-mxn {
    grid-row: 1;
    grid-column: 1;
    align-self: end;
}

/* Arrow 1 - top middle (row 1, col 2) */
.async-grid-arrow1 {
    grid-row: 1;
    grid-column: 2;
    align-self: end;
}

/* Ripple container - spans both rows in the middle (rows 1-2, col 3) */
.ripple-container.async-grid-ripple {
    grid-row: 1 / 3;
    grid-column: 3;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Arrow 2 - bottom right (row 2, col 4) */
.async-grid-arrow2 {
    grid-row: 2;
    grid-column: 4;
}

/* SGD node - bottom right (row 2, col 5) */
.async-grid-sgd {
    grid-row: 2;
    grid-column: 5;
}

/* Async row - horizontal layout for each row */
.async-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* Top row: align to left (MXN → RLKY) */
.async-row-top {
    justify-content: flex-start;
}

/* Bottom row: align to right with left margin (RMDE → SGD) */
.async-row-bottom {
    justify-content: flex-start;
    margin-left: 80px; /* Offset to align RMDE under RLKY */
}

/* Single-node Ripple container (for async mode) */
.ripple-container.ripple-single {
    padding: 12px 16px;
}

/* Async levels layout - two horizontal rows stacked vertically inside Ripple */
.ripple-container.async-levels {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Async vertical layout - nodes stacked vertically inside Ripple box */
.ripple-container.async-vertical {
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.async-level {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.async-level-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Parallel execution container (inside Ripple box) */
.parallel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px dashed #7c3aed;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.05);
    position: relative;
}

.parallel-container::before {
    content: "parallel";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parallel-branch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.parallel-node {
    border-style: solid;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.15);
}

.flow-arrow .material-icons-outlined {
    font-size: 1.25rem;
}

/* ============================================
   ORDER FORM CARD
   ============================================ */
.card-order {
    background: var(--surface);
}

.order-form {
    padding: 16px 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:hover {
    border-color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input-readonly {
    background: var(--bg);
    color: var(--text-secondary);
    cursor: not-allowed;
}

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

/* ============================================
   SIDE TOGGLE (BUY/SELL RADIO BUTTONS)
   ============================================ */
.side-toggle {
    display: flex;
    gap: 0;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
}

.side-toggle input[type="radio"] {
    display: none;
}

.side-btn {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    background: transparent;
}

.side-btn:hover {
    color: var(--text-primary);
}

input[type="radio"]#sideBuy:checked + .side-buy {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow);
}

input[type="radio"]#sideSell:checked + .side-sell {
    background: var(--error);
    color: white;
    box-shadow: var(--shadow);
}

/* ============================================
   INTERMEDIATE SELECTOR (RLUSD/XRPL)
   ============================================ */
.intermediate-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
}

.intermediate-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.intermediate-toggle {
    display: flex;
    gap: 0;
    background: var(--bg);
    border-radius: var(--radius-xs);
    padding: 2px;
}

.intermediate-toggle input[type="radio"] {
    display: none;
}

.int-btn {
    padding: 6px 12px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    background: transparent;
}

.int-btn:hover {
    color: var(--text-primary);
}

input[type="radio"]#intRlusd:checked + .int-rlusd {
    background: #0085c0;
    color: white;
    box-shadow: var(--shadow-sm);
}

input[type="radio"]#intXrp:checked + .int-xrp {
    background: #23292f;
    color: white;
    box-shadow: var(--shadow-sm);
}

input[type="radio"]#modeSeq:checked + .mode-seq {
    background: #059669;
    color: white;
    box-shadow: var(--shadow-sm);
}

input[type="radio"]#modeAsync:checked + .mode-async {
    background: #7c3aed;
    color: white;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.btn-submit {
    width: 100%;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    box-shadow: var(--shadow);
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* ============================================
   ORDER STATUS
   ============================================ */
.order-status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    font-weight: 500;
}

.order-status:empty {
    display: none;
}

.order-status.ok {
    background: var(--success-soft);
    color: var(--success);
}

.order-status.error {
    background: var(--error-soft);
    color: var(--error);
}

/* ============================================
   ORDERS TABLE CARD
   ============================================ */
.card-orders .card-header {
    padding: 12px 20px;
}

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

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.orders-table th,
.orders-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.orders-table th {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg);
}

.orders-table td {
    color: var(--text-primary);
}

.orders-table tbody tr:hover {
    background: var(--bg);
}

.orders-table tbody tr:last-child td {
    border-bottom: none;
}

/* Side cell colors */
.orders-table .side-buy {
    color: var(--success);
    font-weight: 600;
}

.orders-table .side-sell {
    color: var(--error);
    font-weight: 600;
}

.table-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Order group connectors */
.id-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.order-connector {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 2px;
}

.linked-order {
    background: var(--bg);
}

.linked-order td:first-child {
    padding-left: 16px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes price-flash {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.price-flash {
    animation: price-flash 0.2s ease-in-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .column-right {
        order: -1;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }

    .navbar-container {
        padding: 0 16px;
    }

    .user-info {
        display: none;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .price-value {
        font-size: 1.5rem;
    }
}
