:root {
    --bg-main: #0e0522ff;
    --bg-card: #201733ff;
    --bg-input: #30091cff;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0cb;
    --text-header: #a0a0a0cb;
    --accent: #e44528ff;
    --accent-hover: #f68b33ff;
    --accent-secondary: rgb(237, 175, 60);
    --accent-secondary-hover: rgb(237, 222, 60);
    --accent-smartadvisor: #c12759ff;
    --border-color: #333;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.5);

    /* Additional colors found in JS files */
    --bg-dropdown: #2c2c35;
    --bg-dropdown-hover: #333;
    --text-success: #10b981;
    --text-error: #ef4444;
}

/* Global Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: opacity 0.2s, color 0.2s;
}

a:hover {
    opacity: 0.8;
    color: var(--accent-hover);
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--bg-card);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* position: sticky; top: 0; z-index: 100; - from home.css */
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    /* from donations.css */
}

.header-transparent {
    background-color: transparent;
    box-shadow: none;
    border-bottom: none;
    margin-left: 0px;
    margin-right: 0px;
    padding-left: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
}

/* Header Variants */
.header-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
}

.logo-light {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    background-color: var(--accent);
    color: white;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(126, 87, 194, 0.2);
    color: white !important;
    opacity: 1;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #555;
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(126, 87, 194, 0.1);
}

.nav-buttons .btn {
    margin-left: 10px;
}

/* User Controls (Header) */
#user-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    align-self: flex-end;
}

#user-controls .btn {
    padding: 8px 12px;
    font-size: 14px;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--text-header);
    gap: 0;
}

#welcomeMsgDesktop {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-top: 16px;
}

#welcomeMsgMobile {
    display: none;
    font-weight: 300;
    font-size: small;
    color: var(--text-main);
}

/* Hero Section (Home) */
.hero {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #e0e0e0 0%, #e6542aff 50%, #bc1d77ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 20px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.hero-actions .btn {
    font-size: 16px;
    padding: 12px 24px;
}

/* Features Grid (Home) */
.features {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: #444;
}

.icon {
    font-size: 32px;
    margin-bottom: 20px;
    display: inline-block;
    padding: 12px;
    background: rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-main);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

.feature-card.layout-horizontal {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 20px;
}

.feature-card.layout-horizontal h3 {
    margin-top: 0;
}

/* Social Proof / Stats (Home) */
.social-proof {
    background: var(--bg-card);
    padding: 60px 20px;
    margin-top: 80px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.stat-item h2 {
    font-size: 36px;
    color: var(--accent);
    margin-bottom: 5px;
}

.stat-item p {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 600;
}

/* Footer (Home) */
footer {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
    margin-top: 60px;
}

footer a {
    color: var(--accent);
}

/* Portfolio Stats Overview */
.portfolio-stats-section {
    margin-bottom: 30px;
}

.portfolio-header {
    margin-bottom: 20px;
}

.portfolio-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

.stats-row-top {
    display: grid;
    grid-template-columns: 2.05fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stats-row-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {

    .stats-row-top,
    .stats-row-bottom {
        grid-template-columns: 1fr;
    }
}

.stat-card-new {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.stat-title {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 600;
    margin: 0;
}

.stat-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-badge.negative {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.stat-badge.positive {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.stat-value-large {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-value-medium {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-subtext {
    font-size: 13px;
    color: var(--text-muted);
}

/* Specific impact list styling */
.impact-list-preview {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-main);
}

.impact-item-preview {
    margin-bottom: 4px;
    font-weight: 500;
}

.impact-item-preview span {
    color: var(--text-header);
}

.see-more-btn {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    display: inline-block;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card,
.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-main);
}

.impact-value {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Auth Pages */
.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.auth-header-logo {
    margin-bottom: 24px;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
    height: 720px;
    max-height: 60vh;
}

.chart-card {
    background: var(--bg-card);
    padding: 20px 20px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border-color);
}

.chart-card canvas {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.chart-card h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-main);
}

.recommendation-section-card {
    background: var(--bg-card);
    padding: 20px 20px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.recommendation-section-card h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-main);
}

.log-donation-card {
    background: var(--bg-card);
    padding: 20px 20px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border-color);
}

.log-donation-card canvas {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.log-donation-card h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-main);
}

/* Tooltips */
.tooltip-icon {
    display: inline-block;
    margin-left: 5px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8em;
    position: relative;
    vertical-align: middle;
    text-transform: none;
}

.tooltip-icon:hover {
    color: var(--text-main);
}

.tooltip-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-input);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: normal;
    width: 250px;
    text-align: center;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-weight: normal;
    line-height: 1.4;
    text-transform: none;
    border: 1px solid var(--border-color);
}

.tooltip-icon[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-color);
    margin-bottom: -4px;
    z-index: 1000;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

th.causes-col,
td.causes-col {
    max-width: 180px;
    width: 180px;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

th {
    background: #27272a;
    font-weight: 600;
    color: var(--text-muted);
}

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

.donation-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.donation-row:hover {
    background: #2c2c35;
}

.impact-details {
    display: none;
    background: #2c2c35;
}

.impact-details.show {
    display: table-row;
}

.impact-details td {
    padding: 20px 15px;
}

.impact-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.impact-metric {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.impact-metric-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-secondary);
}

.impact-metric-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 5px;
}

.expand-icon {
    float: right;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.expand-icon.rotate {
    transform: rotate(90deg);
}

.see-more-link {
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.see-more-link:hover {
    text-decoration: underline;
}

.all-impact-metrics {
    display: none;
    margin-top: 10px;
    padding: 10px 0;
}

.all-impact-metrics.show {
    display: block;
}

.impact-metric-item {
    padding: 5px 0;
    font-size: 14px;
    color: var(--text-main);
}

.impact-metric-item span {
    font-weight: bold;
    color: var(--accent-secondary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: var(--text-main);
}

.modal-content h2 {
    margin-top: 0;
    color: var(--text-main);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-main);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-input);
    color: var(--text-main);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.error {
    color: var(--text-error);
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

.success {
    color: var(--text-success);
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

.message {
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

/* Action Buttons */
.action-btn {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.action-btn svg {
    width: 18px;
    height: 18px;
}

/* New classes for elements that were using inline styles in JS */
.dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-dropdown);
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #444;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.dropdown-item-add {
    font-size: 13px;
    padding: 6px 10px;
    color: var(--accent);
    cursor: pointer;
    border-bottom: 1px solid #444;
    background: #25252b;
    text-align: center;
}

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

.dropdown-no-results {
    padding: 8px;
    color: #555;
    background: var(--bg-card);
    /* Fallback */
}

/* Pie Chart Visual (Home) */
.chart-visual {
    width: 60px;
    height: 60px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: chartEntrance 1s ease-out forwards;
    opacity: 0;
    transform: scale(0.5);
}

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

.chart-segment {
    fill: none;
    stroke-width: 18;
}

@keyframes chartEntrance {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-90deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.feature-card .chart-visual {
    display: inline-block;
    flex-shrink: 0;
}

/* Trend Line Visual (Home) */
.trend-visual {
    width: 60px;
    height: 60px;
    position: relative;
    background: var(--bg-main);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
}

.trend-svg {
    width: 100%;
    height: 100%;
}

.trend-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawPath 1.2s ease-out 0.3s forwards;
    stroke: var(--accent);
}

.arrow-head {
    opacity: 0;
    animation: showArrow 0.2s ease-out 1.0s forwards;
    stroke: var(--accent);
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes showArrow {
    from {
        opacity: 0;
        transform: scale(0);
        transform-origin: 50px 17px;
    }

    to {
        opacity: 1;
        transform: scale(1);
        transform-origin: 50px 17px;
    }
}

/* Discover Causes Visual (Home) */
.discover-visual {
    width: 60px;
    height: 60px;
    position: relative;
    background: var(--bg-main);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
}

.post-type-modal-card-visual {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
    align-items: center;
}

.micro-card {
    width: 32px;
    height: 8px;
    background: #333;
    border-radius: 2px;
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    animation: cardSlideIn 0.5s ease-out forwards;
}

.micro-card:nth-child(1) {
    animation-delay: 0.2s;
    width: 28px;
}

.micro-card:nth-child(2) {
    animation-delay: 0.4s;
    width: 34px;
    background: #444;
    border: 1px solid #555;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.micro-card:nth-child(3) {
    animation-delay: 0.6s;
    width: 30px;
}

.match-badge {
    pointer-events: none;
    position: absolute;
    right: -4px;
    top: -4px;
    width: 6px;
    height: 6px;
    background: var(--accent-secondary);
    border-radius: 50%;
    border: 1px solid var(--bg-main);
    opacity: 0;
    transform: scale(0);
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.9s forwards;
}

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

@keyframes badgePop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.feature-card .discover-visual {
    display: inline-block;
    border: 1px solid var(--border-color);
    display: flex;
}

/* Responsive */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 36px;
    }

    .stats-container {
        gap: 30px;
    }

    .charts-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }

    .chart-card {
        height: 400px;
    }

    .log-donation-card {
        height: 100px;
    }
}

@media (max-width: 576px) {

    /* Reduce padding to give more width to cards */
    .container {
        padding: 10px;
    }

    .stat-card,
    .card,
    .chart-card,
    .recommendation-section-card,
    .log-donation-card {
        padding-left: 10px;
        padding-right: 10px;
    }

    .home-page header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .home-page .logo {
        font-size: 18px;
    }

    .home-page .nav-buttons .btn {
        padding: 6px 10px;
        font-size: 12px;
        margin-left: 4px;
    }

    #welcomeMsgDesktop {
        display: none;
    }

    #welcomeMsgMobile {
        display: block;
        margin-top: 10px;
        flex-grow: 1;
        text-align: left;
        font-size: 24px;
        font-weight: 700;
        color: #ffffff;
        line-height: 1.2;
    }

    h1 {
        margin-bottom: 15px;
        font-size: 20px;
    }

    .modal-content {
        max-width: 80%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 28px;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-card {
        height: 300px;
    }

    .log-donation-card {
        height: 100px;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    table {
        border: none;
        box-shadow: none;
        background: transparent;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-card);
        box-shadow: var(--shadow-card);
    }

    td {
        padding: 10px 15px;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
        position: relative;
        font-size: 14px;
        color: var(--text-main);
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
        color: var(--text-muted);
    }

    td:last-child {
        border-bottom: none;
    }

    th.causes-col,
    td.causes-col {
        width: 100%;
        max-width: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* .user-name {
        display: block;
    } */
}

/* --- Wizard / Get Started Styles --- */
.wizard-container {
    max-width: 800px;
    margin: 50px auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #333;
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    padding: 0 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.step.active {
    color: var(--accent);
    font-weight: bold;
}

.step.completed {
    color: #27ae60;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

.category-grid,
.causes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.causes-category-header {
    color: var(--text-main);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    font-size: 1.17em;
    /* Default h3 size or custom */
    font-weight: bold;
}

.selection-card {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
    font-weight: 500;
    color: var(--text-main);
}

.selection-card:hover {
    border-color: var(--accent);
    background: #2c2c35;
}

.selection-card.selected {
    border-color: var(--accent);
    background: rgba(126, 87, 194, 0.2);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(126, 87, 194, 0.2);
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.step-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-main);
}

.step-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: #2c2c35;
    border-radius: 8px;
}

.btn-secondary {
    background-color: #444;
    color: var(--text-main);
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

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

/* --- Admin Dashboard Styles --- */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.search-section {
    margin-bottom: 2rem;
}

.results-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.result-item {
    padding: 1rem;
    border: 1px solid #ddd;
    margin-bottom: 0.5rem;
    cursor: pointer;
    background: white;
    border-radius: 4px;
    color: #333;
    /* Override dark mode for admin panel items if needed, or adjust to dark mode */
}

/* Adapting admin to dark mode to match the app */
.result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.result-item:hover {
    background: #2c2c35;
    border-color: var(--accent);
}

.edit-section {
    display: none;
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

/* KPI Cards */
.kpi-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

/* Admin Nav */
nav.admin-nav {
    background: #333;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav.admin-nav a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
}

/* --- Profile Tabs Styles --- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s, border-color 0.2s;
}

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

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

.tab-content {
    display: none;
}

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

/* --- New Sidebar Navigation Styles --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    box-sizing: border-box;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-logo {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-toggle:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background-color: rgba(228, 69, 40, 0.1);
    color: var(--accent);
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-text {
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

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

.main-content {
    flex-grow: 1;
    width: 0;
    /* Ensures flex child doesn't overflow */
    display: flex;
    flex-direction: column;
}

/* Update container to fit in main-content */
.main-content .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Mobile Sidebar Specifics */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 1001;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px;
    }

    .sidebar.collapsed {
        width: 100%;
        height: auto;
        overflow: visible;
        padding-bottom: 0;
    }

    .sidebar.collapsed .sidebar-nav,
    .sidebar.collapsed .sidebar-footer {
        display: none;
    }

    .sidebar-header {
        width: 100%;
        height: 70px;
        padding: 0 20px;
    }

    /* Override hidden logo on mobile */
    .sidebar.collapsed .sidebar-logo {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .sidebar-nav {
        flex-direction: column;
        padding-bottom: 20px;
    }

    .nav-item {
        font-size: 16px;
        padding: 15px;
        justify-content: flex-start;
    }

    .nav-icon {
        margin-right: 16px;
    }

    .sidebar-footer {
        display: flex;
    }
}

/* Stats List Styles */
.stats-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.stats-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.stats-list-name {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.stats-list-value {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-btn {
    padding: 6px 16px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.toggle-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.allocation-legend {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.actual {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.legend-color.target {
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Allocation Bars Styles */
.allocation-bars-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.allocation-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.allocation-bars-wrapper {
    flex: 1;
}

.allocation-bar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-container {
    height: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.actual-bar {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    box-shadow: 0 0 10px rgba(228, 69, 40, 0.3);
}

.target-bar {
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.bar-value {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .allocation-row {
        flex-direction: row;
        align-items: center;
    }

    .allocation-label {
        width: 180px;
        text-align: right;
        padding-right: 20px;
    }
}