:root {
    --bg-dark: #0a0e27;
    --bg-panel: #1a1f3a;
    --bg-card: #252b48;
    --text-primary: #e8eaf6;
    --text-secondary: #9fa8da;
    --accent: #5c6bc0;
    --accent-hover: #7986cb;
    --border: #3f51b5;
    --call-bg: #1a3a3a;
    --put-bg: #3a1a1a;
    --call-itm: #00695c;
    --put-itm: #c62828;
    --strike-bg: #3949ab;
    --highlight: #42a5f5;
    --success: #66bb6a;
    --danger: #ef5350;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body.light-theme {
    --bg-dark: #f5f7fa;
    --bg-panel: #ffffff;
    --bg-card: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --border: #e0e6ed;
    --call-bg: #e8f5e9;
    --put-bg: #ffebee;
    --call-itm: #c8e6c9;
    --put-itm: #ffcdd2;
    --strike-bg: #e3f2fd;
    --highlight: #2196f3;
    --success: #4caf50;
    --danger: #f44336;
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-y: auto;
    /* Allow vertical scrolling */
}

/* Subscription Overlay */
.subscription-overlay {
    position: fixed;
    top: 60px;
    /* Below navbar */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.overlay-content {
    background: var(--bg-panel);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border);
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.overlay-features {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.feature-item {
    padding: 8px 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-subscribe-overlay {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-subscribe-overlay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.overlay-subtext {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-text-only {
    background: none;
    border: none;
    color: var(--text-secondary);
    margin-top: 20px;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
}

.btn-text-only:hover {
    color: white;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Allow growth */
}

/* Footer */
.app-footer {
    padding: 20px;
    text-align: center;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
    /* Push to bottom */
}

/* ===== Main Navigation Bar ===== */
.main-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 24px;
    min-height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
    white-space: nowrap;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-logo {
    height: 28px;
    width: 28px;
    object-fit: contain;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

/* Show/hide logos based on theme */
.logo-light {
    display: none;
}

body.light-theme .logo-dark {
    display: none;
}

body.light-theme .logo-light {
    display: inline-block;
}

/* Make dark mode logo bright and vibrant */
.logo-dark {
    filter: invert(1) hue-rotate(180deg) brightness(1.2) saturate(1.5);
}

/* Responsive logo sizing */
@media (min-width: 768px) {
    .brand-logo {
        height: 36px;
        width: 36px;
    }
}

@media (min-width: 1024px) {
    .brand-logo {
        height: 40px;
        width: 40px;
    }
}

.brand-name {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-tabs-container {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.nav-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none !important;
}

.nav-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
}

.nav-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Page Container */
.page {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0.8;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}

.header-bar h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Top Controls */
.top-controls {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.controls-row:last-child {
    margin-bottom: 0;
}

/* Inline Control Groups */
.control-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group-inline label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.control-group-inline select {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.9rem;
}

.control-group-inline input[type="range"] {
    width: 120px;
}

/* Metrics Inline */
.metrics-inline {
    display: flex;
    gap: 20px;
    margin-left: auto;
    font-size: 0.9rem;
}

.metrics-inline span {
    white-space: nowrap;
}

.metrics-inline strong {
    color: var(--text-primary);
    margin-left: 4px;
}

/* Strategy Section */
.strategy-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.strategy-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.legs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.leg-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
}

.leg-chip-type {
    font-weight: 600;
    color: var(--highlight);
}

.leg-chip-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.leg-chip-remove:hover {
    background: var(--danger);
    color: white;
}

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

/* Compact Buttons */
.btn-compact {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px var(--shadow);
    transition: all 0.2s ease;
}

.btn-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px var(--shadow);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-spinner {
    background: var(--bg-panel);
    padding: 40px 60px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
    border: 1px solid var(--border);
}

.loading-spinner p {
    margin: 20px 0 0 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-compact.primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-compact.secondary {
    background: var(--success);
    color: white;
}

.btn-compact.danger {
    background: var(--danger);
    color: white;
}

.input-compact {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.9rem;
    width: 200px;
}

/* Portfolio Section */
.portfolio-section {
    margin-top: 8px;
}

.portfolio-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.portfolio-toggle-btn:hover {
    background: var(--bg-panel);
    border-color: var(--accent);
}

#portfolio-toggle-icon {
    transition: transform 0.3s ease;
}

.portfolio-toggle-btn.expanded #portfolio-toggle-icon {
    transform: rotate(90deg);
}

.portfolio-count {
    color: var(--text-secondary);
    font-weight: normal;
}

.portfolio-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 12px;
}

.portfolio-content.expanded {
    max-height: 400px;
    overflow-y: auto;
}

.portfolio-content.collapsed {
    max-height: 0;
}

/* Portfolio Items */
.portfolio-item {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
}

.portfolio-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.portfolio-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    word-wrap: break-word;
    flex: 1;
    margin-right: 8px;
}

.portfolio-item-actions {
    display: flex;
    gap: 6px;
}

.portfolio-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.portfolio-btn:hover {
    background: var(--bg-panel);
    transform: scale(1.1);
}

.portfolio-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Theme Toggle */
.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px var(--shadow);
}

/* Status Indicator */
.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    /* overflow: hidden; Removed to allow scroll */
    background: var(--bg-dark);
}

/* Content Grid */
.content-grid {
    display: flex;
    flex-direction: column;
    /* Stack graph and chain vertically on mobile, or keep row? Keep row but wrap? */
    /* Let's keep row for now but allow height */
    gap: 20px;
    flex: 1;
    min-height: 0;
}

@media (min-width: 1200px) {
    .content-grid {
        flex-direction: row;
        align-items: flex-start;
        /* Align top */
    }

    .graph-section {
        flex: 2;
        /* Generalize graph width */
        min-width: 0;
        /* Allow shrinking */
    }

    .chain-section {
        flex: 1;
        /* Chain takes less space */
        min-width: 350px;
        /* Prevent crushing */
    }
}

.graph-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.chain-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Graph Container */
.graph-container {
    min-height: 500px;
    height: 500px;
    background: var(--bg-panel);
    border-radius: 0 !important;
    /* Force square corners - override any other styles */
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--shadow);
    padding: 12px;
    border: 1px solid var(--border);
    position: relative;
    /* Ensure Plotly positions correctly */
}

/* Force square corners on Plotly graph itself */
.graph-container>div,
.graph-container .plotly,
.graph-container .svg-container {
    border-radius: 0 !important;
}

/* Legs Table */
.dict-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--bg-panel);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.dict-table th {
    text-align: left;
    padding: 10px 15px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    /* Prevent wrapping */
}

.dict-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    white-space: nowrap;
    /* Prevent wrapping */
}

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

/* Leg Colors */
.leg-row-buy {
    background-color: rgba(16, 185, 129, 0.05);
    /* Very subtle green tint */
}

.leg-row-buy:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

.leg-row-sell {
    background-color: rgba(239, 68, 68, 0.05);
    /* Very subtle red tint */
}

.leg-row-sell:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.leg-action-buy {
    color: var(--success);
    font-weight: 600;
}

.leg-action-sell {
    color: var(--danger);
    font-weight: 600;
}

.save-strategy-section {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.save-strategy-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.save-strategy-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.save-strategy-btn {
    padding: 8px 16px !important;
}

.strategy-status-indicator {
    font-size: 0.85rem;
    color: var(--accent);
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-weight: 500;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-card);
}

.btn-icon.delete {
    color: var(--danger);
}

.btn-icon.edit {
    color: var(--accent);
}

/* Chain Controls */
.chain-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    align-items: center;
}

.chain-controls select {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Expiry Tabs - Horizontal Scrollable Date Picker */
.expiry-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-card);
}

.expiry-tabs::-webkit-scrollbar {
    height: 6px;
}

.expiry-tabs::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 3px;
}

.expiry-tabs::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.expiry-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.expiry-tab:hover {
    background: var(--bg-panel);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.expiry-tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chain-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Table Container */
.table-container {
    flex: 1;
    display: block;
    /* Fix flex issue with overflow */
    overflow-x: auto;
    /* Enable horizontal scroll */
    overflow-y: auto;
    /* Enable vertical scroll */
    max-height: 700px;
    /* Fixed height to show ~17 rows */
    background: var(--bg-panel);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    border: 1px solid var(--border);
    max-width: 100%;
    /* Ensure it doesn't overflow parent */
    width: 100%;
}

/* ATM Highlight */
.atm-row {
    background-color: rgba(59, 130, 246, 0.15) !important;
    /* Blue tint */
    border-left: 3px solid var(--accent);
    font-weight: 600;
}

.atm-row td {
    color: var(--text-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: right;
}

th,
td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-card);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    color: var(--text-secondary);
}

tr:hover {
    background: var(--bg-card);
}

.call-col {
    background: var(--call-bg);
}

.put-col {
    background: var(--put-bg);
}

.strike-col {
    background: var(--strike-bg);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.itm.call-col {
    background: var(--call-itm);
    font-weight: 600;
}

.itm.put-col {
    background: var(--put-itm);
    font-weight: 600;
}

td.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

td.clickable:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.highlight {
    font-weight: 600;
    color: var(--highlight);
}

/* Input Styles */
select,
input[type="range"],
input[type="number"],
input[type="text"] {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1);
}

input[type="range"] {
    padding: 0;
    height: 6px;
    background: var(--border);
    border: none;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Leg Edit Modal */
.leg-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.leg-edit-content {
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--border);
}

.leg-edit-content h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.leg-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leg-edit-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leg-edit-row label {
    min-width: 80px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.leg-edit-row select,
.leg-edit-row input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.9rem;
}

.leg-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* User Dropdown Menu */
.user-dropdown-container {
    position: relative;
    margin-left: 16px;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile-btn:hover {
    background: var(--bg-panel);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
}

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

.user-chevron {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.user-dropdown-container.active .user-chevron {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: slideDown 0.2s ease;
    overflow: hidden;
}

.user-dropdown-container.active .user-menu {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.user-menu-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.user-menu-email {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-items {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
}

.user-menu-item:hover {
    background: var(--bg-card);
    color: var(--accent);
}

.user-menu-item.logout {
    color: var(--danger);
    margin-top: 4px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
}

.user-menu-item.logout:hover {
    background: rgba(239, 83, 80, 0.1);
}

/* Utility Text Colors */
.text-green {
    color: var(--success) !important;
}

.text-red {
    color: var(--danger) !important;
}

.text-center {
    text-align: center !important;
}

/* Strategy Legs Table Specific Alignment */
#legs-table th,
#legs-table td {
    text-align: center !important;
}