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

:root {
    --bg-primary: #000000;
    --bg-elevated: #1C1C1E;
    --bg-secondary: #2C2C2E;
    --bg-tertiary: #3A3A3C;
    --label-primary: #FFFFFF;
    --label-secondary: #8E8E93;
    --label-tertiary: #48484A;
    --label-quaternary: #3A3A3C;
    --system-blue: #0A84FF;
    --system-blue-dark: #0070E0;
    --system-green: #30D158;
    --system-red: #FF453A;
    --system-orange: #FF9F0A;
    --system-yellow: #FFD60A;
    --system-purple: #BF5AF2;
    --system-pink: #FF375F;
    --system-teal: #64D2FF;
    --separator: #38383A;
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--label-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }

/* ── Top Nav ── */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--separator);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--system-blue), #5E5CE6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-brand h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--label-primary);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn:hover { background: var(--bg-tertiary); }
.nav-btn:active { transform: scale(0.96); }

.nav-btn.primary {
    background: var(--system-blue);
    color: white;
}

.nav-btn.primary:hover { background: var(--system-blue-dark); }

/* ── Review Alert Star ── */
.review-alert {
    position: relative;
    width: 12px;
    height: 12px;
    background: var(--system-red);
    border-radius: 50%;
    margin-right: 8px;
    animation: glowPulse 2s ease-in-out infinite;
}

.review-alert::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--system-red);
    opacity: 0;
    animation: pulseWave 2s ease-out infinite;
}

.review-alert::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: var(--system-red);
    opacity: 0;
    animation: pulseWave 2s ease-out infinite 0.4s;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 6px var(--system-red), 0 0 14px rgba(255, 69, 58, 0.4); }
    50% { box-shadow: 0 0 12px var(--system-red), 0 0 28px rgba(255, 69, 58, 0.6), 0 0 40px rgba(255, 69, 58, 0.2); }
}

@keyframes pulseWave {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2.5); opacity: 0; }
}

.nav-btn.danger {
    color: var(--system-red);
}

/* ── Stats Bar ── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 20px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.stat-card {
    background: var(--bg-elevated);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
    animation: fadeSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.stat-card:nth-child(2) { animation-delay: 0.03s; }
.stat-card:nth-child(3) { animation-delay: 0.06s; }
.stat-card:nth-child(4) { animation-delay: 0.09s; }
.stat-card:nth-child(5) { animation-delay: 0.12s; }
.stat-card:nth-child(6) { animation-delay: 0.15s; }
.stat-card:nth-child(7) { animation-delay: 0.18s; }
.stat-card:nth-child(8) { animation-delay: 0.21s; }
.stat-card:nth-child(9) { animation-delay: 0.24s; }

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-value.green { color: var(--system-green); }
.stat-value.orange { color: var(--system-orange); }
.stat-value.blue { color: var(--system-blue); }
.stat-value.purple { color: var(--system-purple); }

.stat-sub {
    font-size: 11px;
    color: var(--label-tertiary);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.stat-card-title.blue { color: var(--system-blue); }
.stat-card-title.orange { color: var(--system-orange); }
.stat-card-title.purple { color: var(--system-purple); }
.stat-card-title.teal { color: var(--system-teal); }

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.stat-row + .stat-row {
    border-top: 0.5px solid var(--separator);
}

.stat-row-label {
    font-size: 13px;
    color: var(--label-secondary);
}

.stat-row-value {
    font-size: 14px;
    font-weight: 600;
}

.stat-row-value.red { color: var(--system-red); }
.stat-row-value.green { color: var(--system-green); }

.stat-sync {
    font-size: 11px;
    color: var(--label-tertiary);
    margin-top: 10px;
    text-align: right;
}

/* ── Filter Bar ── */
.filter-bar {
    padding: 0 24px 16px;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    background: var(--bg-elevated);
    border-radius: 10px;
    overflow: hidden;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--label-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover { color: var(--label-primary); }
.filter-btn.active {
    background: var(--system-blue);
    color: white;
}

.search-box {
    flex: 1;
    min-width: 200px;
    background: var(--bg-elevated);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--label-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: box-shadow 0.2s;
}

.search-box::placeholder { color: var(--label-tertiary); }
.search-box:focus { box-shadow: 0 0 0 2px var(--system-blue); }

.sort-select {
    background: var(--bg-elevated);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--label-secondary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* ── Cards Grid ── */
.cards-container {
    padding: 0 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}

.trade-card {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: cardSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    cursor: default;
    border: 1px solid transparent;
}

.trade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    border-color: var(--separator);
}

.trade-card.expired {
    background: rgba(255, 69, 58, 0.08);
    border-color: rgba(255, 69, 58, 0.2);
}

.trade-card.expired:hover {
    border-color: rgba(255, 69, 58, 0.35);
}

.badge.expired-badge {
    background: rgba(255, 69, 58, 0.2);
    color: var(--system-red);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tag {
    font-size: 10px !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    flex-shrink: 0;
}

.cat-stock {
    background: rgba(10, 132, 255, 0.15);
    color: var(--system-blue);
}

.cat-futures {
    background: rgba(255, 159, 10, 0.15);
    color: var(--system-orange);
}

.cat-options {
    background: rgba(191, 90, 242, 0.15);
    color: var(--system-purple);
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.info-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--label-tertiary);
    background: transparent;
    color: var(--label-tertiary);
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.info-btn:hover {
    border-color: var(--system-blue);
    color: var(--system-blue);
    background: rgba(10, 132, 255, 0.1);
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.card-stock-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.card-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--system-blue);
    flex-shrink: 0;
    overflow: hidden;
}

.card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-name {
    flex: 1;
    min-width: 0;
}

.card-name h3 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-name p {
    font-size: 12px;
    color: var(--label-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge.buy {
    background: rgba(48, 209, 88, 0.15);
    color: var(--system-green);
}

.badge.sell {
    background: rgba(255, 69, 58, 0.15);
    color: var(--system-red);
}

.badge.short {
    background: rgba(255, 159, 10, 0.15);
    color: var(--system-orange);
}

.badge.medium {
    background: rgba(10, 132, 255, 0.15);
    color: var(--system-blue);
}

.badge.long {
    background: rgba(191, 90, 242, 0.15);
    color: var(--system-purple);
}

.badge.hit {
    background: rgba(48, 209, 88, 0.15);
    color: var(--system-green);
}

.badge.new-card {
    background: rgba(255, 214, 10, 0.15);
    color: var(--system-yellow);
}

.badge.hashtag {
    background: rgba(100, 210, 255, 0.12);
    color: var(--system-teal);
}

/* ── Price Grid ── */
.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.price-item {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 10px 12px;
}

.price-label {
    font-size: 11px;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.price-value {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-value.green { color: var(--system-green); }
.price-value.red { color: var(--system-red); }

/* ── Change So Far ── */
.card-change {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-change span:first-child {
    font-weight: 500;
    font-size: 12px;
}

.card-change.positive {
    background: rgba(48, 209, 88, 0.08);
    color: var(--system-green);
}

.card-change.negative {
    background: rgba(255, 69, 58, 0.08);
    color: var(--system-red);
}

/* ── Potential Bar ── */
.potential-bar-container {
    margin-bottom: 14px;
}

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

.potential-label {
    font-size: 12px;
    color: var(--label-secondary);
}

.potential-value {
    font-size: 14px;
    font-weight: 600;
}

.potential-value.positive { color: var(--system-green); }
.potential-value.negative { color: var(--system-red); }

.potential-track {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.potential-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.potential-fill.positive { background: var(--system-green); }
.potential-fill.negative { background: var(--system-red); }

/* ── Options Strategy ── */
.options-strategy {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.options-strategy-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.options-legs-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--label-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-bottom: 6px;
    border-bottom: 0.5px solid var(--separator);
    margin-bottom: 6px;
}

.option-leg {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.option-leg + .option-leg {
    border-top: 0.5px solid var(--separator);
}

.option-leg-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-symbol {
    font-size: 13px;
    font-weight: 500;
}

.option-leg-price {
    font-size: 13px;
    font-weight: 600;
}

.futures-margin {
    text-align: center;
    font-size: 12px;
    color: var(--label-secondary);
    padding: 8px 0 0;
}

.futures-note {
    font-size: 12px;
    font-weight: 500;
    color: var(--system-teal);
    padding-top: 6px;
    font-style: italic;
}

/* ── Card Footer ── */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 0.5px solid var(--separator);
}

.card-posted-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--system-teal);
    letter-spacing: 0.2px;
}

/* ── Card Actions ── */
.card-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    color: var(--label-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--label-primary);
}

.action-btn:active { transform: scale(0.96); }

.reviewed-btn.active {
    background: rgba(48, 209, 88, 0.12);
    border-color: rgba(48, 209, 88, 0.3);
    color: var(--system-green);
}

.buy-btn:hover {
    background: rgba(10, 132, 255, 0.12);
    border-color: rgba(10, 132, 255, 0.3);
    color: var(--system-blue);
}

.card-meta {
    font-size: 12px;
    color: var(--label-tertiary);
}

.card-duration {
    font-size: 12px;
    color: var(--label-secondary);
    font-weight: 500;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    animation: fadeSlideUp 0.5s ease both;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 15px;
    color: var(--label-secondary);
    margin-bottom: 24px;
}

/* ── Loading ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--system-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-size: 15px;
    color: var(--label-secondary);
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    border: 0.5px solid var(--separator);
    border-radius: 14px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 90vw;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success .toast-icon { color: var(--system-green); }
.toast.error .toast-icon { color: var(--system-red); }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-elevated);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-elevated);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--label-secondary);
    margin-bottom: 4px;
    margin-top: 10px;
}

.modal-label:first-of-type {
    margin-top: 0;
}

.modal-input {
    width: 100%;
    background: var(--bg-secondary);
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--label-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    margin-bottom: 8px;
}

.modal-input:focus { box-shadow: 0 0 0 2px var(--system-blue); }

.modal-hint {
    font-size: 12px;
    color: var(--label-tertiary);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--label-primary);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn:hover { background: var(--bg-tertiary); }
.modal-btn.primary { background: var(--system-blue); color: white; }
.modal-btn.primary:hover { background: var(--system-blue-dark); }

/* ── Detail Panel ── */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.detail-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.detail-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 460px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-elevated);
    z-index: 501;
    transition: right 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.detail-panel.active {
    right: 0;
}

.detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-secondary);
    border: none;
    color: var(--label-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.detail-close:hover { background: var(--bg-tertiary); color: var(--label-primary); }

.detail-header {
    padding: 24px 24px 0;
    margin-bottom: 20px;
}

.detail-stock-name {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.detail-company {
    font-size: 14px;
    color: var(--label-secondary);
    margin-bottom: 12px;
}

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

.detail-section {
    padding: 0 24px;
    margin-bottom: 20px;
}

.detail-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.detail-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.detail-price-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px;
}

.detail-price-item .label {
    font-size: 11px;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.detail-price-item .value {
    font-size: 18px;
    font-weight: 600;
}

.detail-note {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--label-secondary);
}

.detail-modifications {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.mod-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
}

.mod-row + .mod-row {
    border-top: 0.5px solid var(--separator);
}

.mod-action {
    font-size: 13px;
    font-weight: 500;
}

.mod-details {
    font-size: 12px;
    color: var(--label-secondary);
    text-align: right;
}

/* ── Profit Calculator ── */
.profit-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    table-layout: fixed;
}

.profit-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 6px 6px;
    border-bottom: 0.5px solid var(--separator);
}

.profit-table td {
    padding: 8px 6px;
    font-size: 12px;
    border-bottom: 0.5px solid var(--separator);
    vertical-align: middle;
    word-break: break-word;
}

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

.pnl-positive { color: var(--system-green); font-weight: 600; }
.pnl-negative { color: var(--system-red); font-weight: 600; }

.charge-breakdown {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px;
    margin-top: 8px;
}

.charge-breakdown-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

.charge-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    color: var(--label-secondary);
}

.charge-row + .charge-row {
    border-top: 0.5px solid var(--separator);
}

.charge-row.total {
    font-weight: 600;
    color: var(--label-primary);
    margin-top: 4px;
    padding-top: 8px;
}

/* ── Animations ── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ── Responsive ── */
/* ── Clickable Portfolio Card ── */
.stat-card-link {
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.stat-card-link:hover {
    border-color: var(--system-teal);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .top-nav { padding: 10px 12px; gap: 6px; }
    .nav-brand h1 { font-size: 15px; }
    .nav-actions { gap: 6px; }
    .nav-btn { font-size: 12px; padding: 6px 10px; }
    .nav-btn svg { width: 12px; height: 12px; }

    .stats-bar { padding: 12px; gap: 8px; grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 20px; }
    .stat-card { padding: 14px; }
    .stat-card-title { font-size: 16px; }
    .stat-row-label { font-size: 12px; }
    .stat-row-value { font-size: 13px; }

    .filter-bar {
        padding: 0 12px 12px;
        justify-content: center;
    }
    .filter-group { flex-shrink: 0; }
    .filter-btn { font-size: 12px; padding: 6px 10px; }
    .search-box { min-width: 140px; font-size: 13px; padding: 7px 12px; }
    .sort-select { font-size: 12px; padding: 7px 10px; }

    .cards-container { padding: 0 12px 24px; }
    .cards-grid { grid-template-columns: 1fr; gap: 10px; }

    .detail-panel { width: 100vw; }

    .modal { padding: 18px; width: 95%; max-width: 100%; }
    .modal h2 { font-size: 17px; margin-bottom: 12px; }

    .profit-table th { font-size: 9px; padding: 5px 4px; }
    .profit-table td { font-size: 11px; padding: 7px 4px; }

    .charge-breakdown { padding: 10px; }
    .charge-breakdown-title { font-size: 10px; }
    .charge-row { font-size: 12px; }

    /* Hide text labels on nav buttons, show only icons */
    .nav-btn { padding: 8px; font-size: 0; gap: 0; }
    .nav-btn svg { width: 16px; height: 16px; }
    .nav-btn.primary { font-size: 12px; gap: 4px; padding: 8px 12px; }
    .nav-btn.primary svg { width: 13px; height: 13px; }

    /* Review alert smaller */
    .review-alert { width: 10px; height: 10px; margin-right: 4px; }

    /* Filters: scrollable single row */
    .filter-bar {
        padding: 0 12px 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        justify-content: flex-start;
        scrollbar-width: none;
    }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-group { flex-shrink: 0; }
    .filter-btn { font-size: 11px; padding: 6px 10px; }
    .search-box { min-width: 120px; flex: 0 0 120px; font-size: 12px; padding: 6px 10px; }
    .sort-select { font-size: 11px; padding: 6px 8px; flex-shrink: 0; }
}
