/* ============================================
   DASHBOARD STYLES
   Financial dashboard overlay and popups
   ============================================ */

/* Dashboard Toggle Button */
.dashboard-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.dashboard-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.6);
}

.dashboard-toggle-btn .dashboard-icon {
    font-size: 20px;
}

/* Dashboard Overlay */
.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dashboard-container {
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 30px;
    position: relative;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.dashboard-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dashboard-close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

.dashboard-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Dashboard Content Layout */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.dashboard-top-row {
    display: flex;
    gap: 25px;
}

/* Dashboard Cards */
.dashboard-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

/* Overview Card */
.overview-card {
    flex: 1;
    display: flex;
    gap: 20px;
}

.overview-avatar {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.overview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overview-avatar .avatar-fallback {
    font-size: 48px;
}

.overview-details {
    flex: 1;
}

.overview-details h3 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 10px;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    color: #b8c5d6;
    font-size: 14px;
}

.overview-row .label {
    color: #8892a0;
}

.overview-row .value {
    font-weight: 600;
    color: #fff;
}

.overview-row .value.money {
    color: #2ecc71;
}

.overview-row.highlight .value {
    color: #f39c12;
    font-weight: 700;
}

.overview-row.debt .value {
    color: #e74c3c;
}

.overview-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

/* Goals Card */
.goals-card {
    flex: 0.8;
    min-width: 280px;
}

.goals-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
}

.goals-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.goal-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.goal-item:hover { background: rgba(255, 255, 255, 0.08); }

.goal-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.goal-chevron {
    margin-left: 4px;
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    transition: transform 0.25s ease;
}
.goal-item.expanded .goal-chevron,
.goal-item:hover .goal-chevron {
    transform: rotate(180deg);
}

/* Body is collapsed by default — only the title row shows. Hover or
   click expands it. max-height keeps the transition smooth. */
.goal-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}
.goal-item:hover .goal-body,
.goal-item.expanded .goal-body {
    max-height: 800px;
    opacity: 1;
}
.goal-item-head .goal-icon { font-size: 20px; }
.goal-item-head .goal-text { color: #e0e6ed; font-size: 15px; font-weight: 600; flex: 1; }
.goal-item-head .goal-pct {
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(251,191,36,0.14);
    padding: 2px 8px;
    border-radius: 6px;
}
.goal-item-head .goal-badge {
    color: #4ade80;
    font-weight: 700;
    background: rgba(74,222,128,0.14);
    padding: 2px 8px;
    border-radius: 6px;
}

.goal-item.completed .goal-text {
    text-decoration: line-through;
    color: #2ecc71;
}

.goal-desc {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0;
}

.goal-item .goal-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.goal-item .goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #4ade80);
    transition: width 0.3s;
}
.goal-item .goal-progress-value {
    color: rgba(255,255,255,0.78);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
}

.goal-item .goal-specifics {
    color: rgba(255,255,255,0.72);
    font-size: 0.82rem;
    line-height: 1.45;
    border-top: 1px dashed rgba(255,255,255,0.08);
    padding-top: 8px;
}
.goal-item .goal-spec-line { margin-bottom: 3px; }
.goal-item .goal-spec-line strong { color: #fbbf24; }

.goal-fast-tip {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: rgba(251,191,36,0.08);
    border-left: 3px solid #fbbf24;
    border-radius: 6px;
    padding: 8px 10px;
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    line-height: 1.45;
}
.goal-fast-tip.highlight {
    background: rgba(251,191,36,0.16);
}
.goal-fast-tip .tip-tag {
    color: #fbbf24;
    font-weight: 700;
    white-space: nowrap;
}
.goal-fast-tip strong { color: #fff; }

/* Dashboard Action Cards */
.dashboard-bottom-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.dashboard-action-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-action-card:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dashboard-action-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-action-card.disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.action-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.action-label {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   POPUP STYLES (Shared)
   ============================================ */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.popup-container {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: linear-gradient(145deg, #1e2a3a, #1a2332);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    padding: 35px;
    position: relative;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

.popup-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

.popup-container h2 {
    color: #fff;
    font-size: 26px;
    margin-bottom: 8px;
    text-align: center;
}

.popup-subtitle {
    color: #8892a0;
    text-align: center;
    margin-bottom: 25px;
}

/* ============================================
   SALARY & TAXES (Pay Stubs)
   ============================================ */

.paystubs-container {
    max-height: 400px;
    overflow-y: auto;
}

.paystub {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.paystub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paystub-date {
    color: #8892a0;
    font-size: 14px;
}

.paystub-net {
    color: #2ecc71;
    font-size: 20px;
    font-weight: 700;
}

.paystub-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #b8c5d6;
    font-size: 14px;
}

.paystub-row.deduction .value {
    color: #e74c3c;
}

.no-paystubs {
    color: #8892a0;
    text-align: center;
    padding: 40px;
}

.paystub-info {
    color: #b8c5d6;
    text-align: center;
    margin-bottom: 15px;
}

.paystub-note {
    color: #f39c12;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

/* ============================================
   INVESTMENTS POPUP
   ============================================ */

.investment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.investment-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.investment-card:hover:not(.disabled) {
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.investment-card.disabled {
    opacity: 0.5;
}

.invest-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.investment-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
}

.invest-description {
    color: #8892a0;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.investment-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

/* ============================================
   DEBT POPUP
   ============================================ */

.debt-summary {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.debt-stat {
    text-align: center;
}

.stat-label {
    display: block;
    color: #8892a0;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-value {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.debt-list {
    max-height: 350px;
    overflow-y: auto;
}

.debt-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.debt-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.debt-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.debt-balance {
    color: #e74c3c;
    font-size: 18px;
    font-weight: 700;
}

.debt-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #8892a0;
    font-size: 13px;
}

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

.debt-payment-control label {
    color: #b8c5d6;
    font-size: 14px;
}

.debt-payment-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.debt-payment-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.debt-payment-value {
    color: #2ecc71;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

/* Where each monthly payment actually goes — principal vs interest. */
.debt-split {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.debt-split-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    margin-bottom: 12px;
}
.debt-split-fill.principal { background: #4ade80; }
.debt-split-fill.interest  { background: #f87171; }

.debt-split-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.debt-split-row {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 10px 12px;
}
.debt-split-row strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
    font-size: 0.95rem;
}
.debt-split-row p {
    margin: 0;
    color: rgba(255,255,255,0.72);
    font-size: 0.82rem;
    line-height: 1.45;
}
.debt-split-row em { font-style: italic; color: rgba(255,255,255,0.85); }
.debt-split-row .dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.debt-split-row .dot.principal { background: #4ade80; }
.debt-split-row .dot.interest  { background: #f87171; }

.debt-split-warn {
    grid-column: 1 / -1;
    background: rgba(248,113,113,0.10);
    border: 1px solid rgba(248,113,113,0.35);
    color: rgba(255,255,255,0.9);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.45;
}
.debt-split-warn em { color: #fda4af; font-style: italic; }

@media (max-width: 640px) {
    .debt-split-rows { grid-template-columns: 1fr; }
}

.no-debt {
    color: #2ecc71;
    text-align: center;
    padding: 40px;
    font-size: 16px;
}

/* ============================================
   SAVINGS POPUP
   ============================================ */

.savings-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.savings-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.savings-card h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
}

.savings-rate {
    color: #2ecc71;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.savings-card p {
    color: #8892a0;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.savings-input {
    margin-bottom: 15px;
}

.savings-input label {
    display: block;
    color: #b8c5d6;
    font-size: 12px;
    margin-bottom: 5px;
}

.savings-input input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
}

.savings-input input:focus {
    outline: none;
    border-color: #3498db;
}

.savings-card .btn-primary {
    width: 100%;
    padding: 10px;
    font-size: 13px;
}

.current-savings {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
}

.current-savings h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
}

.no-savings {
    color: #8892a0;
    text-align: center;
    padding: 20px;
}

.savings-account-item {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 8px 16px;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
}

.savings-account-main,
.savings-account-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.savings-account-side {
    text-align: right;
}

.savings-account-rate {
    color: #2ecc71;
    font-size: 12px;
    font-weight: 600;
}

.savings-account-status,
.savings-account-interest {
    color: #8892a0;
    font-size: 11px;
}

.savings-account-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.savings-inline-amount {
    flex: 1 1 120px;
    min-width: 100px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
}

.savings-inline-amount:focus {
    outline: none;
    border-color: #3498db;
}

.savings-account-actions .btn-small {
    padding: 8px 12px;
    font-size: 12px;
    width: auto;
}

.savings-plans-heading {
    color: #fff;
    font-size: 16px;
    margin: 22px 0 12px;
}

.savings-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
}

.savings-message.ok {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.35);
}

.savings-message.error {
    background: rgba(231, 76, 60, 0.15);
    color: #ff7b6b;
    border: 1px solid rgba(231, 76, 60, 0.35);
}

/* ---- Net worth breakdown (dashboard popup, end screens) ---- */
.popup-container.networth-popup {
    max-width: 720px;
}

.networth-breakdown:empty {
    display: none;
}

.nw-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: left;
}

.nw-section h4 {
    color: #b8c5d6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 8px;
}

.nw-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    margin-bottom: 6px;
}

.nw-row span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.nw-row strong {
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nw-row.nw-empty span,
.nw-row.nw-empty strong {
    color: rgba(255, 255, 255, 0.4);
}

.nw-row.nw-total {
    background: rgba(255, 255, 255, 0.08);
    margin-top: 4px;
}

.nw-row.nw-total span {
    color: #fff;
    font-weight: 600;
}

.nw-net {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.nw-net span {
    color: #fff;
    font-weight: 600;
}

.nw-net strong {
    color: #2ecc71;
    font-size: 1.4rem;
}

.nw-net.negative {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.4);
}

.nw-net.negative strong {
    color: #ff7b6b;
}

.nw-goal {
    margin-top: 14px;
}

.nw-goal-bar {
    height: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.nw-goal-fill {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #2ecc71);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.nw-goal-label {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-align: center;
}

/* ---- Salary change (raise / promotion) ---- */
.popup-container.salary-change-container {
    max-width: 640px;
    text-align: center;
}

.salary-change-table {
    margin: 16px 0 4px;
    text-align: left;
}

.sc-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.sc-row span {
    color: rgba(255, 255, 255, 0.75);
}

.sc-row strong {
    color: #fff;
}

.sc-row.sc-head {
    background: transparent;
    margin-bottom: 2px;
}

.sc-row.sc-head span {
    color: #b8c5d6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sc-row.sc-net {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.sc-row em {
    font-style: normal;
    font-weight: 600;
}

.sc-row em.up {
    color: #2ecc71;
}

.sc-row em.down {
    color: #ff7b6b;
}

.sc-note {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
}

@media (max-width: 720px) {
    .nw-columns {
        grid-template-columns: 1fr;
    }

    .savings-account-item {
        grid-template-columns: 1fr;
    }

    .savings-account-side {
        text-align: left;
    }

    .sc-row {
        grid-template-columns: 1.2fr 1fr 1fr 1fr;
        font-size: 0.8rem;
        padding: 8px;
    }
}

.savings-account-name {
    color: #fff;
    font-weight: 500;
}

.savings-account-balance {
    color: #2ecc71;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 900px) {
    .dashboard-top-row {
        flex-direction: column;
    }

    .dashboard-bottom-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .investment-options,
    .savings-options {
        grid-template-columns: 1fr;
    }

    .overview-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .overview-avatar {
        margin-bottom: 15px;
    }
}

/* Return to Simulation button style */
.btn-start-sim.return-mode {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.btn-start-sim.return-mode:hover {
    background: linear-gradient(135deg, #219a52, #27ae60);
}

@media (max-width: 600px) {
    .dashboard-bottom-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-container,
    .popup-container {
        padding: 20px;
        margin: 10px;
    }

    .debt-summary {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================
   REAL ESTATE
   ============================================ */

.popup-container.realestate-popup {
    max-width: 1200px;
}

.re-market-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.re-stat-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.re-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.re-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.re-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.re-tab:hover {
    color: #fff;
}

.re-tab.active {
    color: #fff;
    border-bottom-color: #f1c40f;
}

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

.re-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 30px;
}

.re-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.re-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #2a3a4f;
    position: relative;
}

.re-tier-badge,
.re-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
}

.re-card-distressed .re-tier-badge { background: #c0392b; }
.re-card-fair .re-tier-badge { background: #d68910; }
.re-card-pristine .re-tier-badge { background: #27ae60; }

.re-status.fixing { background: #d68910; }
.re-status.renting { background: #2980b9; }
.re-status.holding { background: #555; }

.re-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.re-card-body h3 {
    margin: 0;
    color: #fff;
    font-size: 1.15rem;
}

.re-card-desc {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.re-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    font-size: 0.85rem;
}

.re-card-stats > div {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.re-card-stats strong {
    color: #fff;
    font-weight: 600;
}

.re-card-stats strong.pos { color: #2ecc71; }
.re-card-stats strong.neg { color: #e74c3c; }

.re-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.re-card-actions button {
    flex: 1;
    padding: 10px 8px;
    font-size: 0.9rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Buy modal */
.buy-summary,
.fixup-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin: 16px 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.buy-summary > div,
.fixup-summary > div {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
}

.buy-summary strong,
.fixup-summary strong {
    color: #fff;
}

.buy-down-control label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.buy-down-control input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.buy-loan-summary {
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: rgba(255, 255, 255, 0.75);
}

.buy-loan-summary strong { color: #fff; }

.buy-error {
    color: #e74c3c;
    margin: 8px 0;
}

.fixup-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.fixup-tier {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 18px 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.fixup-tier:hover {
    background: rgba(241, 196, 15, 0.15);
    border-color: #f1c40f;
    transform: translateY(-2px);
}

.fixup-tier small {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
}

.paycheck-row.income {
    color: #2ecc71;
}

.paycheck-row.income span:last-child {
    color: #2ecc71;
    font-weight: 600;
}

@media (max-width: 720px) {
    .re-market-bar { grid-template-columns: repeat(2, 1fr); }
    .fixup-tiers { grid-template-columns: 1fr; }
    .re-card-stats { grid-template-columns: 1fr; }
}

/* Renovation plan modal — side-by-side before/after */
.popup-container.renovation-plan-modal {
    max-width: 1100px;
}

.renovation-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: stretch;
    margin: 20px 0;
}

.renovation-side {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.renovation-side h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
}

.renovation-img {
    width: 100%;
    height: 240px;
    border-radius: 10px;
    background-color: #2a3a4f;
    background-size: cover;
    background-position: center;
}

.renovation-stats {
    list-style: none;
    padding: 0;
    margin: 0;
}

.renovation-stats li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.renovation-stats strong {
    color: #fff;
}

.renovation-arrow {
    align-self: center;
    font-size: 2rem;
    color: rgba(241, 196, 15, 0.85);
    font-weight: 700;
}

.renovation-note {
    margin-top: 8px;
    padding: 14px 18px;
    background: rgba(241, 196, 15, 0.08);
    border-left: 3px solid #f1c40f;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .renovation-comparison {
        grid-template-columns: 1fr;
    }
    .renovation-arrow {
        transform: rotate(90deg);
    }
}

/* ============================================
   CAREER CHANGE OVERLAY
   ============================================ */

.popup-container.career-change-container {
    max-width: 1100px;
    text-align: center;
}

#career-change-intro .cc-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

#career-change-intro h2,
#career-change-picker h2 {
    color: #f1c40f;
    margin-bottom: 6px;
}

.cc-coach {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin: 12px auto;
    max-width: 720px;
    text-align: left;
}

#career-change-intro .btn-large {
    margin-top: 22px;
    padding: 16px 38px;
    font-size: 1.1rem;
}

.career-change-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    text-align: left;
}

.career-change-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.career-change-card .cc-trade-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.55);
}

.career-change-card .cc-same {
    background: rgba(241, 196, 15, 0.18);
    color: #f1c40f;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    margin-left: 6px;
}

.career-change-card h4 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}

.career-change-card .cc-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.4;
}

.career-change-card .cc-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    font-size: 0.85rem;
}

.career-change-card .cc-stats > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.career-change-card .cc-stats strong {
    color: #fff;
    font-weight: 600;
}

.career-change-card .cc-choose-btn {
    margin-top: auto;
    padding: 10px;
}

/* Industry filter tabs above the picker grid — compact pill row */
.cc-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-filter-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cc-filter-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.cc-filter-tab.active {
    background: rgba(241, 196, 15, 0.18);
    border-color: rgba(241, 196, 15, 0.5);
    color: #fbbf24;
    font-weight: 600;
}

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

.cc-empty {
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    padding: 30px;
    grid-column: 1 / -1;
}

.cc-free {
    color: #6ee7b7;
    font-weight: 600;
}

/* ============================================
   REAL ESTATE — OFFER MODAL EXTENSIONS
   ============================================ */

/* Mortgage Rate hover tooltip */
.rate-label-tooltip {
    color: #60a5fa;
    cursor: help;
    border-bottom: 1px dotted #60a5fa;
    position: relative;
}

.rate-label-tooltip .info-icon {
    margin-left: 4px;
    font-size: 0.85rem;
    opacity: 0.85;
}

.rate-label-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: #1e293b;
    color: #e2e8f0;
    padding: 10px 14px;
    border: 1px solid rgba(96, 165, 250, 0.4);
    border-radius: 8px;
    width: 320px;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    z-index: 1200;
    text-align: left;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.market-hot { color: #f87171; }
.market-balanced { color: #fbbf24; }
.market-slow { color: #60a5fa; }

/* Offer input + status indicator */
.offer-section {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 18px;
    margin: 16px 0;
}

.offer-section h3 {
    margin: 0 0 8px 0;
    color: #fff;
}

.offer-section .hint {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
    margin: 0 0 10px 0;
}

.offer-section input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.offer-status {
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}

.offer-status.status-accepted {
    background: rgba(46, 204, 113, 0.15);
    border-left: 4px solid #2ecc71;
    color: #6ee7b7;
}

.offer-status.status-close {
    background: rgba(241, 196, 15, 0.15);
    border-left: 4px solid #f1c40f;
    color: #fcd34d;
}

.offer-status.status-rejected {
    background: rgba(231, 76, 60, 0.15);
    border-left: 4px solid #e74c3c;
    color: #fca5a5;
}

/* Rehab loan add-on */
.rehab-loan-section {
    background: rgba(96, 165, 250, 0.06);
    border: 1px dashed rgba(96, 165, 250, 0.3);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 16px 0;
}

.rehab-loan-section label {
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rehab-loan-input {
    margin-top: 14px;
}

.rehab-loan-input input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1rem;
    margin: 8px 0;
    box-sizing: border-box;
}

.rehab-loan-input .hint {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.4;
}

/* Renovation Plan modal */
.reno-plan-controls {
    margin-top: 18px;
}

.reno-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.reno-input-row label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    flex: 1;
}

.reno-input-row input {
    width: 180px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: right;
    box-sizing: border-box;
}

.reno-projection {
    background: rgba(96, 165, 250, 0.08);
    border-left: 3px solid #60a5fa;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 14px 0;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    font-size: 0.95rem;
}

.reno-projection .reno-warning {
    margin-top: 8px;
    color: #fcd34d;
    font-size: 0.85rem;
}

.reno-error {
    color: #fca5a5;
    background: rgba(231, 76, 60, 0.1);
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
    margin: 10px 0;
}

#reno-confirm-btn {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
}

/* Renovation Complete modal */
.popup-container.reno-complete-container {
    max-width: 1100px;
    text-align: center;
}

.reno-complete-img {
    width: 100%;
    max-width: 540px;
    height: 240px;
    margin: 16px auto;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    background-color: #2a3a4f;
}

.reno-complete-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 640px;
    margin: 0 auto 24px;
    text-align: left;
}

.reno-complete-stats > div {
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 14px;
    border-radius: 10px;
}

.reno-complete-stats span {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.reno-complete-stats strong {
    color: #fff;
    font-size: 1.15rem;
}

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

.reno-choice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 22px 18px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.reno-choice-btn:hover {
    background: rgba(241, 196, 15, 0.1);
    border-color: #f1c40f;
    transform: translateY(-2px);
}

.reno-choice-btn .rc-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.reno-choice-btn h3 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 1.1rem;
}

.reno-choice-btn p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Sell Breakdown modal */
.popup-container.sell-breakdown-container {
    max-width: 700px;
}

.sell-breakdown {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 18px;
    margin: 16px 0;
}

.sb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.sb-row strong {
    font-weight: 700;
}

.sb-row.sb-positive strong { color: #6ee7b7; }
.sb-row.sb-deduct strong { color: #fca5a5; }

.sb-row.sb-total {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.sb-row.sb-total.sb-positive strong { color: #2ecc71; }
.sb-row.sb-total.sb-loss strong { color: #e74c3c; }

.sb-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
}

.sb-actions button {
    padding: 12px 28px;
    font-size: 1rem;
}

@media (max-width: 720px) {
    .reno-complete-stats,
    .reno-complete-choices {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PERSONAL LOAN SECTION (in Debt popup)
   ============================================ */

.personal-loan-section {
    margin-top: 28px;
    padding: 22px;
    background: rgba(96, 165, 250, 0.06);
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 14px;
}

.personal-loan-section h3 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 1.2rem;
}

.personal-loan-blurb {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin: 0 0 16px 0;
    font-size: 0.92rem;
}

.personal-loan-blurb strong {
    color: #fbbf24;
}

.personal-loan-budget {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.pl-budget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.pl-budget-row + .pl-budget-row {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pl-budget-row strong {
    font-weight: 700;
}

.pl-budget-row strong.pos { color: #2ecc71; }
.pl-budget-row strong.neg { color: #e74c3c; }

.personal-loan-form label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.personal-loan-form input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.personal-loan-preview {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.pl-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
}

.pl-preview-row strong { color: #fff; }
.pl-preview-row strong.pos { color: #2ecc71; }
.pl-preview-row strong.neg { color: #e74c3c; }

.pl-status {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.92rem;
}

.pl-approved {
    background: rgba(46, 204, 113, 0.15);
    border-left: 3px solid #2ecc71;
    color: #6ee7b7;
}

.pl-denied {
    background: rgba(231, 76, 60, 0.15);
    border-left: 3px solid #e74c3c;
    color: #fca5a5;
}

.personal-loan-error {
    color: #fca5a5;
    background: rgba(231, 76, 60, 0.1);
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
    margin: 10px 0;
}

#personal-loan-take-btn {
    width: 100%;
    padding: 14px;
}

#personal-loan-take-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   MY GOALS POPUP
   ============================================ */

.popup-container.goals-popup-container {
    max-width: 760px;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.goals-empty {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 30px;
}

.goal-progress-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 18px;
    transition: border-color 0.2s ease;
}

.goal-progress-card.completed {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.06);
}

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

.goal-progress-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
}

.goal-pct {
    color: #f1c40f;
    font-weight: 700;
    font-size: 0.95rem;
}

.goal-badge {
    background: rgba(46, 204, 113, 0.2);
    color: #6ee7b7;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-progress-desc {
    margin: 0 0 12px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.4;
}

.goal-progress-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #2ecc71);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.goal-progress-card.completed .goal-progress-fill {
    background: #2ecc71;
}

.goal-progress-value {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: right;
}

.goal-specifics {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
    line-height: 1.5;
}

.goal-spec-line { margin-bottom: 4px; }
.goal-spec-line strong { color: #fbbf24; }

/* HUD avatar circle: make sure the SVG fills the circle cleanly */
#hud-xogos-avatar #xogos-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: #cbd5e1;
    font-size: 0;
}

#hud-xogos-avatar #xogos-avatar-fallback svg {
    width: 100%;
    height: 100%;
}

/* When the Xogos-provided avatar URL is available, the <img> shows
   instead of the fallback — make it fill the circle and crop nicely. */
#hud-xogos-avatar #xogos-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ============================================
   STOCKS / COMMODITIES PICKER
   ============================================ */

.popup-container.invest-picker-popup {
    max-width: 1080px;
}

.invest-picker-header {
    margin-bottom: 14px;
    position: relative;
}

.invest-picker-back {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.invest-picker-back:hover { background: rgba(255,255,255,0.16); }
.invest-picker-back.hidden { display: none; }

.invest-picker-cash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
}
.invest-picker-cash-row strong { color: #4ade80; font-size: 1.05rem; }

.invest-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.invest-cat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.invest-cat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,213,79,0.55);
    background: rgba(255,213,79,0.06);
}
.invest-cat-card .invest-cat-icon { font-size: 2rem; margin-bottom: 6px; }
.invest-cat-card h3 { margin: 0 0 6px; color: #fff; font-size: 1.1rem; }
.invest-cat-card p { margin: 0; color: rgba(255,255,255,0.75); font-size: 0.9rem; line-height: 1.45; }

.invest-asset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.invest-asset-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.invest-asset-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.invest-asset-symbol {
    background: rgba(255,213,79,0.18);
    color: #fbbf24;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
}
.invest-asset-price {
    color: #4ade80;
    font-weight: 700;
    font-size: 1.05rem;
}
.invest-asset-name {
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
}
.invest-asset-desc {
    color: rgba(255,255,255,0.72);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0;
}
.invest-buy-btn { margin-top: auto; }

/* The default .btn-primary is huge (1.4rem font, 18px×60px padding) — way
   too tall for a card grid. Shrink it inside the asset card so it fits. */
.invest-asset-card .btn-primary,
.invest-asset-card .btn-secondary,
.invest-asset-card .invest-buy-btn,
.invest-asset-card .invest-sell-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    align-self: stretch;
}

/* Buy + Sell sit side-by-side at the bottom of each asset card. */
.invest-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.invest-card-actions > button { flex: 1; }
.invest-card-actions .invest-sell-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Tiny "You own N shares" line under the asset description. */
.invest-asset-owned {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.78);
    background: rgba(96, 165, 250, 0.12);
    border-left: 3px solid #60a5fa;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 4px 0 8px;
}

/* Gain / loss coloring shared by the sell summary and the live preview. */
.invest-gain.pos { color: #4ade80; }
.invest-gain.neg { color: #f87171; }

/* "Sell All" helper button inside the amount input row. */
.invest-buy-input-row .invest-sell-max {
    padding: 6px 12px;
    font-size: 0.8rem;
    margin-left: 8px;
}

/* Range tabs: 30D / 1Y / 5Y / 10Y above each chart */
.invest-range-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
    padding: 3px;
    width: fit-content;
}
.invest-range-tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.65);
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.invest-range-tab:hover { color: #fff; }
.invest-range-tab.active {
    background: rgba(255,213,79,0.22);
    color: #fbbf24;
}

/* Chart wrap — keeps the SVG sized cleanly in the card. */
.invest-chart-wrap {
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 4px;
    overflow: hidden;
}
.invest-chart-wrap.large {
    padding: 8px;
}
.invest-chart { display: block; width: 100%; height: auto; }

/* %change chip below the chart */
.invest-change-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.invest-change-chip {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}
.invest-change-chip.pos { background: rgba(74,222,128,0.16); color: #4ade80; }
.invest-change-chip.neg { background: rgba(248,113,113,0.16); color: #f87171; }

/* Buy form */
.invest-buy-form {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.invest-buy-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    padding: 10px 14px;
}
.invest-buy-summary > div {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
}
.invest-buy-summary strong { color: #fff; }

.invest-buy-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
}
.invest-buy-mode label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.invest-buy-input-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.invest-buy-input-row label {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
}
.invest-buy-input-row input {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-size: 1rem;
}

.invest-buy-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 16px;
}
.invest-buy-preview > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
    padding: 8px 10px;
}
.invest-buy-preview span {
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
}
.invest-buy-preview strong { color: #fff; font-size: 1rem; }

.invest-buy-error {
    color: #f87171;
    font-size: 0.88rem;
    margin: 0;
    min-height: 1.1em;
}

@media (max-width: 720px) {
    .invest-cat-grid,
    .invest-asset-grid,
    .invest-buy-summary,
    .invest-buy-preview {
        grid-template-columns: 1fr;
    }
}

/* "Your Current Investments" window at the top of the Investments popup. */
.invest-portfolio-section {
    margin-bottom: 22px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 18px;
}
.invest-portfolio-section h3 {
    color: #fff;
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.portfolio-empty {
    color: rgba(255,255,255,0.65);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
}

.portfolio-totals {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.portfolio-totals > div {
    flex: 1 1 220px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.78);
    font-size: 0.9rem;
    gap: 10px;
}
.portfolio-totals strong { color: #fff; }
.portfolio-totals strong.pos { color: #4ade80; }
.portfolio-totals strong.neg { color: #f87171; }

.portfolio-table-head,
.portfolio-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 0.9fr;
    gap: 10px;
    padding: 8px 12px;
    align-items: center;
}
.portfolio-table-head {
    color: rgba(255,255,255,0.55);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.portfolio-row {
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.portfolio-row .pf-name { color: #fff; font-weight: 600; }
.portfolio-row .pf-value { color: #fff; font-weight: 600; }
.portfolio-row .pf-change.pos,
.portfolio-row .pf-change-pct.pos { color: #4ade80; font-weight: 700; }
.portfolio-row .pf-change.neg,
.portfolio-row .pf-change-pct.neg { color: #f87171; font-weight: 700; }

/* ============================================
   START A BUSINESS PICKER + MY BUSINESSES
   ============================================ */

.popup-container.business-picker-popup,
.popup-container.businesses-page-popup {
    max-width: 1100px;
}

/* Businesses page tabs (Browse / My Businesses) */
.biz-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    margin-bottom: 14px;
}
.biz-tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.65);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.biz-tab:hover { color: #fff; }
.biz-tab.active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
}
.biz-tab-count {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 1px 8px;
    margin-left: 6px;
    font-size: 0.78rem;
}
.biz-tab.active .biz-tab-count {
    background: rgba(251,191,36,0.20);
    color: #fbbf24;
}

/* Image header at the top of each business card */
.biz-card-image {
    width: 100%;
    height: 110px;
    background: linear-gradient(135deg, #1e293b, #334155);
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.biz-card-image-fallback {
    /* Sits behind the background-image; only shows when the image is missing */
    font-size: 3rem;
    color: rgba(255,255,255,0.55);
}
.biz-card-image:not([style*="url"]) .biz-card-image-fallback {
    color: rgba(255,255,255,0.7);
}

.biz-group-title {
    color: #fff;
    font-size: 1rem;
    margin: 18px 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.biz-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.biz-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.biz-card.owned { opacity: 0.7; }

.biz-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.biz-icon { font-size: 1.6rem; }
.biz-name { color: #fff; font-weight: 600; font-size: 1.05rem; }

.biz-desc {
    color: rgba(255,255,255,0.72);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0;
}

.biz-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    padding: 10px 12px;
}
.biz-stats > div {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    gap: 6px;
}
.biz-stats strong { color: #fff; text-align: right; }

.biz-card .btn-primary,
.biz-card .btn-secondary {
    align-self: stretch;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
}

.biz-degree-hint {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(251, 191, 36, 0.10);
    border-left: 3px solid #fbbf24;
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* My Businesses cards inside the Investments popup */
.invest-businesses-section {
    margin-top: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 18px;
}
.invest-businesses-section h3 {
    color: #fff;
    margin: 0 0 12px;
    font-size: 1.05rem;
}
.biz-owned-card {
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.biz-overcap-alert {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(251, 146, 60, 0.18));
    border: 2px solid #ef4444;
    color: #fef3c7;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 600;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), 0 6px 18px rgba(0, 0, 0, 0.35);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.biz-overcap-alert .biz-overcap-icon {
    font-size: 2rem;
    line-height: 1;
    flex: 0 0 auto;
}
.biz-overcap-alert .biz-overcap-body { flex: 1 1 auto; }
.biz-overcap-alert .biz-overcap-title {
    color: #fca5a5;
    font-size: 1.1rem;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}
.biz-overcap-alert .biz-overcap-detail {
    color: #fef3c7;
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
    margin-top: 6px;
}
.biz-overcap-alert strong { color: #fde68a; }

@keyframes biz-overcap-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), 0 6px 18px rgba(0, 0, 0, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.28), 0 8px 22px rgba(0, 0, 0, 0.45); }
}
.biz-overcap-alert { animation: biz-overcap-pulse 2.4s ease-in-out infinite; }

.biz-off-hint {
    color: #fbbf24;
    font-size: 0.74rem;
    font-style: italic;
    margin-left: 4px;
}

/* Service add-ons (lawn business: fertilizing / leaf / snow) */
.biz-services-section {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0;
}
.biz-services-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 8px;
}
.biz-services-title small {
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
}
.biz-service-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.biz-service-row:last-child { border-bottom: none; }
.biz-service-row.on { background: rgba(74,222,128,0.06); }
.biz-service-icon { font-size: 1.1rem; }
.biz-service-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    flex: 0 0 auto;
    min-width: 130px;
}
.biz-service-meta {
    color: rgba(255,255,255,0.65);
    font-size: 0.80rem;
    flex: 1;
}
.biz-service-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.20);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.1;
    min-width: 70px;
}
.biz-service-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(96,165,250,0.5); }
.biz-service-btn-on {
    background: rgba(74,222,128,0.18);
    border-color: rgba(74,222,128,0.55);
    color: #4ade80;
}
.biz-owned-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.biz-owned-head .biz-months {
    margin-left: auto;
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
}
.biz-owned-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 14px;
    margin-bottom: 10px;
}
.biz-owned-stats > div {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.72);
    font-size: 0.85rem;
    gap: 6px;
}
.biz-owned-stats strong { color: #fff; }
.biz-owned-stats strong.pos { color: #4ade80; }
.biz-owned-stats strong.neg { color: #f87171; }
.biz-owned-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.biz-owned-actions button {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* PT / FT employee tier cards on the picker */
.biz-employee-tiers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.biz-tier-card {
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 8px 10px;
    color: rgba(255,255,255,0.78);
    font-size: 0.78rem;
    line-height: 1.4;
}
.biz-tier-card .bt-title { color: #fff; font-weight: 700; margin-bottom: 4px; font-size: 0.85rem; }
.biz-tier-card .bt-line  { color: rgba(255,255,255,0.85); margin-bottom: 4px; }
.biz-tier-card .bt-req   { color: rgba(255,255,255,0.6); font-size: 0.74rem; }

.biz-locked-btn {
    font-size: 0.78rem !important;
    line-height: 1.35;
    text-align: left;
    padding: 8px 12px !important;
}

/* Combined "can't start yet" panel — lists every blocker (cash + req)
   in one place so the player sees the full picture. */
/* Business schedule setup popup — calendar on left, info on right */
.popup-container.business-schedule-popup { max-width: 1120px; }
.bs-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    align-items: start;
}
.bs-grid-col { display: flex; flex-direction: column; gap: 10px; }
.bs-info-col {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bs-info-col h3 { color: #fff; margin: 0; font-size: 1.05rem; }
.bs-info-rules {
    display: flex; flex-direction: column; gap: 4px;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem; line-height: 1.45;
}
.bs-info-rules strong { color: #fbbf24; }

.bs-info-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.bs-stat {
    background: rgba(0,0,0,0.20);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
}
.bs-stat span { color: rgba(255,255,255,0.6); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
.bs-stat strong { color: #fff; font-size: 1rem; margin-top: 2px; }
.bs-stat strong.warn { color: #f87171; }
.bs-stat strong.ok { color: #4ade80; }

.bs-day-breakdown { display: flex; flex-direction: column; gap: 4px; }
.bs-day-breakdown strong { color: #fff; margin-bottom: 4px; font-size: 0.88rem; }
.bs-day-bar {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.18);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    position: relative;
}
.bs-day-bar.rest { border-left: 3px solid #4ade80; }
.bs-day-name { font-weight: 700; }
.bs-day-bar-fill {
    height: 6px;
    background: linear-gradient(90deg, #4ade80, #fbbf24, #f87171);
    border-radius: 3px;
}
.bs-day-hrs { color: rgba(255,255,255,0.7); white-space: nowrap; }

.bs-rest-row {
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bs-info-tip {
    margin: 0;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    line-height: 1.45;
    background: rgba(251, 191, 36, 0.10);
    border-left: 3px solid #fbbf24;
    border-radius: 4px;
    padding: 8px 10px;
}
.bs-actions { display: flex; justify-content: flex-end; }
.bs-actions button { padding: 8px 14px; font-size: 0.9rem; }

/* New hour-row classes for business-grid */
.bs-busy-self {
    background: rgba(74, 222, 128, 0.16) !important;
    border-left: 3px solid #4ade80 !important;
}
.bs-busy-other {
    background: rgba(251, 191, 36, 0.10) !important;
    border-left: 3px solid #fbbf24 !important;
}
.bs-out-of-window {
    background: rgba(0, 0, 0, 0.30) !important;
    color: rgba(255, 255, 255, 0.45) !important;
    border-left: 3px solid rgba(255,255,255,0.15) !important;
    cursor: not-allowed !important;
}

/* Business valuation + savings tiles + Sell button */
.biz-valuation-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.biz-val-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.biz-val-label { color: rgba(255,255,255,0.6); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.biz-val-amount { color: #fbbf24; font-size: 1.15rem; font-weight: 700; }
.biz-val-amount.biz-savings-amt { color: #4ade80; }
.biz-val-meta { color: rgba(255,255,255,0.55); font-size: 0.78rem; }

/* Allocation editor — single slider per business, two endpoint labels */
.biz-alloc-row {
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.biz-alloc-title {
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.biz-alloc-singlebar { display: flex; flex-direction: column; gap: 6px; }
.biz-alloc-bar-labels {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
}
.biz-alloc-personal-pct { color: #4ade80; }
.biz-alloc-savings-pct  { color: #fbbf24; }
.biz-alloc-singlebar input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: linear-gradient(90deg, #4ade80 0%, #fbbf24 100%);
    border-radius: 4px;
    outline: none;
}
.biz-alloc-singlebar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #1a237e;
    cursor: pointer;
}
.biz-alloc-bar-hint {
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
}

/* Payday popup: Business income section */
.paycheck-section-title {
    color: #fbbf24;
    font-weight: 700;
    margin: 8px 0 4px;
    font-size: 0.95rem;
}
.pay-biz-row {
    font-weight: 600;
}
.pay-biz-detail {
    padding-left: 18px !important;
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.85rem;
}

/* ============================================
   DONATIONS POPUP
   ============================================ */
.popup-container.donations-popup { max-width: 720px; }
.donations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 14px 0;
}
.donations-tile {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.donations-label { color: rgba(255,255,255,0.6); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.donations-tile strong { color: #fff; font-size: 1.15rem; }
.donations-pct { color: #f87171 !important; }
.donations-amt { color: #4ade80 !important; }
.donations-meta { color: rgba(255,255,255,0.55); font-size: 0.78rem; }

.donations-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}
.donations-slider-row input[type="range"] {
    -webkit-appearance: none;
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.10) 0%, #f87171 100%);
    border-radius: 4px;
    outline: none;
}
.donations-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 2px solid #1a237e;
    cursor: pointer;
}

.donations-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.donations-preset {
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    border-radius: 999px !important;
}
.donations-disclaimer {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    line-height: 1.45;
    background: rgba(251, 191, 36, 0.10);
    border-left: 3px solid #fbbf24;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 0;
}

@media (max-width: 540px) {
    .donations-grid { grid-template-columns: 1fr; }
}

/* ============================================
   YEAR-END TAX FORM POPUP
   ============================================ */
.popup-container.tax-form-popup { max-width: 920px; }
.tax-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.tax-section h3 {
    color: #fff;
    margin: 0 0 10px;
    font-size: 1rem;
}
.tax-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: rgba(255,255,255,0.85);
    padding: 4px 0;
    font-size: 0.92rem;
}
.tax-total {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 700;
    color: #fff;
}
.tax-total.pos { color: #4ade80; }
.tax-total.neg { color: #f87171; }

.tax-deduction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
.tax-ded-option {
    background: rgba(0,0,0,0.18);
    border: 2px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s;
}
.tax-ded-option.selected {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
}
.tax-ded-option input { margin-right: 6px; }
.tax-ded-option strong { color: #fff; font-size: 0.95rem; }
.tax-ded-amt { color: #4ade80; font-weight: 700; font-size: 1.1rem; }
.tax-ded-meta { color: rgba(255,255,255,0.6); font-size: 0.8rem; line-height: 1.4; }

.tax-final {
    background: rgba(74, 222, 128, 0.08);
    border-color: #4ade80;
}
.tax-final-amount {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin: 10px 0 6px;
    color: #fff;
}
.tax-final-amount.pos { color: #4ade80; }
.tax-final-amount.neg { color: #f87171; }
.tax-final-note {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    margin: 0;
}
.tax-actions {
    display: flex;
    justify-content: center;
}
.tax-actions button {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
}

@media (max-width: 720px) {
    .tax-deduction-grid { grid-template-columns: 1fr; }
}

.biz-sell-btn:not(:disabled) { color: #fbbf24; }

@media (max-width: 900px) {
    .bs-layout { grid-template-columns: 1fr; }
}

/* Legacy schedule-popup styles kept (unused but harmless) */
.popup-container.business-schedule-popup-old { max-width: 720px; }
.bsc-rules {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bsc-rule { color: rgba(255,255,255,0.85); font-size: 0.88rem; line-height: 1.45; }
.bsc-rule strong { color: #fbbf24; margin-right: 4px; }

.bsc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: 10px;
    margin-bottom: 14px;
}
.bsc-tile {
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bsc-label { color: rgba(255,255,255,0.6); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.bsc-tile input[type="number"] {
    background: rgba(0,0,0,0.30);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    padding: 8px 10px;
    color: #fff;
    font-size: 1.1rem;
    font-family: inherit;
}
.bsc-tile strong { color: #fff; font-size: 1.1rem; }
.bsc-tile strong.warn { color: #f87171; }
.bsc-tile strong.ok { color: #4ade80; }
.bsc-meta { color: rgba(255,255,255,0.55); font-size: 0.78rem; }

.bsc-rest-row, .bsc-weekend-row {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bsc-rest-options, .bsc-weekend-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
}
.bsc-error { color: #f87171; font-size: 0.88rem; margin: 0 0 8px; }
.bsc-actions { display: flex; justify-content: flex-end; }
#bsc-weekend-warn { color: #fbbf24; font-size: 0.85rem; }

@media (max-width: 720px) {
    .bsc-grid { grid-template-columns: 1fr; }
}

.biz-blocked-box {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.30);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.biz-block-line {
    color: #fda4af;
    font-size: 0.82rem;
    line-height: 1.4;
}
.biz-blocked-box button {
    margin-top: 4px;
    align-self: stretch;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
}

.biz-special-req {
    background: rgba(251, 191, 36, 0.10);
    border-left: 3px solid #fbbf24;
    padding: 8px 10px;
    border-radius: 4px;
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    line-height: 1.4;
}

/* Owned-business hire section */
.biz-hire-section {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0 10px;
}
.biz-hire-section-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}
.biz-hire-section-sub {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 12px;
}
.biz-hire-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.biz-hire-tile {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.biz-hire-tile.ready  { border-color: rgba(74,222,128,0.45); background: rgba(74,222,128,0.07); }
.biz-hire-tile.locked { opacity: 0.85; }
.biz-hire-tile-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.biz-hire-tile-head strong { color: #fff; font-size: 0.95rem; }
.biz-hire-pay {
    color: #4ade80;
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
}
.biz-hire-count {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
}
.biz-hire-count strong { color: #fff; font-weight: 700; }
.biz-hire-req {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.78rem;
}
.biz-hire-req .met   { color: #4ade80; font-weight: 700; }
.biz-hire-req .unmet { color: rgba(255,255,255,0.55); }
.biz-tier-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.biz-tier-actions button {
    flex: 1;
    padding: 8px 12px !important;
    font-size: 0.88rem !important;
    font-weight: 700;
}
.biz-hire-add-btn:not(:disabled) {
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
}
.biz-hire-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.biz-season-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 700;
}
.biz-season-badge.on  { background: rgba(74,222,128,0.16); color: #4ade80; }
.biz-season-badge.off { background: rgba(251,191,36,0.16); color: #fbbf24; }

@media (max-width: 720px) {
    .biz-grid,
    .biz-stats,
    .biz-owned-stats,
    .biz-employee-tiers,
    .biz-hire-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .portfolio-table-head,
    .portfolio-row {
        grid-template-columns: 1.6fr 1fr 1fr 1fr;
    }
    /* Drop the Cost Basis + Change ($) columns on narrow screens so the
       most important numbers (units, value, %change) stay visible. */
    .portfolio-table-head > div:nth-child(3),
    .portfolio-table-head > div:nth-child(5),
    .portfolio-row .pf-cost,
    .portfolio-row .pf-change {
        display: none;
    }
}

/* ============================================
   CAREERS HUB
   ============================================ */

.popup-container.careers-popup-container {
    max-width: 1100px;
}

.career-snapshot {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px 20px;
    margin: 16px 0 22px;
}

.cs-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

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

.cs-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cs-cell strong {
    color: #fff;
    font-size: 1.1rem;
}

.cs-raise-line {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    line-height: 1.5;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.cs-raise-line strong {
    color: #fbbf24;
}

.career-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.career-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 22px 18px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.career-action-btn:hover {
    background: rgba(241, 196, 15, 0.1);
    border-color: #f1c40f;
    transform: translateY(-2px);
}

.career-action-btn .ca-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.career-action-btn h3 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 1.05rem;
}

.career-action-btn p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Promotion paths grid */
.promotion-paths {
    margin-top: 14px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.promotion-paths h3 {
    color: #fff;
    margin: 0 0 4px 0;
}

.promotion-paths-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.promotion-path-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.pp-header h4 {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
}

.pp-bump {
    background: rgba(46, 204, 113, 0.18);
    color: #6ee7b7;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.pp-desc {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
    line-height: 1.45;
}

.pp-requirements {
    list-style: none;
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.pp-requirements li {
    position: relative;
    padding: 4px 0 4px 20px;
}

.pp-requirements li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: #f1c40f;
    font-weight: 700;
}

.pp-cost {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
}

.pp-cost strong { color: #fff; }

.pp-pick-btn {
    margin-top: auto;
    padding: 10px;
}

.pp-section-label {
    margin: 6px 0 -2px;
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pp-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.88rem;
}

.pp-stats-row > div {
    display: flex;
    justify-content: space-between;
}

.pp-stats-row strong { color: #fff; }
.pp-stats-row strong.pos { color: #2ecc71; }

.ap-desc {
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 12px 0;
    line-height: 1.5;
    font-size: 0.92rem;
}

.ap-progress-label {
    text-align: right;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 12px;
}

/* Active promotion plan card */
.active-promotion {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.active-promotion h3 {
    color: #fff;
    margin: 0 0 12px 0;
}

.active-promo-card {
    background: rgba(241, 196, 15, 0.06);
    border: 1px solid rgba(241, 196, 15, 0.3);
    border-radius: 12px;
    padding: 16px 18px;
}

.active-promo-card h4 {
    margin: 0 0 12px 0;
    color: #fbbf24;
}

.ap-progress-bar {
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ap-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #2ecc71);
    transition: width 0.3s ease;
}

.ap-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
}

.ap-stats > div {
    display: flex;
    justify-content: space-between;
}

.ap-stats strong { color: #fff; }
.ap-stats strong.pos { color: #2ecc71; }

#ap-cancel-btn {
    width: 100%;
}

@media (max-width: 720px) {
    .cs-row,
    .career-actions,
    .promotion-paths-grid,
    .ap-stats {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SIDE JOBS POPUP
   ============================================ */

.popup-container.sidejobs-container {
    max-width: 1200px;
}

.sidejobs-summary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 14px 0 16px;
}

.sj-summary-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 14px;
}

.sj-summary-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sj-summary-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sj-summary-cell strong {
    color: #fff;
    font-size: 1rem;
}

.sj-summary-cell strong.pos { color: #2ecc71; }

.sidejobs-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    margin-top: 10px;
}

/* === Left column: calendar === */

.sidejobs-calendar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.day-tabs {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.sj-day-tab {
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 600;
    font-size: 0.85rem;
}

.sj-day-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sj-day-tab.active {
    background: rgba(241, 196, 15, 0.18);
    border-color: rgba(241, 196, 15, 0.5);
    color: #fbbf24;
}

.hour-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 8px;
}

.sj-hour-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
}

.sj-hour-label {
    width: 64px;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    flex-shrink: 0;
}

.sj-hour-content {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
}

.sj-hour-content small {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    margin-left: 4px;
}

.sj-busy-career {
    background: rgba(231, 76, 60, 0.12);
    border-left: 3px solid #e74c3c;
}

.sj-busy-edu {
    background: rgba(168, 85, 247, 0.14);
    border-left: 3px solid #a855f7;
}

.pay-side-pos {
    color: #2ecc71;
    font-weight: 700;
}

.pay-side-neg {
    color: #e74c3c;
    font-weight: 700;
}

/* ============================================
   FAST TRACK / WHOLE LIFE MODE PICKER + TIMER
   ============================================ */

.popup-container.sim-mode-container {
    max-width: 900px;
    text-align: center;
}

.sim-mode-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 22px;
}

.sim-mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 26px 22px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.sim-mode-btn:hover {
    background: rgba(241, 196, 15, 0.1);
    border-color: #f1c40f;
    transform: translateY(-3px);
}

.sim-mode-btn .sim-mode-icon {
    font-size: 2.6rem;
    margin-bottom: 10px;
}

.sim-mode-btn h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 1.2rem;
}

.sim-mode-btn p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* HUD timer pill */
.fasttrack-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* No margin-top: it sits beside the date in .hud-status-row now, and the
       leftover margin from its stacked-row days pushed the centre column to
       68px inside a 70px bar. */
    padding: 4px 12px;
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
    border-radius: 999px;
    color: #6ee7b7;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
}

.fasttrack-timer.ft-warning {
    background: rgba(231, 76, 60, 0.18);
    border-color: rgba(231, 76, 60, 0.55);
    color: #fca5a5;
    animation: ft-pulse 1.2s ease-in-out infinite;
}

@keyframes ft-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Sleep + food meters in the HUD */
.needs-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* No margin-top: .hud-status-row places this beside the Fast Track
       clock, and .hud-center handles the vertical rhythm. */
}

.need-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #CBD5E1;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    cursor: help;
}

.need-pill.need-warn {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.55);
    color: #FCD34D;
}

.need-pill.need-due {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.6);
    color: #FCA5A5;
    animation: ft-pulse 0.9s ease-in-out infinite;
}

.need-pill.need-penalty {
    background: rgba(220, 38, 38, 0.35);
    border-color: #EF4444;
    color: #FEE2E2;
    animation: ft-pulse 0.6s ease-in-out infinite;
}

@media (max-width: 820px) {
    .need-pill .need-text { font-size: 0.7rem; }
}

/* Sleeping / eating pause */
.popup-container.needs-action-container {
    max-width: 420px;
    text-align: center;
}

.needs-action-icon {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 6px;
}

.needs-action-bar {
    height: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-top: 14px;
}

.needs-action-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #818CF8, #22C55E);
}

/* Fast Track game over modal */
.popup-container.fasttrack-gameover-container {
    max-width: 600px;
    text-align: center;
}

.ftgo-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
    text-align: left;
}

.ftgo-stats > div {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ftgo-stats span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.ftgo-stats strong {
    color: #fff;
    font-size: 1rem;
}

.ftgo-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.ftgo-actions button {
    flex: 1;
    padding: 14px 20px;
    font-size: 1rem;
}

.ftgo-note {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .sim-mode-choices,
    .ftgo-stats,
    .ftgo-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}

.sj-busy-side {
    background: rgba(46, 204, 113, 0.12);
    border-left: 3px solid #2ecc71;
}

.sj-free {
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-left-color 0.15s ease;
}

.sj-free:hover {
    background: rgba(96, 165, 250, 0.1);
    border-left-color: #60a5fa;
}

.sj-free-text {
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
}

.sj-remove-btn {
    background: rgba(231, 76, 60, 0.18);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #fca5a5;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
}

.sj-remove-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    color: #fff;
}

/* === Right column: available jobs === */

.sidejobs-available {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.sidejobs-available h3 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.05rem;
}

.sj-blurb {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0 0 12px;
}

.sj-section-label {
    color: #fbbf24;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin: 12px 0 6px;
}

.sj-section-label.sj-section-locked { color: rgba(255, 255, 255, 0.45); }

.sj-job-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.sj-job-card.locked {
    opacity: 0.55;
}

.sj-job-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.sj-job-icon { font-size: 1.4rem; }

.sj-job-text {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.sj-job-text strong { color: #fff; font-size: 0.95rem; }
.sj-job-rate { color: #2ecc71; font-weight: 700; font-size: 0.9rem; }

.sj-job-desc {
    margin: 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    line-height: 1.4;
}

.sj-job-locked {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
}

.sj-empty {
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    padding: 14px;
}

/* Add side job modal */
.popup-container.add-sidejob-container {
    max-width: 540px;
}

.add-sj-form label {
    display: block;
    margin: 12px 0 6px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.add-sj-form select,
.add-sj-form input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
}

.add-sj-preview {
    background: rgba(46, 204, 113, 0.08);
    border-left: 3px solid #2ecc71;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 14px 0;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    font-size: 0.92rem;
}

.add-sj-preview .pos { color: #2ecc71; }

.add-sj-error {
    color: #fca5a5;
    background: rgba(231, 76, 60, 0.1);
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
    margin: 8px 0;
}

#add-sj-confirm {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

@media (max-width: 800px) {
    .sj-summary-row { grid-template-columns: 1fr 1fr; }
    .sidejobs-layout { grid-template-columns: 1fr; }
}

/* ============================================
   AVATAR DROPDOWN MENU
   ============================================ */

.avatar-profile {
    position: relative;
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.avatar-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-circle .avatar-fallback {
    font-size: 20px;
}

.avatar-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 220px;
    background: linear-gradient(145deg, #1e2a3a, #1a2332);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.avatar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-header .user-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #b8c5d6;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #fff;
}

.dropdown-item.coins {
    justify-content: space-between;
    background: rgba(255, 193, 7, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item.coins:hover {
    background: rgba(255, 193, 7, 0.2);
}

.dropdown-item .coin-icon {
    font-size: 18px;
}

.dropdown-item .coin-balance {
    color: #f1c40f;
    font-weight: 700;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

.dropdown-item.logout {
    color: #e74c3c;
}

.dropdown-item.logout:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
}

/* ============================================
   MAP VIEW TOGGLE (Settings)
   ============================================ */

.map-view-toggle {
    display: flex;
    gap: 10px;
}

.map-view-btn {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #b8c5d6;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.map-view-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
}

.map-view-btn.active {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #fff;
}

.map-view-btn .view-icon {
    font-size: 24px;
    font-weight: 700;
}

.map-view-btn span:last-child {
    font-size: 12px;
}

/* ============================================
   WALKING SPEED TOGGLE (Settings)
   ============================================ */

.speed-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.speed-btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #b8c5d6;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.speed-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
}

.speed-btn.active {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #fff;
}

.speed-btn .speed-icon {
    font-size: 22px;
}

.speed-btn span:last-child {
    font-size: 12px;
    font-weight: 600;
}

/* ===========================================
   Transportation popup
   =========================================== */
.popup-container.transportation-popup {
    max-width: 1000px;
}

.tx-current-empty {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.65);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 8px 0 16px;
    font-size: 0.95rem;
}

.tx-current-card {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.30);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 8px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tx-current-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tx-current-icon { font-size: 2rem; }
.tx-current-title { color: #fff; font-weight: 600; font-size: 1.1rem; }
.tx-current-sub { color: rgba(255,255,255,0.55); font-size: 0.78rem; letter-spacing: 0.06em; }
.tx-current-body { color: rgba(255,255,255,0.85); font-size: 0.92rem; display: flex; flex-direction: column; gap: 4px; }
.tx-current-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tx-note { color: rgba(255,255,255,0.55); font-size: 0.84rem; font-style: italic; }

.tx-grid-main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.tx-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.tx-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(96, 165, 250, 0.4);
    transform: translateY(-1px);
}
.tx-card-icon { font-size: 2.2rem; }
.tx-card-title { color: #fff; font-weight: 600; font-size: 1.05rem; }
.tx-card-desc { color: rgba(255,255,255,0.72); font-size: 0.88rem; line-height: 1.45; margin: 0; }
.tx-card-disabled { opacity: 0.45; cursor: not-allowed; }
.tx-card-disabled:hover { transform: none; }

.tx-list-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 10px 0 14px;
}
.tx-back-btn { white-space: nowrap; }
.tx-list-titlebox { flex: 1; }
.tx-list-title { color: #fff; font-weight: 700; font-size: 1.15rem; }
.tx-list-sub { color: rgba(255,255,255,0.65); font-size: 0.88rem; margin-top: 2px; }

.tx-grid-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.tx-card-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tx-card-image {
    width: 100%;
    height: 130px;
    background: linear-gradient(135deg, #1e293b, #334155);
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tx-card-image-fallback {
    font-size: 3rem;
    color: rgba(255,255,255,0.55);
}
.tx-card-image[style*="url"] .tx-card-image-fallback { display: none; }

.tx-current-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #1e293b, #334155);
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tx-current-image-fallback {
    font-size: 3.4rem;
    color: rgba(255,255,255,0.55);
}
.tx-current-image[style*="url"] .tx-current-image-fallback { display: none; }

.tx-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tx-card-line { color: rgba(255,255,255,0.85); font-size: 0.92rem; }
.tx-card-line strong { color: #4ade80; }
.tx-card-line.tx-sub { color: rgba(255,255,255,0.55); font-size: 0.82rem; }
.tx-buy-btn { margin-top: 4px; }
.tx-buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.tx-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(251,191,36,0.18);
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ===========================================
   Bank Account / Transactions popup
   =========================================== */
.popup-container.transactions-popup {
    max-width: 640px;
}

.tx-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(96, 165, 250, 0.10);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 14px;
}
.tx-balance-label {
    color: #cbd5f5;
    font-size: 0.95rem;
    font-weight: 600;
}
.tx-balance-amount {
    color: #ffffff;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
}

.tx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.22);
    border-left: 4px solid #475569;
    border-radius: 8px;
    padding: 12px 14px;
}
.tx-row.tx-income  { border-left-color: #22c55e; }
.tx-row.tx-expense { border-left-color: #f87171; }

.tx-row-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tx-row-label {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.98rem;
}
.tx-row-date {
    color: rgba(203, 213, 245, 0.7);
    font-size: 0.78rem;
}

.tx-row-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.tx-row-amount {
    font-weight: 800;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}
.tx-row.tx-income  .tx-row-amount { color: #4ade80; }
.tx-row.tx-expense .tx-row-amount { color: #f87171; }
.tx-row-balance {
    color: rgba(203, 213, 245, 0.65);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

.tx-empty-note {
    color: rgba(203, 213, 245, 0.7);
    text-align: center;
    font-style: italic;
    padding: 24px 8px;
}

/* Payday rows are clickable — clicking re-opens the original paystub. */
.tx-row.tx-replayable {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}
.tx-row.tx-replayable:hover {
    background: rgba(34, 197, 94, 0.18);
}
.tx-row.tx-replayable:active { transform: scale(0.995); }
.tx-row-review {
    color: #4ade80;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
}

/* Collect-Paycheck button in review mode says "Close" — keep it visible
   but tone the color down so the player understands no money will move. */
#btn-collect-pay.btn-review {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

/* Wallet balance in the HUD becomes a clear "click me" affordance. */
.wallet-amount {
    cursor: pointer;
    transition: color 0.15s ease, transform 0.1s ease;
}
.wallet-amount:hover {
    color: #fde68a;
    text-decoration: underline dotted rgba(253, 230, 138, 0.55);
    text-underline-offset: 3px;
}
.wallet-amount:active { transform: scale(0.97); }

/* ===========================================
   Budget popup
   =========================================== */
.popup-container.budget-popup {
    max-width: 720px;
}

.budget-section {
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.budget-section h3 {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 4px;
}
.budget-section-sub {
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    font-style: italic;
    margin-bottom: 10px;
}
.budget-empty {
    color: rgba(255,255,255,0.55);
    font-style: italic;
    padding: 8px 0;
    font-size: 0.88rem;
}

.budget-group {
    margin: 10px 0;
    padding-left: 8px;
    border-left: 2px solid rgba(255,255,255,0.08);
}
.budget-group-title {
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.budget-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.88);
}
.budget-row-label small { color: rgba(255,255,255,0.5); font-size: 0.78rem; margin-left: 4px; }
.budget-row-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.budget-row-pos .budget-row-amt { color: #4ade80; }
.budget-row-neg .budget-row-amt { color: #f87171; }
.budget-row-don .budget-row-amt { color: #fbbf24; }
.budget-row-sub { display: block; color: rgba(255,255,255,0.45); font-size: 0.78rem; margin-top: 1px; }

/* Hover tooltip on the Business Income row */
.budget-row-tip { position: relative; cursor: help; }
.budget-row-tip-hint {
    display: inline-block;
    margin-left: 6px;
    color: #60a5fa;
    font-size: 0.78rem;
    opacity: 0.7;
}
.budget-row-tip:hover .budget-row-tip-hint { opacity: 1; }

.budget-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 6px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(96, 165, 250, 0.40);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.88);
}
.budget-row-tip:hover .budget-tooltip,
.budget-row-tip:focus-within .budget-tooltip { display: block; }
.budget-tip-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.budget-tip-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
}
.budget-tip-name { color: rgba(255, 255, 255, 0.88); }
.budget-tip-meta {
    display: block;
    color: rgba(255, 255, 255, 0.50);
    font-size: 0.76rem;
    margin-top: 1px;
}
.budget-tip-amt { color: #4ade80; font-weight: 700; font-variant-numeric: tabular-nums; }
.budget-tip-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    font-size: 0.70rem;
    font-weight: 600;
}
.budget-tip-foot {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-style: italic;
}

.budget-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.10);
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
}
.budget-subtotal .pos { color: #4ade80; }
.budget-subtotal .neg { color: #f87171; }

.budget-bottom-line {
    background: rgba(74,222,128,0.10);
    border: 1px solid rgba(74,222,128,0.40);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
    text-align: center;
}
.budget-bottom-line.neg {
    background: rgba(248,113,113,0.10);
    border-color: rgba(248,113,113,0.40);
}
.budget-bl-label {
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    margin-bottom: 4px;
}
.budget-bl-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 6px;
}
.budget-bottom-line.neg .budget-bl-amount { color: #f87171; }
.budget-bl-meta {
    color: rgba(255,255,255,0.65);
    font-size: 0.84rem;
    line-height: 1.4;
    max-width: 480px;
    margin: 0 auto;
}

.budget-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.budget-actions button { padding: 10px 18px !important; }

.budget-edit-help {
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    margin: 4px 0 12px;
    line-height: 1.4;
}
.budget-edit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.budget-edit-row:last-child { border-bottom: none; }
.budget-edit-label {
    flex: 1;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}
.budget-edit-input {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.30);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 4px 10px;
}
.budget-edit-prefix, .budget-edit-suffix {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
}
.budget-edit-amount {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    width: 90px;
    text-align: right;
    outline: none;
}
.budget-edit-amount::-webkit-outer-spin-button,
.budget-edit-amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===========================================
   Family popup (Start a Family)
   =========================================== */
.popup-container.family-popup {
    max-width: 600px;
}

.family-form {
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 14px 0;
}
.family-row {
    margin-bottom: 16px;
}
.family-row:last-child { margin-bottom: 0; }
.family-label {
    display: block;
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 8px;
}
.family-input {
    width: 100%;
    background: rgba(0,0,0,0.30);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}
.family-input:focus {
    border-color: rgba(96, 165, 250, 0.6);
    background: rgba(0,0,0,0.40);
}

.family-industry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.family-industry-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.family-industry-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(96, 165, 250, 0.4);
}
.family-industry-card.selected {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.7);
}
.family-industry-card input[type="radio"] { display: none; }
.family-ind-icon { font-size: 1.6rem; }
.family-ind-name { color: #fff; font-weight: 600; font-size: 0.92rem; }
.family-ind-pay { color: #4ade80; font-weight: 700; font-size: 0.85rem; }

.family-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}
.family-actions button { padding: 12px 24px !important; font-size: 1rem !important; }

.family-married {
    background: rgba(74,222,128,0.10);
    border: 1px solid rgba(74,222,128,0.40);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 14px 0;
}
.family-married-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.family-married-icon { font-size: 2.4rem; }
.family-married-name { color: #fff; font-size: 1.25rem; font-weight: 700; }
.family-married-sub { color: rgba(255,255,255,0.65); font-size: 0.88rem; }
.family-married-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.85);
}
.family-married-row .pos {
    color: #4ade80;
    font-size: 1.1rem;
    font-weight: 700;
}
.family-tip {
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    font-style: italic;
    text-align: center;
    margin-top: 12px;
}

/* ===========================================
   Marriage Housing Choice popup
   =========================================== */
.popup-container.marriage-housing-popup {
    max-width: 720px;
}

.mh-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 14px 0;
}
.mh-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.mh-card:hover:not(.mh-card-disabled) {
    background: rgba(255,255,255,0.08);
    border-color: rgba(96, 165, 250, 0.5);
    transform: translateY(-1px);
}
.mh-card-disabled { opacity: 0.55; cursor: not-allowed; }
.mh-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mh-card-icon { font-size: 2rem; }
.mh-card-title { color: #fff; font-weight: 700; font-size: 1rem; }
.mh-card-price { color: #4ade80; font-weight: 700; font-size: 0.88rem; }
.mh-card-desc { color: rgba(255,255,255,0.75); font-size: 0.88rem; line-height: 1.4; }
.mh-card-warn {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.10);
    border-left: 3px solid #fbbf24;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    margin-top: 4px;
}
.mh-foot {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    font-style: italic;
    text-align: center;
    margin-top: 8px;
}

/* ===== Debt popup: per-loan "Update Monthly Payment" button (task: adjust a
   single debt's payment without taking a personal loan) ===== */
.debt-apply-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0 4px;
}
.debt-apply-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    border: none;
}
.debt-apply-note {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

/* ===== Renovation adjust: clarify the field is the TOTAL monthly budget ===== */
.reno-field-note {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.78);
    background: rgba(96,165,250,0.10);
    border-left: 3px solid #60a5fa;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 8px 0;
}

/* ===== Bank Account popup: lifetime summary cells ===== */
.tx-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 14px;
}
.tx-sum-cell {
    flex: 1 1 30%;
    min-width: 120px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tx-sum-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tx-sum-val { font-size: 1.05rem; font-weight: 800; }
.tx-sum-val.pos { color: #4ade80; }
.tx-sum-val.neg { color: #f87171; }

/* ===== Family popup: children list + pregnancy status ===== */
.family-children {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 12px 0;
}
.family-children-title { font-weight: 800; margin-bottom: 8px; }
.family-child-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.85);
}
.family-pregnancy {
    background: linear-gradient(135deg, rgba(244,114,182,0.18), rgba(236,72,153,0.12));
    border: 1px solid #f472b6;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 12px 0;
    color: #fbcfe8;
    font-size: 0.95rem;
}

/* ===== Debt popup: clickable list of debts (summary row + expandable detail) ===== */
.debt-list-hint {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    margin: 0 0 10px;
}
/* The list layout overrides the old card padding — the summary row and the
   detail panel carry their own padding now. */
.debt-item {
    padding: 0;
    overflow: hidden;
}
.debt-row-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.debt-row-summary:hover { background: rgba(255,255,255,0.06); }
.debt-row-name {
    flex: 1 1 auto;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.debt-row-figs {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.debt-row-owed, .debt-row-monthly {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
}
.debt-row-owed { color: #f87171; }
.debt-row-monthly { color: #fbbf24; }
.debt-row-owed small, .debt-row-monthly small {
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
}
.debt-row-chevron {
    color: rgba(255,255,255,0.55);
    font-size: 0.9rem;
    transition: transform 0.2s;
    flex: 0 0 auto;
}
.debt-item.expanded .debt-row-chevron { transform: rotate(90deg); }
.debt-detail {
    padding: 4px 18px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
