/* ==========================================================================
   MYFINANCESHEET - CUSTOM STYLING & CORE DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Harmonious HSL Palette */
    --bg-primary: #15161e;
    --bg-secondary: #1e1f29;
    --bg-tertiary: #272836;
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-blue-glow: rgba(59, 130, 246, 0.2);
    
    --color-win: #10b981;
    --color-win-bg: rgba(16, 185, 129, 0.1);
    --color-win-glow: rgba(16, 185, 129, 0.15);
    
    --color-loss: #ef4444;
    --color-loss-bg: rgba(239, 68, 68, 0.1);
    --color-loss-glow: rgba(239, 68, 68, 0.15);
    
    --color-wash: #6b7280;
    --color-wash-bg: rgba(107, 114, 128, 0.1);
    
    --color-open: #f59e0b;
    --color-open-bg: rgba(245, 158, 11, 0.1);
    
    --color-setup: #a855f7;
    --color-setup-bg: rgba(168, 85, 247, 0.15);
    
    --color-note: #eab308;
    --color-note-bg: rgba(234, 179, 8, 0.15);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    --glass-bg: rgba(30, 31, 41, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    --border-radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, .logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-md);
}

.text-green { color: var(--color-win) !important; }
.text-red { color: var(--color-loss) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-muted { color: var(--text-muted) !important; }

.flex-row { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.align-end { align-items: flex-end; }
.align-center { align-items: center; }
.margin-top { margin-top: 16px; }
.margin-top-auto { margin-top: auto; }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.h-full { height: 100%; }

/* Privacy Blur Effect */
body.privacy-active .privacy-blur {
    filter: blur(6px) !important;
    user-select: none !important;
    pointer-events: none !important;
}

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    color: var(--text-primary);
}

.btn-primary {
    background-color: var(--accent-blue);
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-hover);
}

.btn-full {
    width: 100%;
}

.btn-action-trade {
    background-color: var(--accent-blue-hover);
}

.btn-action-trade:hover {
    background-color: var(--accent-blue);
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

.btn-action-setup {
    background-color: var(--color-setup-bg);
    border: 1px solid var(--color-setup);
    color: var(--color-setup);
}

.btn-action-setup:hover {
    background-color: var(--color-setup);
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--color-setup-bg);
}

.btn-action-note {
    background-color: var(--color-note-bg);
    border: 1px solid var(--color-note);
    color: var(--color-note);
}

.btn-action-note:hover {
    background-color: var(--color-note);
    color: var(--bg-primary);
    box-shadow: 0 0 12px var(--color-note-bg);
}

.btn-icon-only {
    padding: 10px;
    border-radius: var(--border-radius-md);
}

.btn-google {
    background-color: #ffffff;
    color: #1f2937;
    border: none;
}

.btn-google:hover {
    background-color: #f3f4f6;
}

.btn-danger {
    background-color: var(--color-loss-bg);
    border: 1px solid var(--color-loss);
    color: var(--color-loss);
}

.btn-danger:hover {
    background-color: var(--color-loss);
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--color-loss-glow);
}

/* Split footer: delete on left, cancel+save on right */
.modal-footer-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Clickable trade rows */
.trade-log-table tbody tr[data-trade-id]:hover {
    background-color: rgba(255, 255, 255, 0.025);
}

.icon-btn, .icon-btn-tiny {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.icon-btn {
    padding: 8px;
    border-radius: var(--border-radius-md);
}

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

.icon-btn-tiny {
    padding: 4px;
}

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

/* Input Fields */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    outline: none;
    font-family: inherit;
    font-size: 13px;
    transition: all var(--transition-fast);
}

input[type="date"],
input[type="datetime-local"] {
    color-scheme: dark;
}

/* Remove spinner arrows from Leverage inputs */
#trade-margin::-webkit-inner-spin-button,
#trade-margin::-webkit-outer-spin-button,
#edit-trade-margin::-webkit-inner-spin-button,
#edit-trade-margin::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue-glow);
}

/* Custom Select Dropdowns */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.portfolio-dropdown {
    width: 100%;
    appearance: none;
    padding-right: 32px !important;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

/* Radio Toggles */
.side-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.label-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.toggle-switch {
    display: flex;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 4px;
    width: fit-content;
}

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

.toggle-switch label {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.toggle-switch input[type="radio"]:checked + label.label-long {
    background-color: var(--color-win-bg);
    color: var(--color-win);
}

.toggle-switch input[type="radio"]:checked + label.label-short {
    background-color: var(--color-loss-bg);
    color: var(--color-loss);
}

/* Slider */
.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

input[type="range"] {
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--border-radius-full);
    background: var(--bg-tertiary);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-setup);
    cursor: pointer;
    box-shadow: 0 0 10px var(--color-setup-bg);
    transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-axis {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}

/* Button groups */
.btn-toggle-group {
    display: flex;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 3px;
    gap: 4px;
    width: fit-content;
}

.toggle-btn-small {
    background: transparent;
    border: none;
    padding: 6px 12px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.toggle-btn-small svg {
    width: 16px;
    height: 16px;
}

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

.toggle-btn-small.active {
    background-color: var(--accent-blue);
    color: var(--text-primary);
}

/* ==========================================================================
   AUTHENTICATION MODULE SCREEN
   ========================================================================== */

.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.screen-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-header {
    text-align: center;
}

.logo-text {
    font-size: 28px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-form.active {
    display: flex;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 10px;
}

.auth-switch {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */

#app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar navigation */
#app-sidebar {
    width: 260px;
    height: calc(100vh - 24px);
    margin: 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
    overflow: hidden;
}

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

.sidebar-portfolio {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.balance-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-val {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.balance-sub {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 11.5px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    min-height: 38px;
    text-align: left;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.nav-item:hover svg {
    transform: translateY(-1px);
}

.nav-item.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--accent-blue) !important;
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.nav-item.span-2 {
    grid-column: span 2;
    padding: 8px 14px;
    gap: 12px;
}

.sidebar-actions {
    padding: 8px 10px;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sidebar-actions .btn {
    padding: 8px 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-details span:first-child {
    font-weight: 500;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.user-details span:last-child {
    font-size: 11px;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Main content panel */
#app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 12px 12px 0;
    height: 100vh;
    overflow: hidden;
}

#main-header {
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 12px;
    position: relative;
    z-index: 1010;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.date-filters::-webkit-scrollbar {
    display: none; /* Hide scrollbars for the filters bar */
}

.filter-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-pill:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.filter-pill.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-date-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Tab contents viewport */
#page-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.tab-view {
    display: none;
}

.tab-view.active {
    display: block;
}

/* ==========================================================================
   TAB: DASHBOARD VIEW
   ========================================================================== */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 12px;
}

.curve-thumb-card {
    height: 100%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-equity-chart {
    width: 100%;
    height: 100%;
}

.progress-ring-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ring-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 10px;
}

.ring-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 3.5;
}

.ring-fill {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray var(--transition-normal);
}

.ring-fill.win-color { stroke: var(--color-win); }
.ring-fill.loss-color { stroke: var(--color-loss); }
.ring-fill.open-color { stroke: var(--accent-blue); }
.ring-fill.wash-color { stroke: var(--color-wash); }

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.card-details {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.card-val {
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    margin-top: 2px;
}

.average-pnl-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.average-pnl-cards .stat-card {
    padding: 12px 16px;
    font-size: 12px;
}

.average-pnl-cards .lbl {
    font-weight: 600;
    color: var(--text-secondary);
}

.average-pnl-cards .val {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.average-pnl-cards .pct {
    font-size: 10px;
    font-weight: 500;
}

.pnl-bar-card {
    flex-direction: row !important;
}

.pnl-meter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-left: 20px;
}

.pnl-gauge-bg {
    width: 100%;
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    position: relative;
    overflow: hidden;
}

.pnl-gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--color-win);
    width: 0%;
    border-radius: var(--border-radius-full);
    transition: width var(--transition-normal);
}

.pnl-total-pct {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
}

/* Grouped Trade Table Stylings */
.trade-log-container {
    padding: 16px;
}

.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    min-height: 200px;
}

.trade-log-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12.5px;
}

.trade-log-table th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    font-size: 12px;
}

.trade-log-table th.sortable {
    cursor: pointer;
}

.trade-log-table th.sortable:hover {
    color: var(--text-primary);
}

.sort-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

.trade-log-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
}

.trade-log-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Pill status tags */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.status-pill.win { background-color: var(--color-win-bg); color: var(--color-win); }
.status-pill.loss { background-color: var(--color-loss-bg); color: var(--color-loss); }
.status-pill.wash { background-color: var(--color-wash-bg); color: var(--text-secondary); }
.status-pill.open { background-color: var(--color-open-bg); color: var(--color-open); }

.side-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.side-arrow svg {
    width: 14px;
    height: 14px;
}

/* Daily Divider Row */
.daily-divider-row td {
    background-color: var(--bg-secondary) !important;
    padding: 8px 16px !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
}

.divider-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.divider-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.divider-date {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

.divider-mood {
    display: flex;
    gap: 4px;
    color: var(--text-secondary);
}

.divider-mood svg {
    width: 14px;
    height: 14px;
}

.divider-summary-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-note);
    background-color: var(--color-note-bg);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
}

.divider-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.divider-pnl {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.divider-return-pct {
    font-size: 11px;
    font-weight: 500;
}

.divider-badge-group {
    display: flex;
    gap: 6px;
}

.divider-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.divider-badge.win { background-color: var(--color-win); color: var(--bg-primary); }
.divider-badge.loss { background-color: var(--color-loss); color: var(--text-primary); }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    gap: 12px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 320px;
}

/* ==========================================================================
   TAB: CHARTS VIEW
   ========================================================================== */
.charts-ux-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.charts-ux-banner .ux-banner-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.charts-ux-banner span {
    font-size: 11.5px;
    line-height: 1.4;
}

.charts-ux-banner strong {
    color: var(--text-primary);
}

.charts-view-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 155px);
    min-height: 500px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--border-radius-md);
}

.tradingview-widget-container {
    flex: 1;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #131722;
    display: flex;
    flex-direction: column;
}

.tradingview-widget-container iframe,
.tradingview-widget-container div {
    height: 100% !important;
    width: 100% !important;
}

/* ==========================================================================
   TAB: STATS VIEW
   ========================================================================== */

.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.stats-mini-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stats-mini-card .lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.stats-mini-card .val {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.chart-container-large {
    padding: 20px;
}

.chart-header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.canvas-wrapper-large {
    width: 100%;
    height: 350px;
}

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

.chart-card-medium {
    padding: 20px;
}

.canvas-wrapper-medium {
    width: 100%;
    height: 250px;
}

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

.breakdown-card {
    padding: 20px;
}

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

.breakdown-card th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
}

.breakdown-card td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-card tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   TAB: CALENDAR VIEW
   ========================================================================== */

.calendar-layout-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 12px;
}

.calendar-main-card {
    padding: 24px;
}

.calendar-header-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.calendar-month-year-label {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    min-width: 120px;
    text-align: center;
}

.calendar-weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 90px;
    gap: 6px;
}

.calendar-day-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.01);
    transition: all var(--transition-fast);
    cursor: pointer;
    overflow: hidden;
}

.calendar-day-box:hover {
    border-color: var(--border-color-hover);
    background-color: var(--bg-tertiary);
}

.calendar-day-num {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.calendar-day-box.outside-month {
    opacity: 0.25;
    pointer-events: none;
}

/* Color Coding Days */
.calendar-day-box.day-profit {
    border-color: rgba(16, 185, 129, 0.3);
    background-color: rgba(16, 185, 129, 0.05);
}
.calendar-day-box.day-profit:hover {
    border-color: var(--color-win);
    background-color: rgba(16, 185, 129, 0.1);
}

.calendar-day-box.day-loss {
    border-color: rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.05);
}
.calendar-day-box.day-loss:hover {
    border-color: var(--color-loss);
    background-color: rgba(239, 68, 68, 0.1);
}

.calendar-day-box.day-wash {
    border-color: rgba(107, 114, 128, 0.3);
}

.calendar-day-pnl {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}

.calendar-day-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
}

.calendar-day-mood {
    display: flex;
    align-items: center;
}

.calendar-day-mood svg {
    width: 12px;
    height: 12px;
}

.calendar-side-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.weekly-summaries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.weekly-summary-item {
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--border-radius-md);
    background-color: rgba(255, 255, 255, 0.01);
}

.weekly-summary-item .title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.weekly-summary-item .pnl-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
}

.weekly-summary-item .stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   TAB: SETTINGS VIEW & SUB-TABS
   ========================================================================== */

.settings-layout-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 12px;
}

.settings-nav-card {
    padding: 16px 12px;
    height: fit-content;
}

.settings-nav-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.settings-nav-item svg {
    width: 16px;
    height: 16px;
}

.settings-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-left: 2px solid var(--accent-blue);
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
}

.settings-viewports-container {
    width: 100%;
}

.settings-viewport {
    display: none;
    padding: 24px;
    width: 100%;
}

.settings-viewport.active {
    display: block;
}

.settings-title {
    font-size: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.settings-sharing-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.sharing-desc {
    color: var(--text-secondary);
    font-size: 12.5px;
    margin-bottom: 16px;
    max-width: 500px;
}

#public-link-container {
    display: flex;
    gap: 8px;
    max-width: 500px;
}

#public-link-input {
    flex: 1;
    background-color: var(--bg-primary);
}

/* Tag Manager Panel Styles */
.tag-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tag-manager-header h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

#settings-tag-table-body td {
    padding: 10px 16px;
}

/* ==========================================================================
   DIALOG MODALS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 11, 15, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

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

.modal-container {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-container.width-sm { width: 100%; max-width: 400px; }
.modal-container.width-md { width: 100%; max-width: 540px; }
.modal-container.width-lg { width: 100%; max-width: 800px; }

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

.modal-header h3 {
    font-size: 16px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.modal-tab-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

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

.modal-tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-blue);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-tab-panel {
    display: none;
}

.modal-tab-panel.active {
    display: block;
}

.modal-form-row {
    display: flex;
    gap: 16px;
}

.modal-form-row > .input-group {
    min-width: 0;
}

.modal-form-row input,
.modal-form-row select {
    min-width: 0;
    width: 100%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Dynamic Transactions Lists inside New Trade Modal */
.transaction-lines-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.transaction-line-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 80px 40px;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

/* Multiselect Custom Search Container */
.tags-multiselect-container {
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-md);
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
}

.selected-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-tag-pill {
    background-color: var(--color-setup-bg);
    color: var(--color-setup);
    border: 1px solid var(--color-setup);
    padding: 2px 8px;
    font-size: 11px;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.selected-tag-pill svg {
    width: 10px;
    height: 10px;
    cursor: pointer;
}

.tags-multiselect-container input[type="text"] {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 4px 6px !important;
    min-width: 120px;
    box-shadow: none !important;
}

.tag-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tag-dropdown-item {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

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

/* Rich Notes Editor toolbar */
.editor-toolbar {
    display: flex;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
    padding: 4px;
    gap: 4px;
}

.editor-toolbar + textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Setup R:R calculator */
.risk-reward-indicator-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.risk-reward-indicator-panel .ratio-val {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
}

/* Day Note Selectors */
.note-selectors-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.note-selector-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS & GLOBAL LOADERS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--accent-blue);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    animation: slide-in var(--transition-normal);
}

.toast.win-toast { border-left-color: var(--color-win); }
.toast.loss-toast { border-left-color: var(--color-loss); }

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 11, 15, 0.5);
    backdrop-filter: blur(2px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-up {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.animate-fade-in { animation: fade-in var(--transition-normal) forwards; }
.animate-scale-up { animation: scale-up var(--transition-normal) forwards; }

.mobile-only-flex {
    display: none !important;
}

/* ==========================================================================
   MOBILE & TABLET BREAKPOINTS (RESPONSIVENESS)
   ========================================================================== */

/* Mobile header / burger display logic */
.mobile-only-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}
@media (max-width: 1400px) {
    .trade-log-table th,
    .trade-log-table td {
        padding: 8px 6px;
        font-size: 11.5px;
    }
}

@media (max-width: 1024px) {
    /* Responsive grids */
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-charts-row {
        grid-template-columns: 1fr;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-layout-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-only-btn {
        display: block;
    }
    
    #app-container {
        flex-direction: column;
    }
    
    #app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1200;
        margin: 0;
        border-radius: 0;
        transform: translateX(-100%);
    }
    
    #app-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    #app-main {
        padding: 12px;
    }
    
    #main-header {
        padding: 0 16px;
    }
    
    .date-filters {
        width: 100%;
        padding: 8px 0;
    }
    
    .progress-ring-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-layout-wrapper {
        grid-template-columns: 1fr;
    }
    
    .settings-form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .note-selectors-row {
        grid-template-columns: 1fr;
    }
    
    .transaction-line-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .transaction-line-row button {
        grid-column: span 1;
    }
    
    .modal-form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    #sidebar-open-btn {
        display: none !important;
    }
    
    #app-main {
        padding: 12px 12px 80px 12px !important;
    }

    #main-header {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        align-items: center !important;
        height: auto !important;
        padding: 12px 16px !important;
        gap: 10px 8px !important;
    }
    
    .header-left {
        display: contents !important;
    }
    
    .date-filters {
        display: none !important;
    }

    .mobile-date-dropdown-wrapper {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        position: relative !important;
        width: 150px !important;
    }
    
    .header-date-select {
        width: 100% !important;
    }
    
    .custom-date-range-container {
        display: none !important;
        grid-column: 1 / span 2 !important;
        grid-row: 2 !important;
        margin-left: 0 !important;
        width: 100% !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding-top: 4px !important;
    }
    
    .custom-date-range-container.mobile-show {
        display: flex !important;
    }
    
    .header-date-input {
        flex: 1 !important;
        min-width: 0 !important;
        width: auto !important;
        padding: 6px 10px !important;
    }
    
    .header-right {
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        margin-left: auto !important;
        border-top: none !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        width: auto !important;
    }

    #date-range-label {
        display: none !important;
    }
    
    .mobile-only-flex {
        display: flex !important;
    }
    
    #mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        z-index: 1050;
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        background: rgba(30, 31, 41, 0.85);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        padding: 0 10px;
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        font-size: 10px;
        font-weight: 500;
        cursor: pointer;
        flex: 1;
        height: 100%;
        gap: 4px;
        transition: color var(--transition-fast), transform var(--transition-fast);
    }
    
    .bottom-nav-item svg,
    .bottom-nav-item i {
        width: 20px;
        height: 20px;
    }
    
    .bottom-nav-item:hover,
    .bottom-nav-item.active {
        color: var(--accent-blue);
    }
    
    .bottom-nav-item:active {
        transform: scale(0.95);
    }
    
    #mobile-fab {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 56px;
        height: 56px;
        z-index: 1050;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-hover) 100%);
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
        cursor: pointer;
        transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    }
    
    #mobile-fab svg,
    #mobile-fab i {
        width: 24px;
        height: 24px;
    }
    
    #mobile-fab:active {
        transform: scale(0.9);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
}

/* ==========================================================================
   TRADE ROW HOVER POPUP
   ========================================================================== */

.trade-hover-popup {
    position: fixed;
    z-index: 9000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    padding: 12px;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.trade-hover-popup.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.popup-tag-pill {
    display: inline-flex;
    align-items: center;
    background: var(--accent-blue-glow);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: var(--border-radius-full);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.popup-screenshot {
    width: 100%;
    border-radius: var(--border-radius-sm);
    max-height: 180px;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   IMAGE UPLOAD ZONE
   ========================================================================== */

.image-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-zone:hover {
    border-color: var(--accent-blue);
    background: var(--accent-blue-glow);
}

.image-upload-zone.drag-over {
    border-color: var(--accent-blue);
    background: var(--accent-blue-glow);
    transform: scale(1.01);
}

.image-upload-zone.has-image {
    padding: 0;
    border-style: solid;
    border-color: var(--border-color-hover);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.upload-placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

.uploaded-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    color: white;
    z-index: 10;
    pointer-events: all;
    transition: background var(--transition-fast);
}

.remove-image-btn:hover {
    background: var(--color-loss);
}

/* ==========================================================================
   Dual Screenshot Grid Layout & Lightbox
   ========================================================================== */

/* Dual Screenshot Grid Layout */
.image-upload-grid {
    display: flex;
    gap: 16px;
    width: 100%;
}

.image-upload-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-section-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.upload-section-heading.before {
    color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.1);
}

.upload-section-heading.after {
    color: var(--color-win);
    background: rgba(16, 185, 129, 0.1);
}

/* Trade Details View Previews */
.trade-view-images-grid {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}

.trade-view-img-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.trade-view-img-heading.before {
    color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.trade-view-img-heading.after {
    color: var(--color-win);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.trade-view-images-grid .trade-view-img-wrapper {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.trade-view-img-aspect-box {
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-sm);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-view-screenshot-img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.trade-view-screenshot-img:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Fullscreen Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 15, 0.95);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.05);
}

.lightbox-container {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.lightbox-comparison-header {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 30px;
    backdrop-filter: blur(8px);
}

.lightbox-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-tab-btn.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.lightbox-img-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    padding: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.lightbox-img-wrapper img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
    display: block;
}

/* Mobile Stacking Rules */
@media (max-width: 768px) {
    .image-upload-grid {
        flex-direction: column;
        gap: 12px;
    }
    .trade-view-images-grid {
        flex-direction: column;
        gap: 12px;
    }
    .trade-view-screenshot-img {
        max-height: 180px;
    }
    .lightbox-container {
        max-width: 95vw;
        max-height: 80vh;
    }
    .lightbox-img-wrapper img {
        max-height: 55vh;
    }
}

/* ==========================================================================
   TAG CREATE-NEW OPTION IN DROPDOWN
   ========================================================================== */

.tag-dropdown-item.create-new-tag {
    color: var(--accent-blue);
    font-weight: 600;
    background: var(--accent-blue-glow);
    border-bottom: 1px solid var(--border-color);
}

.tag-dropdown-item.create-new-tag:hover {
    background: var(--accent-blue) !important;
    color: var(--text-primary) !important;
}

/* ==========================================================================
   ROW OPTIONS MENU DROPDOWN
   ========================================================================== */

.row-menu-container {
    position: relative;
    display: inline-block;
}

.row-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-menu-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.row-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 140px;
    padding: 4px 0;
    margin-top: 4px;
}

.row-menu-dropdown.hidden {
    display: none;
}

.row-menu-dropdown.open-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.row-menu-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.row-menu-dropdown .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.row-menu-dropdown .dropdown-item i {
    width: 14px;
    height: 14px;
}

.row-menu-dropdown .dropdown-item.delete-trade-btn {
    color: var(--color-loss);
}

.row-menu-dropdown .dropdown-item.delete-trade-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Notes Text inside Hover Popup */
.popup-notes {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
    border-left: 2px solid var(--accent-blue);
    padding-left: 6px;
}

/* ==========================================================================
   HEADER PROFILE DROP-DOWN & MENU WIDGET
   ========================================================================== */

.header-profile-menu-container {
    position: relative;
}

.header-avatar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
}

.header-avatar-btn:hover {
    opacity: 0.8;
}

.header-profile-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 220px;
    z-index: 1020;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--glass-shadow);
}

.header-profile-dropdown.hidden {
    display: none !important;
}

.dropdown-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px;
}

.logged-in-lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.logged-in-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.dropdown-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 4px 0;
}

.header-profile-dropdown .dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 13px;
    width: 100%;
    text-align: left;
    transition: all var(--transition-fast);
}

.header-profile-dropdown .dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-profile-dropdown .dropdown-item svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   PERSONAL PROFILE AVATAR EDITOR & HOVER OVERLAY
   ========================================================================== */

.profile-avatar-wrapper {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.profile-avatar-edit-overlay {
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.profile-avatar-wrapper:hover .profile-avatar-edit-overlay {
    opacity: 1;
}

/* ==========================================================================
   DANGER ZONE PANEL STYLES
   ========================================================================== */

.danger-section {
    padding: 16px 0;
}

.danger-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.danger-section p {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
}

/* Tooltip styling */
.info-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
}

.info-tooltip-trigger:hover {
    color: var(--text-primary);
}

.info-tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f222e; /* dark Slate */
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: normal;
    width: 200px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-weight: normal;
    line-height: 1.4;
}

.info-tooltip-trigger:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ==========================================================================
   DYNAMIC FILTER PANEL OVERLAY
   ========================================================================== */

.filter-overlay-panel {
    position: absolute;
    top: calc(100% - 10px);
    right: 24px;
    z-index: 1050;
    width: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(16px);
}

.filter-overlay-panel.hidden {
    display: none !important;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.filter-total-trades {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

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

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-select {
    width: 100%;
    background-color: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    padding-right: 32px !important;
    appearance: none;
    cursor: pointer;
}

.filter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: 4px;
}

/* Day separator condition/volatility icons styling */
.divider-cond, .divider-vol {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.divider-cond svg, .divider-vol svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   DYNAMIC CHART OVERLAY & ACCOUNT LEDGER MODAL STYLES
   ========================================================================== */

/* Chart value overlay */
.curve-thumb-card {
    position: relative !important;
}

.chart-value-overlay {
    position: absolute;
    top: 14px;
    left: 16px;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.chart-value-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.chart-value-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

/* Account Details Row */
.account-details-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
    width: 100%;
}

.flex-3 { flex: 3; }
.flex-2 { flex: 2; }
.flex-1 { flex: 1; }
.align-center {
    align-items: center;
    text-align: center;
}

/* Primary Checkbox custom layout */
.primary-checkbox-wrapper {
    position: relative;
    width: 100%;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.primary-checkbox-btn {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.primary-checkbox-btn:hover {
    border-color: var(--border-color-hover);
    background-color: rgba(255, 255, 255, 0.02);
}

.primary-checkbox-btn .check-icon {
    width: 18px;
    height: 18px;
    color: transparent;
    transition: var(--transition-fast);
}

.hidden-checkbox:checked + .primary-checkbox-btn {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
}

.hidden-checkbox:checked + .primary-checkbox-btn .check-icon {
    color: var(--accent-blue);
}

/* Account Balance Read-only box */
.account-balance-display {
    width: 100%;
    height: 38px;
    border-radius: var(--border-radius-md);
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: 'Outfit', sans-serif;
}

/* Transactions Ledger Section */
.ledger-section {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.ledger-header {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ledger-table-wrapper {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: rgba(0, 0, 0, 0.15);
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ledger-table th {
    background-color: var(--bg-secondary);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border-color);
}

.ledger-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

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

.ledger-table input, .ledger-table select {
    width: 100%;
    height: 32px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0 8px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-fast);
}

.ledger-table input:focus, .ledger-table select:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.ledger-type-select {
    font-weight: 600;
}

.ledger-type-select.deposit {
    color: var(--color-win) !important;
}

.ledger-type-select.withdraw {
    color: var(--color-loss) !important;
}

/* Delete Row Button (Pink circle with X) */
.btn-row-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-loss);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-row-delete:hover {
    background-color: var(--color-loss);
    color: white;
    border-color: var(--color-loss);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.btn-row-delete svg {
    width: 12px;
    height: 12px;
}

/* Add Row Centered Plus Button */
.ledger-add-row-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 14px;
    margin-bottom: 10px;
}

.btn-circular-add {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    border: none;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px var(--accent-blue-glow);
}

.btn-circular-add:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.4);
}

.btn-circular-add svg {
    width: 16px;
    height: 16px;
}

/* Account Modal Footer Custom Layout */
.account-modal-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 20px;
}

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

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-secondary-outline {
    background-color: #4a453f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e5e5;
}

.btn-secondary-outline:hover {
    background-color: #5a544d;
    color: white;
}

.flex-spacer {
    flex-grow: 1;
}

/* Trade View Modal Styling */
.trade-view-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
}

.trade-view-symbol-badge {
    background-color: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 6px 14px;
    border-radius: var(--border-radius-pill);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.trade-view-pnl-label {
    font-size: 18px;
    font-weight: 700;
}

.trade-view-pills-right {
    display: flex;
    gap: 8px;
}

.trade-view-badge-pill {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--border-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.trade-view-badge-pill.duration {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.trade-view-badge-pill.side-long {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-win);
    border-color: rgba(16, 185, 129, 0.3);
}

.trade-view-badge-pill.side-short {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-loss);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Timeline component styling */
.trade-view-timeline-wrapper {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px 16px;
    margin: 10px 0;
    position: relative;
}

.view-timeline-track {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    width: 100%;
}

.view-timeline-track::before {
    content: '';
    position: absolute;
    top: 50px; /* center vertically with circle */
    left: 10%;
    right: 10%;
    height: 4px;
    background: linear-gradient(to right, var(--color-win), var(--accent-blue), var(--color-loss));
    z-index: 1;
    border-radius: 2px;
}

.view-timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    text-align: center;
    min-width: 120px;
}

.view-timeline-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.view-timeline-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0,0,0,0.5);
    border: 2px solid #ffffff;
}

.view-timeline-circle.buy {
    background-color: var(--color-win);
    box-shadow: 0 0 10px var(--color-win-glow);
}

.view-timeline-circle.sell {
    background-color: var(--color-loss);
    box-shadow: 0 0 10px var(--color-loss-glow);
}

.view-timeline-details {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 8px;
    font-weight: 600;
}

/* Notes Section */
.trade-view-notes-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.trade-view-section-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.trade-view-section-header::before,
.trade-view-section-header::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed var(--border-color);
}

.trade-view-section-title {
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.trade-view-notes-box {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trade-view-notes-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
}

.trade-view-img-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.trade-view-screenshot-img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.trade-view-target-badge {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--border-radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   CALENDAR DAY HOVER POPUP
   ========================================================================== */

.calendar-hover-popup {
    position: fixed;
    z-index: 9000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    padding: 14px;
    min-width: 260px;
    max-width: 300px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.calendar-hover-popup.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.cal-popup-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cal-popup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cal-popup-trade-item {
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.cal-popup-trade-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.cal-popup-trade-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.cal-popup-symbol {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
    flex-grow: 1;
}

.cal-popup-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
}

.cal-popup-badge.side-long {
    background: rgba(46, 204, 113, 0.15);
    color: var(--color-win);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.cal-popup-badge.side-short {
    background: rgba(231, 76, 60, 0.15);
    color: var(--color-loss);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.cal-popup-badge.status-win {
    background: rgba(46, 204, 113, 0.2);
    color: var(--color-win);
}

.cal-popup-badge.status-loss {
    background: rgba(231, 76, 60, 0.2);
    color: var(--color-loss);
}

.cal-popup-badge.status-wash {
    background: rgba(127, 140, 141, 0.2);
    color: var(--text-secondary);
}

.cal-popup-badge.status-open {
    background: rgba(52, 152, 219, 0.2);
    color: var(--accent-blue);
}

.cal-popup-trade-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cal-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.mobile-date-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.header-date-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    outline: none;
    padding: 6px 32px 6px 16px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    width: 140px;
}

.header-date-select:focus, .header-date-select:hover {
    border-color: var(--accent-blue);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.select-arrow-tiny {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 12px;
    height: 12px;
    color: var(--text-secondary);
}

.custom-date-range-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.header-date-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    outline: none;
    width: 140px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.header-date-input:focus, .header-date-input:hover {
    border-color: var(--accent-blue);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

/* Make custom indicators match dark theme */
.header-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2.0);
    cursor: pointer;
    margin-left: 2px;
}

.date-sep {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.icon-btn-apply {
    background: var(--accent-blue);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-full);
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.icon-btn-apply:hover {
    background: var(--accent-blue-hover, #2563eb);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   TAB: INSIGHTS & BEHAVIOR DIAGNOSTICS
   ========================================================================== */

.insights-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

.insights-pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.pillar-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.pillar-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.pillar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.pillar-pct {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    opacity: 0.85;
}

.pillar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.pillar-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.pillar-val {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    line-height: 1.1;
}

.pillar-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.pillar-footer {
    display: flex;
    align-items: center;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 11px;
    font-weight: 600;
}

.status-badge svg {
    width: 13px;
    height: 13px;
}

.badge-red {
    background: var(--color-loss-bg);
    color: var(--color-loss);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-green {
    background: var(--color-win-bg);
    color: var(--color-win);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Diagnostics Columns */
.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.diagnostic-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.diag-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.diag-header svg {
    width: 20px;
    height: 20px;
}

.header-edge {
    color: var(--color-win);
}

.header-leak {
    color: var(--color-loss);
}

.diag-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
}

.diag-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.diag-lbl {
    color: var(--text-secondary);
    font-size: 13px;
}

.diag-val {
    font-weight: 600;
    font-size: 13px;
}

/* Mood Correlation & Emotional Impact */
.mood-correlation-card {
    padding: 24px;
}

.section-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card-title svg {
    width: 18px;
    height: 18px;
}

.section-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 16px;
}

.mood-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mood-stat-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--border-radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.mood-stat-badge:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-tertiary);
}

.mood-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.mood-badge-icon svg {
    width: 20px;
    height: 20px;
}

.mood-happy .mood-badge-icon {
    color: var(--color-win);
    background: var(--color-win-bg);
}

.mood-neutral .mood-badge-icon {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.mood-sad .mood-badge-icon {
    color: var(--color-loss);
    background: var(--color-loss-bg);
}

.mood-badge-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mood-lbl {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.mood-val {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.mood-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* Strategy Drawdown Diagnostics */
.drawdown-diagnostics-card {
    padding: 24px;
}

.drawdown-table-container {
    width: 100%;
    overflow-x: auto;
}

.insights-drawdown-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.insights-drawdown-table thead tr {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.insights-drawdown-table th {
    padding: 12px 12px;
    font-weight: 600;
}

.insights-drawdown-table th.dd-col {
    width: 35%;
}

.insights-drawdown-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 13px;
    transition: background-color var(--transition-fast);
}

.insights-drawdown-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.insights-drawdown-table td {
    padding: 12px 12px;
}

.insights-drawdown-table td.strategy-name {
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.dd-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dd-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.dd-bar-fill {
    height: 100%;
    background: var(--color-loss);
    border-radius: var(--border-radius-full);
}

.dd-bar-label {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.drawdown-empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Actionable Trading Coach Rules */
.coach-section-header {
    margin-top: 24px;
    margin-bottom: 12px;
}

.coach-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.coach-rule-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    transition: transform var(--transition-normal);
}

.coach-rule-card:hover {
    transform: translateY(-2px);
}

.rule-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rule-icon-box svg {
    width: 18px;
    height: 18px;
}

.rule-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rule-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.rule-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Specific rule colors */
.rule-success {
    border-left: 4px solid var(--color-win);
}

.rule-success .rule-icon-box {
    background: var(--color-win-bg);
    color: var(--color-win);
}

.rule-danger {
    border-left: 4px solid var(--color-loss);
}

.rule-danger .rule-icon-box {
    background: var(--color-loss-bg);
    color: var(--color-loss);
}

.rule-caution {
    border-left: 4px solid var(--color-note);
}

.rule-caution .rule-icon-box {
    background: var(--color-note-bg);
    color: var(--color-note);
}

.rule-info {
    border-left: 4px solid var(--accent-blue);
}

.rule-info .rule-icon-box {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

/* Trading Systems Tab & Dashboard */
.systems-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.system-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    transition: transform var(--transition-normal), border-color var(--transition-fast);
}

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

.system-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.system-header-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.system-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.system-tag-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 600;
    background-color: var(--color-setup-bg);
    color: var(--color-setup);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 2px 8px;
    border-radius: var(--border-radius-full);
    text-transform: uppercase;
}

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

.system-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-md);
    padding: 12px;
}

.system-stat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.system-stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.system-stat-val {
    font-size: 13.5px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.system-params-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 14px;
}

.system-param-badge {
    font-size: 10.5px;
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 4px;
}

.system-param-badge svg {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

.system-motivation-box {
    background: rgba(59, 130, 246, 0.03);
    border-left: 2px solid var(--accent-blue);
    padding: 10px 12px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-motivation-item {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.system-motivation-item strong {
    color: var(--text-primary);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: block;
    margin-bottom: 2px;
}

.system-rules-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.system-rule-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-rule-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.system-rule-label svg {
    width: 14px;
    height: 14px;
    color: var(--accent-blue);
}

.system-rule-list {
    list-style: none;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.system-rule-item {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    position: relative;
}

.system-rule-item::before {
    content: "•";
    color: var(--accent-blue);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    position: absolute;
}

.systems-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    min-height: 350px;
}

.systems-empty-icon-box {
    background: var(--color-setup-bg);
    border-radius: 50%;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--color-setup);
}

.systems-empty-icon-box svg {
    width: 36px;
    height: 36px;
}

/* Responsive Overrides */
@media (max-width: 900px) {
    .insights-pillars-grid {
        grid-template-columns: 1fr;
    }
    .diagnostics-grid {
        grid-template-columns: 1fr;
    }
    .mood-metrics-row {
        grid-template-columns: 1fr;
    }
    .coach-rules-grid {
        grid-template-columns: 1fr;
    }
    .systems-grid {
        grid-template-columns: 1fr;
    }
}

.trade-risk-display {
    font-size: 0.8rem;
    margin-top: 4px;
    font-weight: 500;
    min-height: 18px;
    transition: color 0.2s ease-in-out;
}

.trade-risk-display.high-risk {
    color: #ef4444 !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Taxes Settings Table Styles */
#settings-viewport-taxes .ledger-table input,
#settings-viewport-taxes .ledger-table select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 13px;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#settings-viewport-taxes .ledger-table input:focus,
#settings-viewport-taxes .ledger-table select:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

#settings-viewport-taxes .ledger-table td {
    padding: 8px 12px;
}

#settings-viewport-taxes .delete-tax-row-btn {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-loss);
    cursor: pointer;
    transition: all var(--transition-fast);
}

#settings-viewport-taxes .delete-tax-row-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-loss);
}

/* CSV Drag and Drop Zone */
.csv-dropzone-container {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--border-radius-md);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.csv-dropzone-container:hover,
.csv-dropzone-container.dragover {
    border-color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.05);
}

.csv-dropzone-container .upload-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-blue);
    opacity: 0.8;
}

.csv-dropzone-container .upload-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.csv-dropzone-container .browse-link {
    color: var(--accent-blue);
    text-decoration: underline;
}

#csv-mapping-tbody select,
#csv-mapping-tbody input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-main);
    border-radius: var(--border-radius-sm);
    padding: 6px 10px;
    font-size: 0.85rem;
    width: 100%;
}

#csv-mapping-tbody select:focus {
    border-color: var(--accent-blue);
    outline: none;
}

/* ==========================================================================
   SYMBOL AUTOCOMPLETE & LIVE PRICE CHIP STYLES
   ========================================================================== */

.symbol-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(26, 27, 37, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    margin-top: 5px;
}

.symbol-autocomplete-dropdown.hidden {
    display: none;
}

.symbol-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--transition-fast);
}

.symbol-autocomplete-item:hover,
.symbol-autocomplete-item.active {
    background: var(--accent-blue-glow);
}

.symbol-autocomplete-item strong {
    font-family: monospace;
}

.symbol-exchange-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.symbol-exchange-badge.badge-nse {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.symbol-exchange-badge.badge-bse {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.12);
    border: 1px solid rgba(236, 72, 153, 0.25);
}

.symbol-exchange-badge.badge-lse {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.symbol-exchange-badge.badge-us {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.symbol-exchange-badge.badge-crypto {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.symbol-exchange-badge.badge-future {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.symbol-exchange-badge.badge-forex {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Pulsing Live Price Badge */
.live-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-win);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--border-radius-full);
    padding: 2px 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.live-price-badge:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.live-price-badge:active {
    transform: scale(0.97);
}

.live-price-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-win);
    display: inline-block;
    animation: pricePulse 1.5s infinite;
}

@keyframes pricePulse {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ==========================================================================
   APP LOCK SCREEN STYLES
   ========================================================================== */

.lock-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 17, 26, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.lock-screen-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lock-container {
    width: 100%;
    max-width: 360px;
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.lock-icon-wrapper {
    transition: transform 0.3s ease;
}

.lock-icon-wrapper:hover {
    transform: scale(1.05);
}

.pin-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    background: transparent;
    transition: all 0.15s ease;
}

.pin-dot.filled {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue-glow);
    transform: scale(1.1);
}

.keypad-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: white;
    font-size: 20px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    outline: none;
}

.keypad-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color-hover);
    transform: scale(1.05);
}

.keypad-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.keypad-btn.text-btn {
    border: none;
    background: transparent;
    font-size: 11px;
    color: var(--text-secondary);
}

.keypad-btn.text-btn:hover {
    background: transparent;
    color: var(--text-primary);
    transform: none;
}

.keypad-btn.text-btn:active {
    transform: none;
}

.text-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.text-link-btn:hover {
    color: var(--text-primary) !important;
    text-decoration: underline;
}

.shake-anim {
    animation: lock-shake 0.5s ease-in-out;
}

@keyframes lock-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* ==========================================================================
   NETWORK & DATABASE STATUS STYLES
   ========================================================================== */

.header-avatar-btn {
    border: 2px solid transparent;
    padding: 2px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast) !important;
}

.header-avatar-btn.status-online {
    border-color: var(--color-win);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.header-avatar-btn.status-offline {
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.connection-status-tooltip {
    position: absolute;
    top: 48px;
    right: 0;
    width: 240px;
    background: rgba(20, 20, 25, 0.9) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.connection-status-tooltip.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.status-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.status-tooltip-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.status-tooltip-value {
    font-weight: 600;
    text-align: right;
}

.text-orange {
    color: #f59e0b !important;
}

/* ==========================================================================
   ANNOUNCEMENT / BELL NOTIFICATION SYSTEM
   ========================================================================== */

/* Red badge counter on the bell icon */
.bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--bg-secondary);
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bell-badge.hidden {
    display: none;
}

@keyframes badge-pop {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.25); }
    100% { transform: scale(1); opacity: 1; }
}

/* Wrapper so bell button can have position:relative for badge */
.bell-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bell-btn-wrapper .icon-btn {
    position: relative;
}

/* Announcement panel — glassmorphic dropdown */
.announcement-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    z-index: 1100;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.announcement-panel.announcement-panel-visible {
    opacity: 1;
    transform: translateY(0);
}

.announcement-panel.hidden {
    display: none !important;
}

/* Panel header bar */
.announcement-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* "Mark all read" button in panel header */
.announcement-mark-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.announcement-mark-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Scrollable list area */
.announcement-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.announcement-list::-webkit-scrollbar { width: 4px; }
.announcement-list::-webkit-scrollbar-track { background: transparent; }
.announcement-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* Individual announcement card */
.announcement-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
    transition: background var(--transition-fast);
}

.announcement-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Unread item highlight */
.announcement-item.announcement-unread {
    background: rgba(99, 102, 241, 0.06);
}

/* Header row: type badge + date */
.announcement-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

/* Colored type pill badge */
.announcement-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
}

/* Date label */
.announcement-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Title */
.announcement-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.4;
}

/* Message body */
.announcement-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Empty state */
.announcement-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.82rem;
    gap: 4px;
}

