/* Net Worth Tracker Styles */
.networth-tracker-container {
    padding: 20px;
    background: var(--gray-50);
    min-height: 100%;
}

/* Summary Bar */
.networth-summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.networth-summary-bar .summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.networth-summary-bar .summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.networth-summary-bar .summary-label {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.networth-summary-bar .summary-value {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.networth-summary-bar .summary-icon {
    font-size: 32px;
    opacity: 0.8;
}

/* Description Section */
.networth-description {
    background: linear-gradient(135deg, var(--brand-100) 0%, var(--brand-100) 100%);
    border-left: 4px solid var(--brand-600);
    padding: 20px 24px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.networth-description p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--brand-700);
}

.networth-description strong {
    color: var(--brand-700);
    font-weight: 600;
}

/* Graph Controls */
.networth-graph-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
}

/* Graph type selector buttons container */
.graph-type-selector {
    display: flex;
    gap: 0;  /* No gap - buttons handle their own spacing */
    align-items: center;
}

/* Individual graph buttons */
.networth-graph-button {
    /* Styles are applied inline via JavaScript to match GraphNew exactly */
}

/* Remove focus outline and add focus shadow instead */
.networth-graph-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.graph-actions {
    display: flex;
    gap: 10px;
}

/* Graph Container */
.networth-graph-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Change the height value below to adjust the graph height */
/* Using clamp(min, preferred, max) with vh for responsive height */
#networthChart {
    max-width: 100%;
    height: clamp(400px, 50vh, 800px) !important;  /* Min: 400px, Preferred: 50% viewport, Max: 800px */
}

/* Snapshots Section */
.networth-snapshots-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.networth-snapshots-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-300);
}

.networth-snapshots-section h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Snapshots Table */
.networth-snapshots-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 450px);
    min-height: 300px;
}

.networth-snapshots-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.networth-snapshots-table thead {
    background-color: var(--gray-600) !important;
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-800) 100%) !important;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.networth-snapshots-table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.networth-snapshots-table thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.networth-snapshots-table thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

.networth-snapshots-table th {
    padding: 0.625rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    letter-spacing: 0.025em;
    font-size: 0.8125rem;
    text-transform: uppercase;
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background-color: var(--gray-600);
}

.networth-snapshots-table th.text-right {
    text-align: right;
}

.networth-snapshots-table tbody tr {
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.networth-snapshots-table tbody tr:nth-child(even) {
    background-color: rgba(249, 250, 251, 0.4);
}

.networth-snapshots-table tbody tr:last-child {
    border-bottom: none;
}

.networth-snapshots-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.networth-snapshots-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.networth-snapshots-table td {
    padding: 0.5rem 1.25rem;
    color: var(--gray-900);
    font-size: 0.9375rem;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

.networth-snapshots-table td.text-right {
    text-align: right;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    background: linear-gradient(90deg, transparent 0%, rgba(249, 250, 251, 0.5) 100%);
}

.snapshot-date-cell {
    font-weight: 500;
    white-space: nowrap;
}

.snapshot-date-cell > div {
    display: inline;
}

.snapshot-time {
    font-size: 11px;
    color: var(--gray-600);
    margin-left: 6px;
}

.positive-change {
    color: var(--success-600);
    font-weight: 500;
}

.negative-change {
    color: var(--danger-600);
    font-weight: 500;
}

.snapshot-actions-cell {
    text-align: center;
    white-space: nowrap;
}

.snapshot-actions-cell .btn-icon {
    padding: 4px 8px;
    margin: 0 2px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.snapshot-actions-cell .btn-icon:hover {
    background: var(--gray-100);
}

.snapshot-actions-cell .btn-icon.btn-danger {
    color: var(--danger-600);
}

.snapshot-actions-cell .btn-icon.btn-danger:hover {
    background: var(--danger-600);
    color: white;
}

/* No Snapshots Message */
.no-snapshots-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-600);
}

.no-snapshots-message i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 10px;
    display: block;
}

.no-snapshots-message p {
    margin: 10px 0 0 0;
    font-size: 14px;
}

/* Button Styles */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.info-color {
    color: var(--brand-600);
}

/* Account History Section (Spreadsheet View) */
.networth-account-history-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.networth-account-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-300);
}

.networth-account-history-section h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Account History Table */
.networth-account-history-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    max-height: calc(100vh - 450px);
    min-height: 300px;
}

.networth-account-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.networth-account-history-table thead {
    background-color: var(--brand-700) !important;
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-700) 100%) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.networth-account-history-table th {
    padding: 0.625rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    letter-spacing: 0.025em;
    font-size: 0.75rem;
    text-transform: uppercase;
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.networth-account-history-table th.sticky-col {
    position: sticky !important;
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-700) 100%) !important;
    z-index: 11 !important;
}

.networth-account-history-table th.sticky-col:nth-child(1) {
    left: 0 !important;
}

.networth-account-history-table th.sticky-col:nth-child(2) {
    left: 100px !important;
}

.networth-account-history-table th.sticky-col:nth-child(3) {
    left: 180px !important;
}

.networth-account-history-table th.date-col {
    text-align: right;
    padding-right: 1.25rem;
}

.networth-account-history-table tbody tr {
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.networth-account-history-table tbody tr:nth-child(even) {
    background-color: rgba(249, 250, 251, 0.4);
}

.networth-account-history-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.networth-account-history-table td {
    padding: 0.5rem 1rem;
    color: var(--gray-900);
    font-size: 0.8125rem;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

.networth-account-history-table td.sticky-col {
    position: sticky !important;
    background: white;
    z-index: 5 !important;
}

.networth-account-history-table tbody tr:nth-child(even) td.sticky-col {
    background: rgba(249, 250, 251, 0.4);
}

.networth-account-history-table tbody tr:hover td.sticky-col {
    background: rgba(59, 130, 246, 0.05);
}

.networth-account-history-table td.sticky-col:nth-child(1) {
    left: 0 !important;
}

.networth-account-history-table td.sticky-col:nth-child(2) {
    left: 100px !important;
}

.networth-account-history-table td.sticky-col:nth-child(3) {
    left: 180px !important;
}

.networth-account-history-table .category-cell {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-right: 2px solid rgba(229, 231, 235, 0.8);
}

.networth-account-history-table .category-investment {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    color: var(--brand-700);
}

.networth-account-history-table .category-asset {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
    color: var(--success-700);
}

.networth-account-history-table .category-liability {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%);
    color: var(--danger-700);
}

.networth-account-history-table .owner-cell {
    font-weight: 500;
    color: var(--gray-600);
    font-size: 0.75rem;
}

.networth-account-history-table .account-cell {
    font-weight: 500;
    min-width: 150px;
    border-right: 1px solid rgba(229, 231, 235, 0.5);
}

.networth-account-history-table .value-cell {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.8125rem;
    padding-right: 1.25rem;
    white-space: nowrap;
}

.networth-account-history-table .value-cell.empty-cell {
    color: var(--gray-600);
    font-weight: 400;
}

.networth-account-history-table .value-cell.value-increase {
    background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.08) 100%);
    color: var(--success-700);
}

.networth-account-history-table .value-cell.value-decrease {
    background: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.08) 100%);
    color: var(--danger-700);
}

/* Tab Navigation */
.networth-tabs-container {
    background: white;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.networth-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.networth-tab-button {
    padding: 12px 20px;
    border: none;
    background: var(--gray-100);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.networth-tab-button i {
    font-size: 16px;
}

.networth-tab-button:hover {
    background: var(--gray-300);
    color: var(--gray-800);
}

.networth-tab-button.active {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

.networth-tab-button.active:hover {
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-700) 100%);
}

.networth-tab-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Tab Content */
.networth-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.networth-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .networth-summary-bar {
        grid-template-columns: 1fr;
    }

    .networth-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .networth-tab-button {
        width: 100%;
        justify-content: center;
        padding: 14px 16px;
    }

    .networth-graph-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .networth-snapshots-section .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .networth-account-history-section .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .networth-account-history-table {
        font-size: 0.75rem;
    }

    .networth-account-history-table th,
    .networth-account-history-table td {
        padding: 0.4rem 0.6rem;
    }
}