/* Income Portfolio Monitor - Professional Financial Styling */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #dee2e6;
    --hover-bg: #f1f3f5;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --nav-height: 60px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.4;
    font-size: 13px;
    padding-top: var(--nav-height);
}

/* Compact Metrics Layout */
.compact-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    padding: 8px 0;
}

.compact-metric {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.compact-metric strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

.compact-metric .positive {
    color: var(--success-color);
}

.compact-metric .negative {
    color: var(--danger-color);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px;
}

/* Navigation Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-brand a {
    color: white;
    text-decoration: none;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
    flex-wrap: nowrap;
}

.nav-alert-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 110px;
}

.market-clock {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
    text-align: center;
}

.market-clock[data-state='open'] {
    color: #4caf50;
}

.market-clock[data-state='closed'] {
    color: rgba(255, 255, 255, 0.8);
}

.live-data-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.7rem;
}

.live-data-heartbeat {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-data-banner {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 3px solid;
    background: rgba(0, 0, 0, 0.25);
}

.live-data-banner.info {
    border-color: #4da3ff;
}

.live-data-banner.error {
    border-color: #ff6b6b;
}

.live-data-banner.success {
    border-color: #4caf50;
}

.live-chip-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.live-chip {
    position: relative;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    min-width: 145px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.08);
    cursor: default;
    font-size: 0.68rem;
}

.live-chip:focus,
.live-chip:focus-within {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.live-chip-good {
    border-color: #4da3ff;
}

.live-chip-warning {
    border-color: #f7d96d;
}

.live-chip-danger {
    border-color: #ff6b6b;
}

.live-chip-top,
.live-chip-middle,
.live-chip-provider {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.live-chip-label {
    font-weight: 600;
    font-size: 0.75rem;
}

.live-chip-age {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
}

.live-chip-pct {
    font-weight: 700;
    font-size: 0.85rem;
}

.live-chip-pct.live-chip-good {
    color: #4da3ff;
}

.live-chip-pct.live-chip-warning {
    color: #f7d96d;
}

.live-chip-pct.live-chip-danger {
    color: #ff6b6b;
}

.live-chip-count {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.75);
}

.live-chip-provider {
    margin-top: 2px;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.live-provider-select {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.85);
}

.live-provider-select select {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    color: inherit;
    font-size: 0.65rem;
    padding: 1px 6px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.live-provider-select select.pending {
    opacity: 0.6;
    cursor: wait;
}

.live-chip-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    width: 220px;
    font-size: 0.65rem;
    line-height: 1.3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 50;
}

.live-chip:hover .live-chip-tooltip,
.live-chip:focus .live-chip-tooltip,
.live-chip:focus-within .live-chip-tooltip {
    opacity: 1;
    pointer-events: auto;
}

.live-tooltip-error {
    color: #ffb4a2;
}

.live-data-empty {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1100px) {
    .live-data-status {
        flex-wrap: wrap;
    }
    .live-chip-list {
        flex-wrap: wrap;
    }
    .live-chip {
        min-width: 135px;
    }
    .nav-alert-wrapper {
        min-width: 0;
        align-items: flex-start;
    }
    .market-clock {
        text-align: left;
    }
}

.nav-alert {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    outline: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-alert:hover,
.nav-alert:focus {
    background: rgba(255, 255, 255, 0.2);
}

.nav-alert.active {
    background: rgba(255, 255, 255, 0.22);
    color: #ffca28;
}

.nav-alert-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.alert-dot,
.alert-count {
    position: absolute;
    border-radius: 50%;
    background: #ff7043;
    color: #fff;
    font-size: 0.65rem;
    line-height: 1;
}

.alert-dot {
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
}

.alert-count {
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item.dropdown .dropdown-toggle::after {
    content: '\25BE';
    font-size: 0.7rem;
}

.nav-item.dropdown .dropdown-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.nav-item.dropdown .dropdown-toggle:hover,
.nav-item.dropdown .dropdown-toggle:focus {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

.nav-item.dropdown .dropdown-toggle.active,
.nav-item.dropdown.active .dropdown-toggle {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    left: 0;
    background: #0f172a;
    border-radius: 10px;
    min-width: 180px;
    padding: 0.4rem 0;
    display: none;
    flex-direction: column;
    box-shadow: 0 25px 45px -30px rgba(56, 189, 248, 0.35);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.45rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: rgba(59, 130, 246, 0.25);
    color: #fff;
}

.nav-item.dropdown.open .dropdown-menu {
    display: flex;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Work in Progress Badge */
.badge-wip {
    background-color: var(--warning-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-live {
    background-color: var(--success-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 12px rgba(34, 197, 94, 0.5); }
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-container {
        gap: 0.5rem;
    }

    .nav-actions {
        margin-left: 0;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--nav-height);
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 0.5rem 0;
    }
    
    .nav-link {
        padding: 1rem;
        display: block;
    }

    .dropdown-menu {
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
    }

    .nav-item.dropdown.open .dropdown-menu {
        display: block;
    }
    
    /* Hamburger Animation */
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Adjust main content for fixed nav */
.main-content {
    min-height: auto;
}

/* Header */
header {
    background-color: var(--card-bg);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    text-align: left;
}

h1 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Controls */
.controls {
    background-color: var(--card-bg);
    padding: 8px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.control-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-group.compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group.compact label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Custom compact dropdowns */
.custom-dropdown {
    position: relative;
    min-width: 120px;
}

.dropdown-display {
    padding: 4px 8px;
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

.dropdown-display::after {
    content: '▼';
    font-size: 0.6rem;
    margin-left: 5px;
    color: var(--text-secondary);
}

.dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 2px;
}

.dropdown-item {
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
}

.dropdown-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin: 0;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #cbd5e0;
}

/* Compact select option styling */
select[multiple] option {
    padding: 2px 4px;
    font-size: 0.7rem;
}

select[multiple] option:checked {
    background-color: var(--secondary-color);
    color: white;
}

.icon {
    font-size: 0.9rem;
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    gap: 0;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    flex: 1;
    padding: 4px 8px;
    border: none;
    background-color: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.7rem;
}

.toggle-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.toggle-btn.active {
    background-color: var(--secondary-color);
    color: white;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 50px;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 30px;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background-color: #fee;
    color: var(--danger-color);
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid var(--danger-color);
}

/* Table */
.table-container {
    background-color: var(--card-bg);
    border-radius: 4px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 15px;
}

.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.portfolio-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 4px;
    text-align: left;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.7rem;
    white-space: nowrap;
}

.portfolio-table td {
    padding: 4px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

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

.portfolio-table .group-row td {
    background-color: #f0f4f8;
    color: var(--primary-color);
    font-weight: 600;
}

/* Strategy Rows */
.strategy-row {
    background-color: #f0f4f8;
    font-weight: 600;
}

.strategy-name {
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Holding Rows */
.holding-row .ticker {
    padding-left: 20px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.7rem;
}

/* Total Row */
.total-row {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.total-row td {
    padding: 8px 4px;
    border: none;
}

.total-label {
    font-size: 0.9rem;
}

.opportunity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.opportunity-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 4px;
    text-align: left;
    font-weight: 500;
    font-size: 0.7rem;
    white-space: nowrap;
}

.opportunity-table td {
    padding: 4px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

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

.opportunity-table .group-row td {
    background-color: #f5f8ff;
    color: var(--primary-color);
    font-weight: 600;
}

.opportunity-table .total-row {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.82rem;
}

.opportunity-table .total-row td {
    padding: 8px 4px;
    border: none;
}

/* Yield Coloring */
.yield-high {
    color: var(--success-color);
    font-weight: 600;
}

.yield-medium {
    color: var(--warning-color);
}

.yield-low {
    color: var(--text-secondary);
}

.ticker-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
}

.ticker-link-icon {
    margin-left: 6px;
    text-decoration: none;
}

.ticker-link:hover,
.ticker-link-icon:hover {
    text-decoration: underline;
}

/* Option Status Coloring */
.status-otm {
    color: var(--secondary-color) !important;
    font-weight: 600;
}

.status-itm {
    color: var(--danger-color) !important;
    font-weight: 600;
}

.underlying-itm {
    color: var(--danger-color) !important;
    font-weight: 600;
}

.assignment-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.assignment-detail-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    color: var(--secondary-color);
    transition: background 0.15s ease, color 0.15s ease;
}

.assignment-detail-btn:hover,
.assignment-detail-btn:focus {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.assignment-modal.hidden {
    display: none;
}

.assignment-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.assignment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.assignment-modal-panel {
    position: relative;
    max-width: 640px;
    width: 90%;
    margin: 80px auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.assignment-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.assignment-modal-body h3 {
    margin-bottom: 4px;
}

.assignment-meta {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 12px;
}

.assignment-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.assignment-detail-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-color);
}

.assignment-detail-card.emphasis {
    background: #fff8f6;
    border-color: rgba(231, 76, 60, 0.2);
}

.assignment-detail-card .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.assignment-detail-card strong {
    font-size: 15px;
    display: block;
}

.assignment-detail-card small {
    color: var(--text-secondary);
    font-size: 11px;
}

.assignment-subsection {
    margin-top: 16px;
}

.assignment-subsection h4 {
    margin-bottom: 6px;
}

.assignment-list {
    list-style: none;
    padding-left: 0;
    font-size: 13px;
}

.assignment-list li {
    padding: 2px 0;
}

.assignment-empty {
    color: var(--text-secondary);
    font-style: italic;
}

.underlying-otm {
    color: var(--secondary-color) !important;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 10px;
}

/* Price update indicator */
.price-updating {
    color: var(--secondary-color);
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.no-data {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.table-footnote {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .controls {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .portfolio-table {
        font-size: 0.7rem;
    }
    
    .portfolio-table th,
    .portfolio-table td {
        padding: 3px;
        font-size: 0.65rem;
    }
    
    .holding-row .ticker {
        padding-left: 15px;
    }
}

/* Data Timestamps Footer */
.data-timestamps {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 0;
    margin-top: 40px;
}

.timestamps-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.timestamps-container h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.timestamp-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.timestamp-section {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timestamp-section h5 {
    margin: 0;
    font-size: 0.95rem;
    color: #495057;
}

.timestamp-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.timestamp-label {
    font-weight: 500;
    color: #6c757d;
}

.timestamp-value {
    font-size: 0.85rem;
    cursor: help;
}

.timestamp-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.timestamp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timestamp-badge {
    font-size: 0.72rem;
    line-height: 1.2;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e9ecef;
    color: #495057;
}

.timestamp-badge.warning {
    background: #fff4e5;
    color: #b45309;
}

.timestamp-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.timestamp-badge.success {
    background: #dcfce7;
    color: #166534;
}

.timestamp-badge.info {
    background: #e0f2fe;
    color: #0369a1;
}

.timestamp-value.fresh {
    color: #28a745;
    font-weight: 500;
}

.timestamp-value.recent {
    color: #17a2b8;
}

.timestamp-value.stale {
    color: #dc3545;
}

.timestamp-value.no-data {
    color: #6c757d;
    font-style: italic;
}
.decision-pill,
.event-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  gap: 4px;
  background: #f1f3f5;
  color: #333;
}

.decision-pill.decision-roll {
  background: #0f9960;
  color: #fff;
}

.decision-pill.decision-let {
  background: #c1351d;
  color: #fff;
}

.decision-pill.decision-review {
  background: #adb5bd;
  color: #fff;
}

.event-pill.event-warning {
  background: #f59f00;
  color: #1f1f1f;
}

.event-pill.event-danger {
  background: #c92a2a;
  color: #fff;
}

.event-pill.event-clear {
  background: #e7f5ff;
  color: #1c7ed6;
}

.chip-roll-signal {
  border: 1px solid #0f9960;
}
.premium-value {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.premium-value .premium-mid {
  font-weight: 600;
}

.premium-value .premium-last {
  color: #555;
}

.downside-decision-panel {
  margin-bottom: 12px;
  margin-top: 8px;
}

.decision-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.decision-table th,
.decision-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.decision-table th {
  background: #f6f8fa;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

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

.decision-row {
  border-left: 4px solid transparent;
  transition: background 0.15s ease;
}

.decision-row--best {
  border-left-color: var(--success-color);
  background: #e9f8f0;
}

.decision-row--caution {
  border-left-color: var(--warning-color);
}

.decision-row--blocked {
  border-left-color: var(--danger-color);
  opacity: 0.65;
}

.decision-label {
  font-weight: 600;
  color: var(--text-primary);
}

.decision-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.decision-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f3f5;
  color: var(--text-secondary);
}

.decision-badge--premium {
  background: #e6f2ff;
  color: #0b508c;
}

.decision-badge--loss {
  background: #fff4e6;
  color: #8a4f00;
}

.decision-badge--breakeven {
  background: #f3f0ff;
  color: #5f3dc4;
}

.decision-badge--yield {
  background: #e3fafc;
  color: #087f5b;
}
