/* PennyPilote - Dark Theme with Neon Accents */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #151520;
    
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-pink: #ec4899;
    
    --border-color: #2a2a3a;
    --border-hover: #3a3a4a;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
    --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.3);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(168, 85, 247, 0.15));
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
}

.stat-card.income::before {
    background: var(--accent-green);
}

.stat-card.expense::before {
    background: var(--accent-red);
}

.stat-card.net::before {
    background: var(--accent-cyan);
}

.stat-card.savings::before {
    background: var(--accent-purple);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.stat-change {
    font-size: 0.85rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: var(--accent-red);
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container.large {
    height: 400px;
}

.chart-fallback {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table .amount {
    font-family: var(--font-mono);
    font-weight: 500;
}

.data-table .amount.income {
    color: var(--accent-green);
}

.data-table .amount.expense {
    color: var(--accent-red);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-cyan);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-success {
    background: var(--accent-green);
    color: white;
}

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

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.tab {
    padding: 12px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

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

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

.tab-content {
    display: none;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Dedicated Scheduler cockpit */
.scheduler-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.scheduler-header-actions,
.scheduler-panel-header,
.scheduler-action-row,
.scheduler-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scheduler-header-actions,
.scheduler-action-row {
    flex-wrap: wrap;
}

.scheduler-panel-header {
    justify-content: space-between;
    margin-bottom: 14px;
}

.scheduler-panel-header h2 {
    margin: 0;
    font-size: 1.12rem;
    color: var(--text-primary);
}

.scheduler-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.scheduler-summary-card {
    min-height: 154px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

.scheduler-summary-card:hover {
    transform: translateY(-2px);
    border-color: #9ccbb5;
    box-shadow: 0 18px 34px rgba(18, 60, 42, 0.12);
}

.scheduler-summary-card.selected {
    border-color: #123c2a;
    background: #ecf8f1;
    box-shadow: inset 0 0 0 1px rgba(18, 60, 42, 0.16), 0 16px 32px rgba(18, 60, 42, 0.12);
}

.summary-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef4f2;
    color: #123c2a;
}

.scheduler-summary-card.income .summary-icon,
.scheduler-summary-card.income strong {
    color: var(--accent-green);
}

.scheduler-summary-card.expense .summary-icon,
.scheduler-summary-card.expense strong {
    color: var(--accent-red);
}

.scheduler-summary-card.net .summary-icon,
.scheduler-summary-card.net strong,
.scheduler-summary-card.upcoming .summary-icon {
    color: var(--accent-cyan);
}

.scheduler-summary-card.due .summary-icon,
.scheduler-summary-card.due strong {
    color: var(--accent-yellow);
}

.scheduler-summary-card.skipped .summary-icon,
.scheduler-summary-card.skipped strong {
    color: var(--accent-purple);
}

.summary-label {
    min-height: 38px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
}

.scheduler-summary-card strong {
    font-family: var(--font-mono);
    font-size: 1.42rem;
    line-height: 1.1;
}

.scheduler-summary-card small {
    color: var(--text-muted);
    font-weight: 700;
}

.scheduler-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: 18px;
    align-items: start;
}

.scheduler-list-panel,
.scheduler-form-panel {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.scheduler-table-container {
    overflow-x: auto;
}

.scheduler-table {
    min-width: 980px;
}

.scheduler-table td:last-child {
    min-width: 300px;
}

.scheduler-empty-cell,
.scheduler-empty-card {
    padding: 24px;
    text-align: center;
}

.scheduler-mobile-list {
    display: none;
}

.scheduler-mobile-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fbfcfc;
}

.scheduler-mobile-top,
.scheduler-mobile-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.scheduler-mobile-top div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.scheduler-mobile-top strong,
.scheduler-mobile-top span {
    overflow-wrap: anywhere;
}

.scheduler-mobile-top span,
.scheduler-mobile-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.scheduler-mobile-top b.income {
    color: var(--accent-green);
}

.scheduler-mobile-top b.expense {
    color: var(--accent-red);
}

.scheduler-mobile-meta {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.scheduler-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #f3f6f5;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.scheduler-status.due_now {
    border-color: #f2d492;
    background: #fff8e9;
    color: #936313;
}

.scheduler-status.upcoming {
    border-color: #b7dfe5;
    background: #eef9fb;
    color: #0f6f7a;
}

.scheduler-status.skipped {
    border-color: #c8c9ef;
    background: #f1f1fb;
    color: #4554a4;
}

.scheduler-status.disabled {
    border-color: #d8e0dd;
    background: #f5f7f7;
    color: var(--text-muted);
}

.scheduler-action-row .btn {
    min-height: 32px;
    gap: 5px;
    padding: 6px 8px;
    white-space: nowrap;
}

.scheduler-form {
    display: grid;
    gap: 12px;
}

.scheduler-form .form-group {
    margin-bottom: 0;
}

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

.scheduler-enabled-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    color: var(--text-primary);
    font-weight: 800;
    cursor: pointer;
}

.scheduler-enabled-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #123c2a;
}

.scheduler-form-actions {
    justify-content: flex-end;
    padding-top: 4px;
}

@media (max-width: 1280px) {
    .scheduler-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .scheduler-header,
    .scheduler-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .scheduler-header-actions,
    .scheduler-header-actions .btn,
    .scheduler-panel-header .btn {
        width: 100%;
    }

    .scheduler-workspace {
        grid-template-columns: 1fr;
    }

    .scheduler-form-panel {
        order: -1;
    }
}

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

    .scheduler-summary-card {
        min-height: 138px;
        padding: 13px;
    }

    .scheduler-summary-card strong {
        font-size: 1.18rem;
    }

    .scheduler-table-container {
        display: none;
    }

    .scheduler-mobile-list {
        display: grid;
        gap: 10px;
    }

    .scheduler-action-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scheduler-action-row .btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .scheduler-summary-grid,
    .scheduler-form-grid {
        grid-template-columns: 1fr;
    }

    .scheduler-list-panel,
    .scheduler-form-panel {
        padding: 14px;
    }

    .scheduler-action-row {
        grid-template-columns: 1fr;
    }
}

.badge + .badge {
    margin-left: 6px;
}

.badge-income {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge-expense {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.badge-transfer {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-purple);
}

/* Month Picker */
.month-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.month-picker button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.month-picker button:hover {
    color: var(--accent-cyan);
}

.month-picker span {
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* AI Chat */
.ai-chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    height: 500px;
    display: flex;
    flex-direction: column;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-message {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    max-width: 85%;
}

.ai-message.user {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(168, 85, 247, 0.15));
    margin-left: auto;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.ai-message.assistant {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.ai-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ai-message-content {
    line-height: 1.6;
}

.ai-message-content strong {
    color: var(--accent-cyan);
}

.ai-chat-input {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.ai-chat-input input {
    flex: 1;
}

/* Simulator Results */
.sim-result {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
}

.sim-result-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-mono);
}

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

.sim-result-item {
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.sim-result-item-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sim-result-item-value {
    font-size: 1.3rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sim-result-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* Utility Classes */
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }
.text-info { color: var(--accent-cyan); }
.text-muted { color: var(--text-muted); }

.bg-success { background: rgba(16, 185, 129, 0.1); }
.bg-danger { background: rgba(239, 68, 68, 0.1); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }


/* Auth pages: hide sidebar, center content */
.auth-main {
    padding: 40px 24px;
    width: 100%;
    min-height: 100vh;
}


/* Everyday-user polish: less cyber cave, more usable cockpit */
body {
    background:
        radial-gradient(circle at top left, rgba(0, 212, 255, 0.08), transparent 32rem),
        radial-gradient(circle at top right, rgba(168, 85, 247, 0.08), transparent 28rem),
        var(--bg-primary);
}

.main-content {
    max-width: 1520px;
}

.app-hero-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(168, 85, 247, 0.10));
    border-color: rgba(0, 212, 255, 0.28);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.settings-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.currency-converter-card .card-header {
    align-items: flex-start;
}

.currency-converter-grid {
    align-items: end;
}

.currency-conversion-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(21, 66, 49, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
}

.currency-conversion-result span {
    color: var(--text-muted);
    font-weight: 800;
}

.currency-conversion-result strong {
    color: var(--fintech-ink);
    font-size: 1.35rem;
    overflow-wrap: anywhere;
    text-align: right;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    padding: 20px;
}

.modal-content {
    width: min(96vw, 760px);
    max-height: 92vh;
    overflow: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header, .modal-footer, .modal-body {
    padding: 18px 20px;
}

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

.modal-footer {
    border-top: 1px solid var(--border-color);
    border-bottom: 0;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    font-size: 1.6rem;
    cursor: pointer;
}

.support-shell-action {
    background: #fff8ec;
    color: #49330b;
}

.support-modal,
.update-announcement-modal {
    z-index: 1260;
}

.support-card,
.update-announcement-card {
    width: min(96vw, 660px);
}

.support-header,
.update-announcement-header {
    align-items: flex-start;
}

.support-header h3,
.update-announcement-header h3 {
    margin: 2px 0 0;
    color: var(--text-primary);
}

.support-header p,
.update-announcement-header p {
    margin: 4px 0 0;
}

.support-form {
    display: grid;
    gap: 14px;
}

.support-kind-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.support-kind-grid label {
    cursor: pointer;
}

.support-kind-grid input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.support-kind-grid span {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    border-radius: 8px;
    background: #f7faf9;
    color: var(--text-secondary);
    font-weight: 900;
    text-align: center;
}

.support-kind-grid input:checked + span {
    border-color: rgba(18, 60, 42, 0.38);
    background: #eaf6ef;
    color: var(--fintech-ink, #10231a);
}

.support-form textarea {
    resize: vertical;
}

.support-footer {
    margin: 4px -20px -18px;
}

.support-footer .text-muted {
    margin-right: auto;
}

.update-announcement-body {
    display: grid;
    gap: 14px;
}

.update-version-badge {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    background: #ecf8f1;
    color: var(--fintech-ink, #10231a);
    font-weight: 900;
}

.update-highlights {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.compact-mode .card, .compact-mode .stat-card {
    padding: 16px;
    margin-bottom: 16px;
}

.compact-mode .data-table th, .compact-mode .data-table td {
    padding: 9px 10px;
}

@media (max-width: 768px) {
    .card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .support-kind-grid {
        grid-template-columns: 1fr;
    }
    .support-footer {
        align-items: stretch;
        flex-direction: column;
    }
    .support-footer .text-muted {
        margin-right: 0;
    }
    .btn {
        width: 100%;
    }
}

/* Compact mode v2: actually compact, not decorative checkbox theater. */
body.compact-mode { --radius-lg: 12px; --radius-md: 8px; font-size: 14px; }
body.compact-mode .sidebar { width: 220px; }
body.compact-mode .main-content { margin-left: 220px; padding: 18px; }
body.compact-mode .sidebar-header { padding: 16px; }
body.compact-mode .sidebar-nav { padding: 10px 8px; }
body.compact-mode .nav-section { margin-bottom: 14px; }
body.compact-mode .nav-item { padding: 9px 10px; gap: 8px; }
body.compact-mode .card,
body.compact-mode .stat-card,
body.compact-mode .goal-card { padding: 14px !important; margin-bottom: 14px !important; }
body.compact-mode .page-header { margin-bottom: 16px; }
body.compact-mode .page-title { font-size: 1.7rem; }
body.compact-mode .stat-value { font-size: 1.55rem; }
body.compact-mode .form-group { margin-bottom: 10px; }
body.compact-mode .form-input,
body.compact-mode .form-select,
body.compact-mode .form-control,
body.compact-mode .form-textarea { padding: 8px 10px; }
body.compact-mode .btn { padding: 8px 12px; }
body.compact-mode .btn-sm { padding: 5px 8px; }
body.compact-mode .data-table th,
body.compact-mode .data-table td { padding: 7px 8px !important; }
body.compact-mode .grid-2,
body.compact-mode .dashboard-grid { gap: 14px; }
body.compact-mode .main-content { width: calc(100% - 220px); }

/* Better transaction UX */
.transaction-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px;flex-wrap:wrap}.quick-chips{display:flex;gap:8px;flex-wrap:wrap}.quick-chip{border:1px solid var(--border-color);background:var(--bg-tertiary);color:var(--text-secondary);border-radius:999px;padding:7px 11px;cursor:pointer}.quick-chip:hover{border-color:var(--accent-cyan);color:var(--text-primary)}.transaction-merchant{display:flex;align-items:center;gap:10px}.tx-icon{width:34px;height:34px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,rgba(0,212,255,.12),rgba(168,85,247,.12));border:1px solid var(--border-color);font-size:17px}.tx-main{font-weight:750}.tx-sub{font-size:12px;color:var(--text-muted);margin-top:2px}.transaction-row:hover{background:rgba(255,255,255,.025)}.amount.income{color:var(--accent-green)}.amount.expense{color:var(--accent-red)}.amount.transfer{color:var(--accent-cyan)}

/* PennyPilote visual refresh */
:root {
    --bg-primary: #080b10;
    --bg-secondary: #0d131c;
    --bg-tertiary: #121b27;
    --bg-card: rgba(16, 23, 34, 0.86);
    --text-primary: #f3f7fb;
    --text-secondary: #b3bfcb;
    --text-muted: #728092;
    --accent-cyan: #33c6dd;
    --accent-purple: #8d7cff;
    --accent-green: #4fd18b;
    --accent-red: #ff6b6b;
    --accent-yellow: #f6c85f;
    --accent-pink: #ff7aa8;
    --accent-ink: #0a1018;
    --border-color: rgba(154, 172, 194, 0.16);
    --border-hover: rgba(111, 210, 225, 0.38);
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.42);
    --shadow-glow-cyan: 0 16px 50px rgba(51, 198, 221, 0.24);
    --shadow-glow-purple: 0 16px 50px rgba(141, 124, 255, 0.22);
    --radius-md: 8px;
    --radius-lg: 8px;
}

body {
    background:
        radial-gradient(circle at 12% 10%, rgba(51, 198, 221, 0.16), transparent 27rem),
        radial-gradient(circle at 88% 4%, rgba(246, 200, 95, 0.11), transparent 23rem),
        linear-gradient(140deg, #070a0f 0%, #0a1018 45%, #0d1517 100%);
    color: var(--text-primary);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 78%);
    z-index: -1;
}

.sidebar {
    background: rgba(9, 14, 22, 0.9);
    border-right: 1px solid rgba(154, 172, 194, 0.14);
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
}

.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1200;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(154, 172, 194, 0.22);
    border-radius: var(--radius-md);
    background: rgba(9, 14, 22, 0.88);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(4px);
}

.logo-icon,
.user-avatar {
    background: conic-gradient(from 180deg, var(--accent-cyan), var(--accent-green), var(--accent-yellow), var(--accent-purple), var(--accent-cyan));
    color: #061016;
    box-shadow: 0 12px 36px rgba(51, 198, 221, 0.22);
}

.logo-text {
    background: linear-gradient(135deg, #eaf9ff, var(--accent-cyan) 45%, var(--accent-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-item,
.card,
.stat-card,
.btn,
.form-input,
.form-select,
.form-textarea,
.quick-chip {
    transform: translateZ(0);
}

.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: translateX(-110%);
    transition: transform 0.55s ease;
}

.nav-item:hover::after {
    transform: translateX(110%);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(51, 198, 221, 0.18), rgba(79, 209, 139, 0.12));
    color: #dffbff;
    border-color: rgba(51, 198, 221, 0.32);
    box-shadow: inset 3px 0 0 var(--accent-cyan);
}

.main-content {
    animation: pageRise 0.45s ease both;
    width: calc(100% - 260px);
}

.card,
.stat-card,
.ai-chat-container,
.sim-result,
.modal-content {
    background: linear-gradient(180deg, rgba(20, 30, 44, 0.88), rgba(13, 19, 28, 0.84));
    border-color: rgba(154, 172, 194, 0.16);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.card:hover,
.stat-card:hover {
    border-color: rgba(51, 198, 221, 0.28);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

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

.admin-check {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text-secondary);
}

.admin-warning {
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid rgba(246, 200, 95, 0.34);
    border-radius: var(--radius-lg);
    background: rgba(246, 200, 95, 0.09);
}

.admin-warning p {
    margin: 4px 0 0;
    color: var(--text-secondary);
}

.admin-warning-actions {
    display: flex;
    gap: 10px;
    min-width: min(100%, 440px);
}

.transaction-card-list {
    display: none;
}

.transaction-mobile-card {
    padding: 14px;
    border: 1px solid rgba(154, 172, 194, 0.16);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
}

.transaction-mobile-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.transaction-mobile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    color: var(--text-secondary);
}

.transaction-mobile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.transaction-actions-cell {
    text-align: center;
    white-space: nowrap;
}

.transaction-action-group,
.transaction-mobile-actions {
    align-items: center;
    gap: 6px;
}

.transaction-action-group {
    display: inline-flex;
}

.transaction-icon-btn,
body.top-tabs-ui .transaction-icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1;
}

.transaction-icon-btn i {
    width: 16px;
    min-width: 16px;
}

.transaction-icon-btn:hover {
    transform: translateY(-1px);
}

.transaction-action-download,
.transaction-action-edit {
    color: var(--fintech-forest, var(--accent-cyan));
}

.transaction-action-delete {
    background: rgba(196, 61, 61, 0.1);
    border-color: rgba(196, 61, 61, 0.24);
    color: #b42318;
}

.transaction-action-delete:hover {
    background: rgba(196, 61, 61, 0.16);
    border-color: rgba(196, 61, 61, 0.36);
}

.csv-preview-card {
    width: min(94vw, 860px);
}

.csv-preview-body {
    max-height: 56vh;
    overflow: auto;
}

.csv-errors {
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius-md);
    background: rgba(255, 107, 107, 0.08);
    color: var(--text-secondary);
}

.page-title {
    background: linear-gradient(135deg, #ffffff, #cfeef4 54%, #f8d77c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
}

.btn:hover::before {
    transform: translateX(120%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green) 52%, var(--accent-yellow));
    color: #071017;
    font-weight: 700;
}

.btn-primary:hover {
    box-shadow: 0 16px 44px rgba(79, 209, 139, 0.22);
}

.btn-secondary:hover,
.quick-chip:hover {
    background: rgba(51, 198, 221, 0.1);
    color: #e9fbff;
}

.form-input,
.form-select,
.form-textarea {
    background: rgba(7, 12, 18, 0.7);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(51, 198, 221, 0.14), 0 14px 34px rgba(0, 0, 0, 0.18);
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1200;
}

.toast {
    backdrop-filter: blur(18px);
}

.auth-main {
    margin-left: 0;
    max-width: none;
    padding: 0;
}

.auth-page {
    min-height: 100vh;
}

.auth-stage {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    overflow: hidden;
}

.auth-stage::before {
    content: "";
    position: absolute;
    width: 68vw;
    height: 68vw;
    min-width: 560px;
    min-height: 560px;
    border: 1px solid rgba(51, 198, 221, 0.16);
    border-radius: 50%;
    animation: slowSpin 30s linear infinite;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 420px);
    gap: 28px;
    width: min(980px, 100%);
    align-items: stretch;
}

.auth-brand-panel,
.auth-card {
    border: 1px solid rgba(154, 172, 194, 0.18);
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, rgba(18, 28, 42, 0.84), rgba(10, 16, 24, 0.72));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 480px;
}

.auth-brand-panel::after {
    content: "";
    position: absolute;
    inset: auto -20% -35% 14%;
    height: 55%;
    background: radial-gradient(circle, rgba(79, 209, 139, 0.2), transparent 58%);
}

.auth-logo {
    width: 64px;
    height: 64px;
    font-size: 30px;
    margin-bottom: auto;
    animation: floatLogo 4.5s ease-in-out infinite;
}

.auth-kicker {
    color: var(--accent-cyan);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin-bottom: 12px;
}

.auth-brand-panel h1 {
    max-width: 520px;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 0.96;
    margin-bottom: 18px;
}

.auth-copy {
    max-width: 460px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.auth-metrics span {
    padding: 8px 12px;
    border: 1px solid rgba(154, 172, 194, 0.18);
    border-radius: 999px;
    color: #dce8f3;
    background: rgba(255, 255, 255, 0.04);
}

.auth-card {
    padding: 32px;
    align-self: center;
    animation: cardEnter 0.65s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-card-header {
    margin-bottom: 28px;
}

.auth-card-header h2 {
    font-size: 1.55rem;
    margin-bottom: 4px;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
}

.auth-footer-note {
    text-align: center;
    margin-top: 24px;
    font-size: 0.86rem;
}

.auth-flashes {
    margin-bottom: 16px;
}

.flash-message {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(154, 172, 194, 0.16);
    margin-bottom: 8px;
}

.onboarding-card {
    display: grid;
    grid-template-columns: minmax(280px, 1.15fr) minmax(260px, 0.85fr);
    gap: 20px;
    margin-bottom: 28px;
    padding: 24px;
    border: 1px solid rgba(51, 198, 221, 0.24);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(51, 198, 221, 0.14), rgba(79, 209, 139, 0.08)),
        linear-gradient(180deg, rgba(20, 30, 44, 0.9), rgba(13, 19, 28, 0.86));
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

.onboarding-kicker,
.onboarding-tip-title {
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.onboarding-copy h2 {
    margin-bottom: 10px;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.onboarding-copy p,
.empty-state p,
.field-hint {
    color: var(--text-secondary);
}

.onboarding-actions,
.onboarding-demo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.onboarding-demo-actions {
    margin-top: 12px;
}

.onboarding-side {
    display: grid;
    gap: 14px;
}

.onboarding-checklist {
    display: grid;
    gap: 8px;
}

.onboarding-step {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(154, 172, 194, 0.16);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
    text-decoration: none;
}

.onboarding-step span {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(154, 172, 194, 0.28);
    color: var(--accent-green);
}

.onboarding-step.done {
    color: var(--text-secondary);
}

.onboarding-step.done span {
    background: rgba(79, 209, 139, 0.16);
    border-color: rgba(79, 209, 139, 0.45);
}

.onboarding-suggestions {
    padding: 14px;
    border: 1px solid rgba(246, 200, 95, 0.2);
    border-radius: var(--radius-md);
    background: rgba(246, 200, 95, 0.06);
}

.onboarding-suggestions p {
    margin: 8px 0 0;
    color: var(--text-secondary);
}

.empty-state {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state .btn {
    margin-top: 14px;
}

.field-hint {
    margin-top: 6px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    line-height: 1.45;
}

.particle-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    --x: 50vw;
    --delay: 0s;
    --duration: 14s;
    position: absolute;
    left: var(--x);
    bottom: -24px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 18px currentColor;
    opacity: 0;
    animation: particleLift var(--duration) linear infinite;
    animation-delay: var(--delay);
}

.particle:nth-child(3n) {
    background: var(--accent-green);
}

.particle:nth-child(4n) {
    background: var(--accent-yellow);
}

.particle:nth-child(5n) {
    width: 8px;
    height: 8px;
    background: var(--accent-purple);
}

.particle-1 { --x: 4vw; --delay: -1s; --duration: 16s; }
.particle-2 { --x: 9vw; --delay: -7s; --duration: 14s; }
.particle-3 { --x: 15vw; --delay: -3s; --duration: 18s; }
.particle-4 { --x: 21vw; --delay: -11s; --duration: 15s; }
.particle-5 { --x: 27vw; --delay: -5s; --duration: 17s; }
.particle-6 { --x: 33vw; --delay: -9s; --duration: 13s; }
.particle-7 { --x: 39vw; --delay: -2s; --duration: 19s; }
.particle-8 { --x: 45vw; --delay: -8s; --duration: 16s; }
.particle-9 { --x: 51vw; --delay: -4s; --duration: 14s; }
.particle-10 { --x: 56vw; --delay: -12s; --duration: 18s; }
.particle-11 { --x: 61vw; --delay: -6s; --duration: 15s; }
.particle-12 { --x: 66vw; --delay: -10s; --duration: 17s; }
.particle-13 { --x: 70vw; --delay: -2s; --duration: 20s; }
.particle-14 { --x: 74vw; --delay: -8s; --duration: 14s; }
.particle-15 { --x: 78vw; --delay: -13s; --duration: 18s; }
.particle-16 { --x: 82vw; --delay: -3s; --duration: 15s; }
.particle-17 { --x: 86vw; --delay: -9s; --duration: 19s; }
.particle-18 { --x: 90vw; --delay: -5s; --duration: 16s; }
.particle-19 { --x: 94vw; --delay: -12s; --duration: 13s; }
.particle-20 { --x: 12vw; --delay: -15s; --duration: 21s; }
.particle-21 { --x: 36vw; --delay: -14s; --duration: 18s; }
.particle-22 { --x: 63vw; --delay: -16s; --duration: 20s; }
.particle-23 { --x: 84vw; --delay: -17s; --duration: 17s; }
.particle-24 { --x: 97vw; --delay: -18s; --duration: 22s; }

.filter-card {
    margin-bottom: 24px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-grid .form-group {
    margin-bottom: 0;
}

.filter-grid .form-group:nth-child(6) {
    grid-column: span 2;
}

.data-table tbody tr {
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.data-table tbody tr:hover {
    transform: translateX(3px);
}

.transaction-toolbar {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(154, 172, 194, 0.1);
}

.quick-chip {
    border-radius: 999px;
}

.transaction-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    background: rgba(4, 8, 12, 0.72);
    padding: clamp(18px, 5vh, 48px) 20px 20px;
    backdrop-filter: blur(12px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.transaction-modal-card {
    width: min(96vw, 560px);
    max-height: calc(100dvh - clamp(32px, 8vh, 88px));
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    animation: modalPop 0.34s cubic-bezier(.2, .8, .2, 1) both;
}

.transaction-modal-card > .card-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(180deg, var(--bg-card) 82%, rgba(255, 255, 255, 0));
}

.transaction-modal-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.transaction-modal-actions {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 4px;
    margin-top: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--bg-card) 26%);
}

.transaction-modal-actions .btn {
    min-width: 132px;
}

.transaction-page-shell {
    display: grid;
    place-items: start center;
    min-height: calc(100dvh - 220px);
    padding-bottom: 36px;
}

.transaction-page-form {
    width: min(100%, 980px);
    padding: clamp(18px, 2.6vw, 28px);
    overflow: visible;
    scroll-padding-bottom: 32px;
}

.transaction-page-form > .card-header {
    position: sticky;
    top: 0;
    z-index: 5;
    padding-bottom: 14px;
    background: linear-gradient(180deg, var(--bg-card) 80%, rgba(255, 255, 255, 0));
}

.transaction-form-status {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(18, 124, 137, 0.08);
    color: var(--text-primary);
    font-weight: 700;
}

.transaction-form-status.success {
    border-color: rgba(25, 135, 84, 0.35);
    background: rgba(25, 135, 84, 0.1);
}

.transaction-form-status.warning {
    border-color: rgba(185, 128, 24, 0.35);
    background: rgba(185, 128, 24, 0.12);
}

.transaction-form-status.error {
    border-color: rgba(196, 61, 61, 0.35);
    background: rgba(196, 61, 61, 0.1);
}

.transaction-form-section {
    margin-bottom: 22px;
}

.transaction-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.transaction-type-option {
    position: relative;
    display: grid;
    gap: 8px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff, #f8fbfa);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.transaction-type-option:hover,
.transaction-type-option.active {
    transform: translateY(-2px);
    border-color: rgba(18, 124, 137, 0.45);
    box-shadow: var(--shadow-md);
}

.direction-option.is-disabled,
.transaction-type-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.transaction-type-option.is-disabled:hover {
    transform: none;
    box-shadow: none;
}

.transaction-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.transaction-type-option span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 800;
}

.transaction-type-option span i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e8f6ee;
    color: #123c2a;
}

.transaction-type-option small {
    color: var(--text-secondary);
    line-height: 1.35;
}

.transaction-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    padding-bottom: 2px;
}

.transaction-form-wide {
    grid-column: 1 / -1;
}

.transaction-form-grid .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.monthly-spend-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(18, 124, 137, 0.22);
    border-radius: var(--radius-md);
    background: rgba(18, 124, 137, 0.06);
    cursor: pointer;
}

.monthly-spend-toggle input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.monthly-spend-toggle span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.monthly-spend-toggle small {
    color: var(--text-secondary);
    line-height: 1.35;
}

.transaction-page-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid rgba(21, 66, 49, 0.1);
    background: var(--bg-card);
}

.transaction-page-actions .btn {
    flex: 0 1 auto;
    min-height: 44px;
}

.transaction-page-form .form-textarea {
    min-height: 120px;
    resize: vertical;
    overflow: auto;
}

.asset-symbol-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.clarity-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.monthly-clarity-bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.budget-mini-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 8px;
}

.budget-mini-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-yellow), var(--accent-red));
}

.privacy-action-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    background: rgba(255, 255, 255, 0.025);
}

.privacy-action-panel h3 {
    margin-bottom: 8px;
}

.privacy-action-panel.danger {
    border-color: rgba(255, 107, 107, 0.35);
}

.direction-option {
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.direction-option:hover,
.direction-option.active {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(51, 198, 221, 0.12);
}

.transaction-burst {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 1300;
    animation: burstFade 1.25s ease forwards;
}

.transaction-burst-core {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 999px;
    color: #061016;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan), var(--accent-yellow));
    font-weight: 800;
    box-shadow: 0 22px 70px rgba(51, 198, 221, 0.34);
    animation: burstCore 0.65s cubic-bezier(.2, .8, .2, 1) both;
}

.burst-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-cyan);
    animation: dotBurst 0.9s ease-out forwards;
}

.burst-dot:nth-child(3n) { background: var(--accent-green); }
.burst-dot:nth-child(4n) { background: var(--accent-yellow); }
.burst-dot:nth-child(5n) { background: var(--accent-pink); }
.dot-1 { --dx: -150px; --dy: -68px; }
.dot-2 { --dx: -112px; --dy: -128px; }
.dot-3 { --dx: -52px; --dy: -156px; }
.dot-4 { --dx: 20px; --dy: -148px; }
.dot-5 { --dx: 96px; --dy: -118px; }
.dot-6 { --dx: 148px; --dy: -56px; }
.dot-7 { --dx: 162px; --dy: 18px; }
.dot-8 { --dx: 120px; --dy: 82px; }
.dot-9 { --dx: 54px; --dy: 132px; }
.dot-10 { --dx: -18px; --dy: 142px; }
.dot-11 { --dx: -88px; --dy: 112px; }
.dot-12 { --dx: -144px; --dy: 52px; }
.dot-13 { --dx: 178px; --dy: -6px; }
.dot-14 { --dx: -174px; --dy: -8px; }

.transaction-refresh {
    animation: tableFlash 0.75s ease;
}

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

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

@keyframes slowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes particleLift {
    0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.75); }
    12% { opacity: 0.75; }
    70% { opacity: 0.45; }
    100% { opacity: 0; transform: translate3d(28px, -110vh, 0) scale(1.45); }
}

@keyframes modalPop {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes burstCore {
    0% { opacity: 0; transform: scale(0.72); }
    70% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes burstFade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes dotBurst {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.35); }
}

@keyframes tableFlash {
    0% { box-shadow: 0 0 0 rgba(79, 209, 139, 0); }
    35% { box-shadow: 0 0 0 5px rgba(79, 209, 139, 0.12); }
    100% { box-shadow: 0 0 0 rgba(79, 209, 139, 0); }
}

@media (max-width: 1180px) {
    .filter-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .filter-grid .form-group:nth-child(6) {
        grid-column: span 1;
    }
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: 320px;
    }

    .page-header-row {
        align-items: stretch;
        flex-direction: column;
    }

    .onboarding-card {
        grid-template-columns: 1fr;
    }

    .header-actions {
        justify-content: stretch;
    }

    .header-actions .btn {
        flex: 1 1 150px;
    }

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

@media (max-width: 900px) {
    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        width: min(84vw, 310px);
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        z-index: 1100;
    }

    body.mobile-nav-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-nav-open .sidebar-backdrop {
        display: block;
    }

    .main-content,
    body.compact-mode .main-content {
        width: 100%;
        margin-left: 0;
        padding: 72px 16px 20px;
    }

    .page-header-row,
    .page-header > div[style*="justify-content"] {
        flex-direction: column;
        align-items: stretch !important;
        gap: 14px;
    }

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

    .grid-2,
    .grid-3,
    #extraChartsRow {
        grid-template-columns: 1fr !important;
    }

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

    .card > div[style*="display:flex"],
    .card-header {
        flex-wrap: wrap;
    }

    .table-container {
        margin-inline: -6px;
        padding-inline: 6px;
    }

    .data-table {
        min-width: 680px;
    }
}

@media (max-width: 720px) {
    .transaction-card-list {
        display: grid;
        gap: 12px;
    }

    .transactions-list-card .table-container {
        display: none;
    }

    .transaction-toolbar {
        align-items: flex-start;
    }

    .admin-warning,
    .admin-warning-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    body.compact-mode .main-content {
        margin-left: 0;
        width: 100%;
    }

    .auth-stage {
        padding: 18px;
    }

    .auth-card,
    .auth-brand-panel {
        padding: 24px;
    }

    .auth-brand-panel h1 {
        font-size: 2.3rem;
    }

    .transaction-modal {
        padding: 10px;
    }

    .transaction-modal-card {
        width: min(100%, 560px);
        max-height: calc(100dvh - 20px);
    }

    .transaction-modal-actions {
        justify-content: stretch;
    }

    .transaction-modal-actions .btn {
        flex: 1 1 140px;
    }

    .transaction-page-form {
        padding: 16px;
    }

    .transaction-type-grid,
    .transaction-form-grid {
        grid-template-columns: 1fr;
    }

    .transaction-type-option {
        min-height: auto;
    }

    .transaction-page-actions {
        position: static;
        align-items: stretch;
        flex-direction: column-reverse;
        margin-top: 22px;
        padding-top: 0;
    }

    .transaction-page-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .clarity-grid,
    .monthly-clarity-bottom {
        grid-template-columns: 1fr;
    }

    #toast-container {
        left: 14px;
        right: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* V1.0.1 Stable: professional SaaS cockpit refresh */
:root {
    --bg-primary: #f5f7f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef3f1;
    --bg-card: #ffffff;
    --text-primary: #17211d;
    --text-secondary: #55635d;
    --text-muted: #7b8781;
    --accent-cyan: #127c89;
    --accent-purple: #4554a4;
    --accent-green: #198754;
    --accent-red: #c43d3d;
    --accent-yellow: #b98018;
    --accent-pink: #9b3f74;
    --border-color: #d8e0dd;
    --border-hover: #b9c7c2;
    --shadow-sm: 0 1px 2px rgba(22, 32, 28, 0.06);
    --shadow-md: 0 10px 28px rgba(22, 32, 28, 0.08);
    --shadow-lg: 0 24px 60px rgba(22, 32, 28, 0.16);
    --shadow-glow-cyan: 0 16px 36px rgba(18, 124, 137, 0.18);
    --shadow-glow-purple: 0 16px 36px rgba(69, 84, 164, 0.14);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.particle-field,
.auth-stage::before,
.nav-item::after,
.btn::before {
    display: none !important;
}

.sidebar {
    width: 248px;
    background: #111a17;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 6px 0 30px rgba(17, 26, 23, 0.12);
}

.sidebar-header {
    padding: 22px 18px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.logo-icon {
    background: #d9f4e6;
    color: #123c2a;
    border-radius: 8px;
}

.logo-text {
    display: block;
    background: none;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.1;
}

.release-pill,
.stable-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8f6ee;
    color: #14623d;
    border: 1px solid #bde7ce;
    font-size: 0.72rem;
    font-weight: 700;
}

.sidebar .release-pill {
    background: rgba(217, 244, 230, 0.12);
    color: #cdeedc;
    border-color: rgba(217, 244, 230, 0.22);
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.46);
    letter-spacing: 0.08em;
}

.nav-item {
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-item.active {
    background: #e8f6ee;
    color: #123c2a;
    border-color: #bde7ce;
    box-shadow: none;
}

.sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.user-info {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
    background: #d9f4e6;
    color: #123c2a;
}

.user-name {
    color: #ffffff;
}

.user-email {
    color: rgba(255, 255, 255, 0.58);
}

.main-content {
    width: calc(100% - 248px);
    max-width: none;
    margin-left: 248px;
    padding: 22px 28px 44px;
    animation: none;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    margin-bottom: 22px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.app-topbar div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.app-topbar span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.app-topbar a {
    color: var(--accent-cyan);
    font-weight: 700;
    text-decoration: none;
}

.page-header,
.page-header-row {
    margin-bottom: 20px;
}

.page-title {
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    color: var(--text-primary);
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    letter-spacing: 0;
}

.page-subtitle,
.text-muted {
    color: var(--text-secondary) !important;
}

.card,
.stat-card,
.ai-chat-container,
.sim-result,
.modal-content,
.onboarding-card,
.auth-card,
.auth-brand-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
}

.card:hover,
.stat-card:hover {
    transform: none;
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.stat-card::before {
    height: 4px;
    background: var(--accent-cyan);
}

.stat-card.income::before { background: var(--accent-green); }
.stat-card.expense::before { background: var(--accent-red); }
.stat-card.net::before { background: var(--accent-cyan); }
.stat-card.savings::before { background: var(--accent-purple); }

.stat-value {
    color: var(--text-primary);
    font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.form-input,
.form-select,
.form-control,
.form-textarea {
    background: #fbfcfc;
    color: var(--text-primary);
    border-color: var(--border-color);
    border-radius: 8px;
}

.form-input:focus,
.form-select:focus,
.form-control:focus,
.form-textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(18, 124, 137, 0.12);
}

.btn {
    border-radius: 8px;
    font-weight: 700;
    box-shadow: none;
}

.btn-primary {
    background: #123c2a;
    color: #ffffff;
}

.btn-primary:hover {
    transform: none;
    background: #0d2e20;
    box-shadow: var(--shadow-glow-cyan);
}

.btn-secondary {
    background: #f0f4f2;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover,
.quick-chip:hover {
    background: #e3ece8;
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-red);
}

.table-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.data-table th {
    background: #f3f6f5;
    color: var(--text-secondary);
}

.data-table td,
.data-table th {
    border-bottom-color: var(--border-color);
}

.data-table tbody tr:hover {
    background: #f8faf9;
    transform: none;
}

.badge,
.pill {
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #f3f6f5;
    color: var(--text-secondary);
}

.month-picker {
    background: #ffffff;
    border-color: var(--border-color);
}

.auth-main {
    margin-left: 0;
    width: 100%;
}

.auth-stage {
    background: #f5f7f7;
    padding: 28px;
}

.auth-shell {
    grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 420px);
}

.auth-brand-panel {
    background: #123c2a;
    color: #ffffff;
}

.auth-brand-panel h1,
.auth-copy,
.auth-kicker {
    color: #ffffff;
}

.auth-card {
    background: #ffffff;
}

.auth-metrics span {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.onboarding-card {
    background: #eef8f2;
    border-color: #bde7ce;
}

.ai-command-card,
.intelligence-card {
    border-color: #bde7ce;
}

.ai-insight-grid,
.insight-grid {
    display: grid;
    grid-template-columns: 180px minmax(260px, 1fr) minmax(180px, 0.7fr);
    gap: 14px;
    align-items: stretch;
}

.ai-score-tile,
.insight-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: #f7faf9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.ai-score-tile strong,
.insight-tile strong {
    font-size: 2rem;
    line-height: 1;
    color: var(--text-primary);
}

.ai-score-tile span,
.insight-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
}

.ai-score-tile small,
.insight-tile small {
    color: var(--text-secondary);
}

.ai-insight-list,
.ai-action-list {
    display: grid;
    gap: 8px;
}

.ai-insight-row,
.ai-action-list a {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-primary);
    text-decoration: none;
}

.ai-insight-row span {
    display: block;
    font-weight: 800;
}

.ai-insight-row small {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
}

.ai-insight-row.danger { border-left: 4px solid var(--accent-red); }
.ai-insight-row.warning,
.insight-tile.warning { border-left: 4px solid var(--accent-yellow); }
.ai-insight-row.info { border-left: 4px solid var(--accent-cyan); }
.ai-insight-row.ok,
.insight-tile.ok { border-left: 4px solid var(--accent-green); }

.about-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 22px;
    padding: 22px;
    background: #123c2a;
    color: #ffffff;
    border-radius: 8px;
}

.about-hero h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    margin-bottom: 10px;
}

.about-hero p {
    max-width: 780px;
    color: rgba(255, 255, 255, 0.78);
}

.section-kicker {
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.about-hero .section-kicker {
    color: #bde7ce;
}

.release-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.release-panel strong {
    font-size: 1.65rem;
}

.release-list {
    display: grid;
    gap: 10px;
}

.release-list div {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f7faf9;
}

.mobile-nav-toggle {
    background: #123c2a;
    color: #ffffff;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .main-content,
    body.compact-mode .main-content {
        width: 100%;
        margin-left: 0;
        padding: 72px 16px 24px;
    }

    .sidebar {
        width: min(84vw, 310px);
    }

    .app-topbar,
    .about-hero,
    .ai-insight-grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }
}

/* V1.0.2 shell direction: top-tab SaaS workspace */
body.top-tabs-ui {
    background:
        linear-gradient(180deg, #eef4f2 0, #f8faf9 240px, #f8faf9 100%);
}

body.top-tabs-ui .app-container {
    display: block;
    min-height: 100vh;
}

body.top-tabs-ui .sidebar,
body.top-tabs-ui .sidebar-backdrop,
body.top-tabs-ui .app-topbar {
    display: none !important;
}

body.top-tabs-ui .main-content,
body.top-tabs-ui.compact-mode .main-content {
    width: min(100%, 1680px);
    max-width: 1680px;
    margin: 0 auto;
    padding: 26px clamp(18px, 3vw, 38px) 56px;
}

.top-shell {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 12px clamp(14px, 2.4vw, 28px) 0;
    background:
        linear-gradient(180deg, rgba(248, 250, 249, 0.98), rgba(248, 250, 249, 0.9));
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(189, 199, 195, 0.6);
}

.workspace-header {
    display: grid;
    grid-template-columns: auto minmax(360px, 1fr) auto;
    align-items: center;
    gap: 14px;
    max-width: 1680px;
    margin: 0 auto;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #d8e0dd;
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(35, 48, 43, 0.08);
}

.workspace-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 205px;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #123c2a;
    color: #ffffff;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: 27% 50%;
    transform: scale(1.08);
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    line-height: 1;
    font-size: 1.05rem;
}

.brand-copy small {
    color: var(--accent-cyan);
    font-weight: 800;
}

.workspace-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    padding: 4px;
    background: #f0f4f2;
    border: 1px solid #e0e7e4;
    border-radius: 8px;
    scrollbar-width: none;
}

.workspace-tabs::-webkit-scrollbar {
    display: none;
}

.workspace-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 7px;
    color: #56645d;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
}

.workspace-tab i {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(18, 60, 42, 0.08);
    color: #123c2a;
    font-size: 0.72rem;
}

.workspace-tab:hover {
    color: #17211d;
    background: rgba(255, 255, 255, 0.7);
}

.workspace-tab.active {
    color: #ffffff;
    background: #123c2a;
    border-color: #123c2a;
    box-shadow: 0 10px 24px rgba(18, 60, 42, 0.18);
}

.workspace-tab.active i {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.workspace-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.shell-action {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #d8e0dd;
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.primary-action {
    background: #ecf8f1;
    border-color: #bde7ce;
    color: #14623d;
}

.icon-action {
    padding: 0;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: 260px;
    padding: 5px 9px 5px 5px;
    border: 1px solid #d8e0dd;
    border-radius: 8px;
    background: #fbfcfc;
}

body.top-tabs-ui .user-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    background: #eef4f2;
    color: #123c2a;
}

.user-chip-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.user-chip-copy strong,
.user-chip-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip-copy strong {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.user-chip-copy small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.logout-form {
    margin: 0;
}

.workspace-subbar {
    max-width: 1680px;
    margin: 8px auto 0;
    padding: 0 2px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.subbar-status,
.subbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.subbar-links a {
    color: var(--accent-cyan);
    font-weight: 800;
    text-decoration: none;
}

body.top-tabs-ui .mobile-nav-toggle {
    display: none;
    position: static;
    width: 40px;
    height: 40px;
    background: #123c2a;
    border: 0;
}

body.top-tabs-ui .page-header {
    padding: 20px;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #d8e0dd;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

body.top-tabs-ui .page-title {
    font-size: clamp(1.8rem, 2.6vw, 2.65rem);
}

body.top-tabs-ui .stats-grid {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 14px;
}

body.top-tabs-ui .stat-card,
body.top-tabs-ui .card {
    border-radius: 8px;
}

body.top-tabs-ui .chart-container {
    min-height: 210px;
    height: 250px;
    padding: 0;
    background:
        linear-gradient(180deg, #fbfcfc, #f7faf9);
    border: 1px solid #dfe7e4;
    border-radius: 8px;
}

.native-chart {
    width: 100%;
    height: 100%;
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 18px;
    color: var(--text-primary);
    text-align: left;
}

.empty-native-chart {
    place-content: center;
    text-align: center;
}

.empty-native-chart strong {
    font-size: 1rem;
}

.empty-native-chart span {
    color: var(--text-muted);
}

.native-bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.8fr) minmax(160px, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.native-bar-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.native-bar-copy strong,
.native-bar-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.native-bar-copy strong {
    font-size: 0.88rem;
}

.native-bar-copy span {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.native-bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8efec;
}

.native-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.native-bar-row b {
    font-size: 0.86rem;
    white-space: nowrap;
}

.native-trend {
    align-content: stretch;
}

.native-trend-row {
    display: grid;
    grid-template-columns: 90px repeat(3, minmax(110px, 1fr));
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #e0e7e4;
    border-radius: 8px;
    background: #ffffff;
}

.native-trend-row span {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.native-trend-row i {
    width: 8px;
    height: 8px;
    display: inline-block;
    margin-right: 6px;
    border-radius: 999px;
}

.income-dot { background: var(--accent-green); }
.expense-dot { background: var(--accent-red); }
.net-dot { background: var(--accent-cyan); }

body.top-tabs-ui .fa-coins::before{content:"\25CE"}
body.top-tabs-ui .fa-chart-line::before{content:"\2197"}
body.top-tabs-ui .fa-university::before{content:"\25A3"}
body.top-tabs-ui .fa-exchange-alt::before{content:"\21C4"}
body.top-tabs-ui .fa-chart-pie::before{content:"\25D4"}
body.top-tabs-ui .fa-briefcase::before{content:"\25A3"}
body.top-tabs-ui .fa-calculator::before{content:"\2211"}
body.top-tabs-ui .fa-cog::before{content:"\2699"}
body.top-tabs-ui .fa-user::before{content:"\25CF"}
body.top-tabs-ui .fa-sign-out-alt::before{content:"\2192"}
body.top-tabs-ui .fa-check-circle::before{content:"\2713"}
body.top-tabs-ui .fa-info-circle::before{content:"i"}
body.top-tabs-ui .fa-shield-alt::before{content:"\25C6"}
body.top-tabs-ui .fa-plus::before{content:"+"}
body.top-tabs-ui .fa-bars::before{content:"\2630"}

@media (max-width: 1180px) {
    .workspace-header {
        grid-template-columns: 1fr auto;
    }

    .workspace-tabs {
        grid-column: 1 / -1;
        order: 3;
    }

    .workspace-actions {
        grid-column: 2;
    }
}

@media (max-width: 760px) {
    .top-shell {
        padding: 8px 10px 0;
    }

    .workspace-header {
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        padding: 8px;
    }

    .workspace-brand {
        min-width: 0;
    }

    .brand-copy small {
        display: none;
    }

    body.top-tabs-ui .mobile-nav-toggle {
        display: inline-flex;
    }

    .workspace-tabs {
        display: none;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    body.mobile-nav-open .workspace-tabs {
        display: grid;
    }

    .workspace-tab {
        justify-content: flex-start;
    }

    .user-chip {
        display: none;
    }

    .workspace-subbar {
        align-items: flex-start;
        flex-direction: column;
    }

    body.top-tabs-ui .main-content,
    body.top-tabs-ui.compact-mode .main-content {
        padding: 18px 12px 34px;
    }

    body.top-tabs-ui .stats-grid,
    .native-trend-row,
    .native-bar-row {
        grid-template-columns: 1fr;
    }

    .native-bar-row b {
        justify-self: start;
    }
}

/* V1.0.2 refinement: stronger finance command-bar identity */
body.top-tabs-ui {
    background:
        linear-gradient(180deg, #0f2a22 0, #0f2a22 112px, #edf3f1 112px, #f8faf9 420px, #f8faf9 100%);
}

.top-shell {
    padding: 0;
    background: #0f2a22;
    border-bottom: 1px solid rgba(218, 244, 230, 0.14);
    box-shadow: 0 16px 38px rgba(15, 42, 34, 0.18);
}

.workspace-header {
    grid-template-columns: auto minmax(420px, 1fr) auto;
    padding: 12px clamp(16px, 2.6vw, 32px);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.workspace-brand {
    color: #ffffff;
}

.brand-mark {
    background: #dff7e9;
    color: #0f2a22;
}

.brand-copy strong {
    color: #ffffff;
}

.brand-copy small {
    color: #aee8c7;
}

.workspace-tabs {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.workspace-tab {
    color: rgba(255, 255, 255, 0.72);
}

.workspace-tab i {
    background: rgba(255, 255, 255, 0.09);
    color: #dff7e9;
}

.workspace-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.workspace-tab.active {
    background: #dff7e9;
    border-color: #dff7e9;
    color: #0f2a22;
    box-shadow: none;
}

.workspace-tab.active i {
    background: rgba(15, 42, 34, 0.1);
    color: #0f2a22;
}

.shell-action {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.primary-action {
    background: #dff7e9;
    border-color: #dff7e9;
    color: #0f2a22;
}

.user-chip {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

body.top-tabs-ui .user-avatar {
    background: #dff7e9;
    color: #0f2a22;
}

.user-chip-copy strong {
    color: #ffffff;
}

.user-chip-copy small {
    color: rgba(255, 255, 255, 0.64);
}

.workspace-subbar {
    max-width: none;
    margin: 0;
    padding: 9px clamp(16px, 2.6vw, 32px);
    background: #15382d;
    color: rgba(255, 255, 255, 0.72);
}

.subbar-status {
    max-width: min(100%, 920px);
}

.subbar-status .stable-badge {
    margin-top: 0;
    background: rgba(223, 247, 233, 0.12);
    color: #dff7e9;
    border-color: rgba(223, 247, 233, 0.24);
}

.subbar-links a {
    color: #dff7e9;
}

body.top-tabs-ui .main-content,
body.top-tabs-ui.compact-mode .main-content {
    padding-top: 30px;
}

body.top-tabs-ui .page-header {
    position: relative;
    overflow: hidden;
    padding: 22px 24px;
    background:
        linear-gradient(135deg, #ffffff 0%, #ffffff 58%, #eff8f3 100%);
    border-color: #cddbd6;
}

body.top-tabs-ui .page-header::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: #0f2a22;
}

body.top-tabs-ui .page-header > div {
    position: relative;
    z-index: 1;
}

body.top-tabs-ui .page-title {
    font-size: clamp(1.85rem, 2.4vw, 2.4rem);
}

body.top-tabs-ui .page-subtitle {
    max-width: 620px;
}

body.top-tabs-ui .month-picker {
    min-height: 42px;
    background: #0f2a22;
    border-color: #0f2a22;
    color: #ffffff;
}

body.top-tabs-ui .month-picker button {
    color: #ffffff;
}

body.top-tabs-ui .stat-card {
    display: grid;
    min-height: 148px;
    align-content: space-between;
    background: #ffffff;
}

body.top-tabs-ui .stat-card::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

body.top-tabs-ui .stat-label {
    color: #5a6861;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

body.top-tabs-ui .stat-value {
    margin-top: 10px;
    font-size: clamp(1.65rem, 2.4vw, 2.25rem);
}

body.top-tabs-ui .card-header {
    align-items: flex-start;
}

body.top-tabs-ui .card-title {
    font-size: 1rem;
    letter-spacing: 0;
}

body.top-tabs-ui .ai-command-card {
    background:
        linear-gradient(135deg, #123c2a, #1d5b42);
    color: #ffffff;
    border: 0;
}

body.top-tabs-ui .ai-command-card .card-title,
body.top-tabs-ui .ai-command-card .text-muted {
    color: #ffffff !important;
}

body.top-tabs-ui .ai-command-card .release-pill {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
}

body.top-tabs-ui .ai-command-card .ai-score-tile,
body.top-tabs-ui .ai-command-card .insight-tile,
body.top-tabs-ui .ai-command-card .ai-insight-row,
body.top-tabs-ui .ai-command-card .ai-action-list a {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

body.top-tabs-ui .ai-command-card .ai-score-tile strong,
body.top-tabs-ui .ai-command-card .insight-tile strong,
body.top-tabs-ui .ai-command-card .ai-insight-row span {
    color: #ffffff;
}

body.top-tabs-ui .ai-command-card small,
body.top-tabs-ui .ai-command-card .insight-label,
body.top-tabs-ui .ai-command-card .ai-insight-row small {
    color: rgba(255, 255, 255, 0.72);
}

body.top-tabs-ui .chart-container {
    height: 220px;
    background:
        linear-gradient(180deg, #ffffff, #f7faf9);
}

body.top-tabs-ui .native-chart {
    padding: 16px;
}

body.top-tabs-ui .grid-2 {
    gap: 18px;
}

@media (max-width: 1180px) {
    .workspace-header {
        grid-template-columns: 1fr auto;
    }

    .workspace-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .workspace-tabs {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    body.top-tabs-ui {
        background:
            linear-gradient(180deg, #0f2a22 0, #0f2a22 118px, #f8faf9 118px, #f8faf9 100%);
    }

    .workspace-header {
        grid-template-columns: 1fr auto auto;
        padding: 10px;
    }

    .workspace-subbar {
        display: none;
    }

    body.top-tabs-ui .mobile-nav-toggle {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    .workspace-tabs {
        background: #15382d;
    }

    body.top-tabs-ui .page-header {
        padding: 18px;
    }
}

/* V1.0.5: global polish for helpers, actions, donations, assets, and manager */
body.top-tabs-ui .fa-edit::before {
    content: "\270e" !important;
    font-size: 0.92rem;
}

body.top-tabs-ui .fa-trash::before {
    content: "\2715" !important;
    font-size: 0.92rem;
}

body.top-tabs-ui .fa-download::before {
    content: "\2193" !important;
}

body.top-tabs-ui .fa-upload::before {
    content: "\2191" !important;
}

body.top-tabs-ui .finance-metric-card,
body.top-tabs-ui .stat-card,
body.top-tabs-ui .card {
    overflow: visible;
}

.help-tip {
    isolation: isolate;
    z-index: 20;
}

.help-tip:hover,
.help-tip:focus {
    z-index: 5000;
}

.help-tip:hover::after,
.help-tip:focus::after {
    z-index: 5001 !important;
    min-width: 220px;
    border: 1px solid rgba(223, 247, 233, 0.22);
    background: #0b2f24 !important;
    color: #ffffff !important;
    text-shadow: none;
    white-space: normal;
}

.header-actions,
.page-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-header-row {
    justify-content: space-between;
}

.floating-transaction-cta {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 850;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid rgba(207, 242, 225, 0.52);
    border-radius: 999px;
    background: #0b4f36;
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 18px 42px rgba(11, 79, 54, 0.28);
    cursor: pointer;
}

.floating-transaction-cta:hover {
    transform: translateY(-1px);
    background: #0d6042;
}

.donation-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 18px;
    margin: 18px 0;
}

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

.donation-note-field,
.donation-submit-actions {
    grid-column: 1 / -1;
}

.donation-submit-actions {
    display: flex;
    justify-content: flex-end;
}

.donation-history-list {
    display: grid;
    gap: 10px;
}

.donation-history-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(18, 60, 45, 0.045);
}

.donation-history-row div {
    display: grid;
    gap: 4px;
}

.donation-history-row span,
.donation-history-row small {
    color: var(--text-muted);
}

.donation-status.pending,
.donation-status.pledged {
    background: rgba(245, 158, 11, 0.12);
    color: #8a5200;
}

.donation-status.approved,
.donation-status.received {
    background: rgba(16, 185, 129, 0.14);
    color: #05603a;
}

.donation-status.rejected,
.donation-status.cancelled,
.donation-status.refunded {
    background: rgba(239, 68, 68, 0.13);
    color: #9f1d1d;
}

.voluntary-donation-grid {
    align-items: stretch;
}

.voluntary-donation-grid .donation-card {
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.voluntary-donation-grid .donation-card .btn {
    margin-top: auto;
}

#portfolioSummary.stats-grid {
    gap: 18px;
}

.intelligence-card,
.assets-table-card {
    border-radius: 18px;
}

.insight-grid {
    align-items: stretch;
}

.insight-tile {
    min-height: 118px;
}

#assetsTable td:last-child,
#transactionsTable td:last-child {
    white-space: nowrap;
}

#assetsTable td:last-child .btn,
#transactionsTable td:last-child .btn {
    min-width: 40px;
    min-height: 38px;
}

.buy-preview {
    display: grid;
    gap: 4px;
    margin: 6px 0 16px;
    padding: 14px;
}

.manager-list .pill,
.budget-row .pill,
.alert-row .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 116px;
    max-width: 180px;
    min-height: 34px;
    padding: 6px 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.72);
}

.budget-row,
.alert-row {
    align-items: center;
}

.wallet-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

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

    .donation-form-grid {
        grid-template-columns: 1fr;
    }

    .floating-transaction-cta {
        right: 16px;
        bottom: 16px;
    }
}

/* V1.0.1 Stable fintech product layer: honeycomb identity, responsive cards, guidance UI */
:root {
    --fintech-ink: #0e251e;
    --fintech-forest: #123c2d;
    --fintech-green: #1f9d68;
    --fintech-mint: #dff8eb;
    --fintech-cyan: #2bb9c5;
    --fintech-indigo: #5266d8;
    --fintech-amber: #e7a82d;
    --fintech-rose: #df5e66;
    --glass-border: rgba(21, 66, 49, 0.14);
    --glass-bg: rgba(255, 255, 255, 0.78);
    --honey-line: rgba(21, 66, 49, 0.07);
    --premium-shadow: 0 18px 50px rgba(20, 57, 43, 0.12);
    --premium-shadow-hover: 0 24px 70px rgba(20, 57, 43, 0.18);
}

.fa-question-circle::before{content:"?"}.fa-heart::before{content:"$"}.fa-coins::before{content:"\25CE"}.fa-chart-line::before{content:"\2197"}.fa-university::before{content:"\25A3"}.fa-exchange-alt::before{content:"\21C4"}.fa-chart-pie::before{content:"\25D4"}.fa-briefcase::before{content:"\25A3"}.fa-calculator::before{content:"\2211"}.fa-cog::before{content:"\2699"}.fa-user::before{content:"\25CF"}.fa-sign-out-alt::before{content:"\2192"}.fa-check::before,.fa-check-circle::before{content:"\2713"}.fa-info-circle::before{content:"i"}.fa-sync::before,.fa-sync-alt::before{content:"\21BB"}.fa-spinner::before{content:"\25CC"}.fa-plus::before,.fa-plus-circle::before,.fa-user-plus::before{content:"+"}.fa-times::before{content:"\00D7"}.fa-sliders-h::before{content:"\2261"}.fa-edit::before{content:"\270E"}.fa-trash::before{content:"\232B"}.fa-arrow-left::before{content:"\2190"}.fa-arrow-up::before,.fa-upload::before{content:"\2191"}.fa-arrow-down::before,.fa-download::before{content:"\2193"}.fa-chevron-left::before{content:"\2039"}.fa-chevron-right::before{content:"\203A"}.fa-wallet::before{content:"\25A4"}.fa-calendar-alt::before,.fa-history::before{content:"\25F7"}.fa-minus::before{content:"\2212"}.fa-filter::before{content:"\25A6"}.fa-bars::before{content:"\2630"}.fa-shield-alt::before{content:"\25C6"}

body.top-tabs-ui {
    color-scheme: light;
    background:
        radial-gradient(circle at 12% 4%, rgba(43, 185, 197, 0.13), transparent 28rem),
        radial-gradient(circle at 90% 5%, rgba(31, 157, 104, 0.12), transparent 26rem),
        linear-gradient(180deg, #eef7f3 0, #f8fbfa 42%, #eef5f2 100%);
    color: #14251f;
}

body.top-tabs-ui::before,
.honey-panel::before,
.honey-card::before,
.donate-hero::before,
.help-hero::before,
.empty-state::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(30deg, var(--honey-line) 12%, transparent 12.5%, transparent 87%, var(--honey-line) 87.5%, var(--honey-line)),
        linear-gradient(150deg, var(--honey-line) 12%, transparent 12.5%, transparent 87%, var(--honey-line) 87.5%, var(--honey-line)),
        linear-gradient(30deg, var(--honey-line) 12%, transparent 12.5%, transparent 87%, var(--honey-line) 87.5%, var(--honey-line)),
        linear-gradient(150deg, var(--honey-line) 12%, transparent 12.5%, transparent 87%, var(--honey-line) 87.5%, var(--honey-line));
    background-size: 46px 80px;
    background-position: 0 0, 0 0, 23px 40px, 23px 40px;
    opacity: 0.65;
}

body.top-tabs-ui::before {
    position: fixed;
    z-index: -1;
}

body.top-tabs-ui .top-shell {
    background: linear-gradient(135deg, #0e2b22, #163f30 58%, #255746);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(14, 43, 34, 0.22);
}

.workspace-tab,
.shell-action,
.subbar-links a {
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.workspace-tab:hover,
.shell-action:hover,
.subbar-links a:hover {
    transform: translateY(-1px);
}

body.top-tabs-ui .main-content {
    width: min(1640px, calc(100% - 32px));
    margin: 0 auto;
}

.honey-panel,
.honey-card,
.glass-card,
body.top-tabs-ui .card,
body.top-tabs-ui .page-header,
.stat-card,
.finance-metric-card,
.account-widget,
.transaction-mobile-card,
.goal-card,
.donation-card,
.help-card {
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--premium-shadow);
    backdrop-filter: blur(16px);
}

body.top-tabs-ui .page-header.dashboard-hero,
.dashboard-hero,
.help-hero,
.donate-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    background:
        linear-gradient(135deg, rgba(255,255,255,.9), rgba(226,247,237,.78)),
        radial-gradient(circle at 88% 10%, rgba(43,185,197,.16), transparent 22rem);
}

.section-kicker,
.dashboard-section-title small,
.metric-top,
.stat-label {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.74rem;
    color: #507064;
    font-weight: 800;
}

.dashboard-section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    margin: 24px 0 12px;
}

.dashboard-section-title span {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--fintech-ink);
}

.premium-kpi-card {
    isolation: isolate;
    transform: translateZ(0);
}

.premium-kpi-card:hover,
.finance-metric-card:hover,
.account-widget:hover,
.donation-card:hover,
.help-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--premium-shadow-hover);
}

.stat-icon,
.metric-icon,
.donation-icon,
.account-glyph,
.empty-illustration {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--fintech-forest), var(--fintech-green));
    font-weight: 900;
}

.stat-card.income .stat-icon,
.chip-dot.income { background: var(--fintech-green); }
.stat-card.expense .stat-icon,
.chip-dot.expense { background: var(--fintech-rose); }
.stat-card.net .stat-icon { background: var(--fintech-indigo); }
.stat-card.savings .stat-icon,
.chip-dot.wallet { background: var(--fintech-cyan); }

.buy-preview {
    display: grid;
    gap: 4px;
    margin: 8px 0 16px;
    padding: 14px 16px;
    color: var(--text-secondary);
}

.buy-preview strong {
    color: var(--text-primary);
}

.buy-preview span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.executive-kpi-grid,
.donation-grid,
.help-grid,
.support-story-grid,
.account-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.finance-metric-card,
.donation-card,
.help-card {
    padding: 20px;
    border-radius: 18px;
}

.metric-value,
.donation-price,
.account-balance {
    display: block;
    margin-top: 12px;
    font-size: clamp(1.6rem, 2.4vw, 2.35rem);
    line-height: 1;
    color: var(--fintech-ink);
}

.metric-progress,
.goal-progress,
.budget-mini-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(18, 60, 45, 0.1);
    overflow: hidden;
    margin-top: 12px;
}

.metric-progress span,
.goal-progress span,
.budget-mini-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--fintech-green), var(--fintech-cyan));
    transition: width 0.5s ease;
}

.accounts-experience {
    display: grid;
    gap: 18px;
}

.account-table-fallback {
    display: none;
}

.account-section {
    padding: 20px;
    border-radius: 20px;
}

.account-section-header,
.account-widget-top,
.account-widget-main,
.account-meta,
.account-actions,
.guidance-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-section-header h2,
.account-widget h3 {
    margin: 0;
}

.account-section-header p,
.account-widget p,
.account-converted,
.account-meta span,
.help-card p,
.donation-card p {
    color: #62736d;
}

.account-widget {
    padding: 18px;
    border-radius: 18px;
}

.account-widget.mmk .account-glyph,
.account-widget.primary .account-glyph {
    background: linear-gradient(135deg, #b87b12, #e7a82d);
}

.account-widget.main .account-glyph {
    background: linear-gradient(135deg, #132f7b, var(--fintech-indigo));
}

.currency-badge,
.stable-badge,
.release-pill,
.method-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(31, 157, 104, 0.11);
    color: var(--fintech-forest);
    border: 1px solid rgba(31, 157, 104, 0.18);
    font-weight: 800;
    font-size: 0.78rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--fintech-green);
    box-shadow: 0 0 0 5px rgba(31,157,104,.12);
}

.account-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 14px;
}

.quick-chips,
.transaction-toolbar,
.transaction-mobile-meta,
.transaction-mobile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-chip {
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,.72);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--fintech-ink);
    font-weight: 800;
}

.chip-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    margin-right: 6px;
}

.tx-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(31,157,104,.12);
    color: var(--fintech-forest);
    font-weight: 900;
    font-size: 0.78rem;
}

.transaction-mobile-card {
    display: none;
    border-radius: 16px;
    padding: 14px;
}

.donate-hero,
.help-hero {
    margin-bottom: 18px;
    padding: 28px;
    border-radius: 22px;
}

.donate-notice {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(43,185,197,.12);
    color: var(--fintech-forest);
    font-weight: 800;
}

.method-grid,
.premium-features,
.help-search {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.roadmap-list {
    display: grid;
    gap: 12px;
}

.roadmap-list div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(18,60,45,.06);
}

.empty-state {
    position: relative;
    padding: 32px;
    border-radius: 18px;
    text-align: center;
}

.empty-state h3 {
    margin-top: 10px;
    color: var(--fintech-ink);
}

.help-tip {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(18,60,45,.1);
    color: var(--fintech-forest);
    cursor: help;
    position: relative;
}

.help-tip:hover::after,
.help-tip:focus::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    z-index: 40;
    width: min(260px, 80vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: #102b22;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    box-shadow: var(--premium-shadow);
}

.hide-help-tips .help-tip {
    display: none;
}

.onboarding-wizard-shell,
.product-tour-layer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(8, 20, 16, 0.48);
    backdrop-filter: blur(10px);
    padding: 18px;
}

.onboarding-wizard-shell.open,
.product-tour-layer.open {
    display: grid;
    place-items: center;
}

.onboarding-wizard {
    width: min(980px, 100%);
    max-height: min(820px, 92vh);
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    padding: 18px;
    border-radius: 24px;
    overflow: auto;
}

.wizard-skip {
    position: absolute;
    top: 18px;
    right: 18px;
    border: 0;
    background: transparent;
    color: var(--fintech-forest);
    font-weight: 800;
    cursor: pointer;
}

.wizard-rail,
.wizard-main,
.wizard-panel {
    position: relative;
    display: grid;
    gap: 16px;
}

.wizard-progress {
    display: grid;
    gap: 8px;
}

.wizard-progress button,
.preset-grid button {
    text-align: left;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,.62);
    border-radius: 14px;
    padding: 10px;
    color: var(--fintech-ink);
    font-weight: 800;
}

.wizard-progress button.active {
    background: var(--fintech-mint);
    border-color: rgba(31,157,104,.35);
}

.wizard-field {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.wizard-field input,
.wizard-field select,
.help-search input {
    width: 100%;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255,255,255,.86);
}

.feature-chip-grid,
.preset-grid,
.wizard-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.feature-chip-grid span,
.wizard-overview-grid div {
    padding: 12px;
    border-radius: 14px;
    background: rgba(18,60,45,.07);
}

.wizard-actions,
.wizard-quickstart {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.tour-spotlight {
    position: fixed;
    border: 2px solid var(--fintech-cyan);
    box-shadow: 0 0 0 9999px rgba(8,20,16,.52), 0 0 24px rgba(43,185,197,.35);
    pointer-events: none;
    transition: all .24s ease;
}

.tour-popover {
    position: fixed;
    z-index: 2002;
    padding: 18px;
    border-radius: 18px;
}

.tour-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.tour-highlight {
    position: relative;
    z-index: 2001;
}

.faq-section details {
    padding: 14px 0;
    border-top: 1px solid var(--glass-border);
}

.faq-section summary {
    cursor: pointer;
    font-weight: 900;
    color: var(--fintech-ink);
}

.reveal-card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .42s ease, transform .42s ease, box-shadow .18s ease;
}

.reveal-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* V1.0.3: dashboard cleanup and reliable fintech surfaces */
body.top-tabs-ui .workspace-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px clamp(12px, 2vw, 24px);
}

body.top-tabs-ui .workspace-brand {
    min-width: 178px;
}

body.top-tabs-ui .workspace-tab {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.82rem;
}

body.top-tabs-ui .workspace-tab i {
    width: 16px;
    height: 16px;
}

body.top-tabs-ui .fa-ellipsis-h::before {
    content: "...";
}

body.top-tabs-ui .workspace-more {
    position: relative;
    flex: 0 0 auto;
}

body.top-tabs-ui .workspace-more summary {
    list-style: none;
    cursor: pointer;
}

body.top-tabs-ui .workspace-more summary::-webkit-details-marker {
    display: none;
}

body.top-tabs-ui .workspace-more-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 70;
    width: 230px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(16, 45, 36, 0.98);
    box-shadow: 0 22px 48px rgba(7, 22, 17, 0.28);
    display: grid;
    gap: 4px;
}

body.top-tabs-ui .workspace-more:not([open]) .workspace-more-menu {
    display: none;
}

body.top-tabs-ui .workspace-more-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-weight: 850;
}

body.top-tabs-ui .workspace-more-menu a:hover,
body.top-tabs-ui .workspace-more-menu a.active {
    background: rgba(223, 247, 233, 0.12);
    color: #ffffff;
}

body.top-tabs-ui .workspace-more-menu i {
    width: 18px;
    color: #dff7e9;
}

body.top-tabs-ui .workspace-actions {
    gap: 6px;
}

body.top-tabs-ui .shell-action {
    height: 36px;
    min-width: 36px;
}

body.top-tabs-ui .user-chip {
    max-width: 210px;
}

body.top-tabs-ui .workspace-subbar {
    padding: 7px clamp(12px, 2vw, 24px);
}

body.top-tabs-ui .dashboard-hero {
    padding: 16px 20px;
    margin-bottom: 16px;
}

body.top-tabs-ui .dashboard-hero .page-title {
    font-size: clamp(1.45rem, 2vw, 2rem);
}

body.top-tabs-ui .dashboard-hero .page-subtitle {
    max-width: 760px;
}

body.top-tabs-ui .dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

body.top-tabs-ui .executive-kpi-grid {
    grid-template-columns: repeat(4, minmax(210px, 1fr));
}

body.top-tabs-ui .finance-metric-card {
    min-height: 150px;
}

body[data-dashboard-density="focused"] #burnRateContent,
body[data-dashboard-density="focused"] #netWorthContent,
body[data-dashboard-density="focused"] #recurringContent {
    font-size: 0.92rem;
}

body.top-tabs-ui .ai-command-card {
    background: linear-gradient(135deg, #123c2a, #1d5b42) !important;
    color: #ffffff !important;
    border-color: rgba(223, 247, 233, 0.28) !important;
}

body.top-tabs-ui .ai-command-card .card-title,
body.top-tabs-ui .ai-command-card .text-muted,
body.top-tabs-ui .ai-command-card .loading {
    color: #ffffff !important;
}

body.top-tabs-ui .ai-command-card .ai-score-tile,
body.top-tabs-ui .ai-command-card .ai-insight-row,
body.top-tabs-ui .ai-command-card .ai-action-list a {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.market-watch-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.market-row {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(18, 60, 42, 0.1);
}

.market-row:last-child {
    border-bottom: 0;
}

.market-row strong {
    color: var(--text-primary);
    font-size: 0.88rem;
}

.market-row span {
    font-family: var(--font-mono);
}

.market-row em {
    font-style: normal;
    font-size: 0.82rem;
    font-weight: 900;
}

.market-row.unavailable {
    grid-template-columns: minmax(72px, 1fr) auto;
    color: var(--text-muted);
}

.market-settings-link {
    display: inline-flex;
    margin-top: 10px;
    color: var(--accent-cyan);
    font-weight: 900;
    text-decoration: none;
}

@media (max-width: 1380px) {
    body.top-tabs-ui .workspace-brand {
        min-width: 158px;
    }
}

@media (max-width: 1120px) {
    body.top-tabs-ui .dashboard-kpi-grid,
    body.top-tabs-ui .executive-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-hero,
    .help-hero,
    .donate-hero,
    .onboarding-wizard {
        grid-template-columns: 1fr;
    }
    .transaction-card-list {
        display: grid;
        gap: 12px;
    }
    .transactions-list-card .table-container {
        display: none;
    }
    .transaction-mobile-card {
        display: block;
    }
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body.top-tabs-ui,
    html[data-theme="dark"] body.top-tabs-ui {
        color-scheme: dark;
        background:
            radial-gradient(circle at 12% 4%, rgba(43, 185, 197, 0.16), transparent 28rem),
            linear-gradient(180deg, #081410 0, #0e201a 100%);
        color: #e8f4ef;
    }
    html[data-theme="system"] .honey-panel,
    html[data-theme="system"] .honey-card,
    html[data-theme="system"] .glass-card,
    html[data-theme="system"] body.top-tabs-ui .card,
    html[data-theme="dark"] .honey-panel,
    html[data-theme="dark"] .honey-card,
    html[data-theme="dark"] .glass-card,
    html[data-theme="dark"] body.top-tabs-ui .card {
        background: rgba(15, 34, 27, 0.82);
        border-color: rgba(207, 242, 225, 0.12);
        color: #e8f4ef;
    }
    html[data-theme="system"] .dashboard-section-title span,
    html[data-theme="system"] .metric-value,
    html[data-theme="system"] .account-balance,
    html[data-theme="dark"] .dashboard-section-title span,
    html[data-theme="dark"] .metric-value,
    html[data-theme="dark"] .account-balance {
        color: #f4fff9;
    }
    html[data-theme="system"] .account-widget p,
    html[data-theme="system"] .account-converted,
    html[data-theme="dark"] .account-widget p,
    html[data-theme="dark"] .account-converted {
        color: #b5cbc2;
    }
}

/* Final Smart Alerts contrast guard */
body.top-tabs-ui .ai-command-card {
    background: linear-gradient(135deg, #123c2a, #1d5b42) !important;
    color: #ffffff !important;
}

body.top-tabs-ui .ai-command-card .card-title,
body.top-tabs-ui .ai-command-card .text-muted,
body.top-tabs-ui .ai-command-card .loading,
body.top-tabs-ui .ai-command-card .insight-label,
body.top-tabs-ui .ai-command-card .ai-score-tile span,
body.top-tabs-ui .ai-command-card .ai-score-tile small,
body.top-tabs-ui .ai-command-card .ai-insight-row span,
body.top-tabs-ui .ai-command-card .ai-insight-row small,
body.top-tabs-ui .ai-command-card .ai-action-list .text-muted {
    color: rgba(255, 255, 255, 0.88) !important;
}

body.top-tabs-ui .ai-command-card .ai-score-tile strong {
    color: #ffffff !important;
}

body.top-tabs-ui .ai-command-card .ai-score-tile,
body.top-tabs-ui .ai-command-card .ai-insight-row,
body.top-tabs-ui .ai-command-card .ai-action-list a {
    background: rgba(255, 255, 255, 0.13) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

/* V1.0.4 polish: unclipped menus, cleaner spacing, stronger responsive cards */
body.top-tabs-ui .top-shell {
    padding-inline: 4px !important;
}

body.top-tabs-ui .top-shell,
body.top-tabs-ui .workspace-header,
body.top-tabs-ui .workspace-tabs {
    overflow: visible !important;
}

body.top-tabs-ui .workspace-header {
    grid-template-columns: minmax(138px, auto) minmax(0, 1fr) max-content !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: none !important;
    padding: 6px 8px !important;
}

body.top-tabs-ui .workspace-brand {
    min-width: 138px !important;
    gap: 7px !important;
}

body.top-tabs-ui .brand-mark {
    width: 36px !important;
    height: 36px !important;
}

body.top-tabs-ui .brand-copy strong {
    font-size: 0.96rem !important;
}

body.top-tabs-ui .brand-copy small {
    font-size: 0.76rem !important;
}

body.top-tabs-ui .workspace-tabs {
    gap: 4px !important;
    padding: 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
}

body.top-tabs-ui .workspace-tab {
    flex: 0 0 auto !important;
    gap: 6px !important;
    min-height: 36px !important;
    padding: 0 8px !important;
    font-size: 0.78rem !important;
}

body.top-tabs-ui .workspace-tab span {
    display: inline !important;
}

body.top-tabs-ui .workspace-tab i,
body.top-tabs-ui .shell-action i,
.btn i {
    flex: 0 0 auto;
    margin-right: 2px;
}

body.top-tabs-ui .shell-action,
.btn,
.metric-top,
.stat-change,
.account-actions,
.account-widget-main,
.account-meta {
    gap: 7px !important;
}

body.top-tabs-ui .workspace-more {
    position: relative !important;
    min-width: max-content;
    margin-right: 4px;
    z-index: 1000;
}

body.top-tabs-ui .workspace-more summary {
    min-width: 70px;
}

body.top-tabs-ui .workspace-actions {
    min-width: max-content;
    position: relative;
    z-index: 80;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 5px !important;
}

body.top-tabs-ui .shell-action {
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 9px !important;
}

body.top-tabs-ui .icon-action {
    width: 36px !important;
    padding: 0 !important;
}

body.top-tabs-ui .user-chip {
    max-width: 174px !important;
    padding-right: 7px !important;
}

body.top-tabs-ui .user-chip-copy strong,
body.top-tabs-ui .user-chip-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.top-tabs-ui .logout-form {
    margin-left: 0;
    order: 99;
}

body.top-tabs-ui .workspace-more-menu {
    top: calc(100% + 12px) !important;
    right: 0 !important;
    z-index: 3000 !important;
    width: min(260px, calc(100vw - 32px));
    pointer-events: auto;
}

body.top-tabs-ui .workspace-more[open] .workspace-more-menu {
    display: grid !important;
}

body.top-tabs-ui .workspace-more-menu a {
    gap: 14px !important;
    padding: 0 12px !important;
}

body.top-tabs-ui .finance-metric-card,
body.top-tabs-ui .stat-card {
    min-height: 176px;
}

body.top-tabs-ui .dashboard-kpi-grid,
body.top-tabs-ui .executive-kpi-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
    gap: 22px !important;
}

body.top-tabs-ui .metric-top {
    display: flex;
    align-items: center;
}

.account-section {
    margin-bottom: 20px;
}

.account-section-header {
    align-items: flex-start;
    margin-bottom: 14px;
}

.account-section-header p {
    margin: 6px 0 0;
}

.account-widget {
    display: flex;
    min-height: 250px;
    flex-direction: column;
}

.account-widget-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 18px !important;
}

.account-widget h3,
.account-widget p {
    overflow-wrap: anywhere;
}

.account-actions {
    justify-content: flex-start !important;
    flex-wrap: wrap;
    margin-top: auto;
}

.account-actions .btn {
    min-height: 38px;
}

.settings-grid,
.admin-form-grid {
    gap: 18px !important;
}

.form-group label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}

.form-control,
.form-input,
.form-select,
.form-textarea {
    min-height: 44px;
}

.fas,
.fa {
    text-align: center;
}

@media (max-width: 1380px) {
    body.top-tabs-ui .workspace-tab {
        padding: 0 11px !important;
    }

    body.top-tabs-ui .dashboard-kpi-grid,
    body.top-tabs-ui .executive-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    body.top-tabs-ui .dashboard-kpi-grid,
    body.top-tabs-ui .executive-kpi-grid,
    .settings-grid,
    .admin-form-grid,
    #tabWallets .grid-2 {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    body.top-tabs-ui .workspace-tabs {
        overflow-y: auto !important;
    }

    body.top-tabs-ui .workspace-more {
        width: 100%;
    }

    body.top-tabs-ui .workspace-more summary {
        width: 100%;
    }

    body.top-tabs-ui .workspace-more-menu {
        position: static !important;
        width: 100%;
        margin-top: 8px;
    }
}

/* V1.0.6 last-mile global polish */
body.top-tabs-ui .fa-edit::before,
.fa-edit::before {
    content: "\270e" !important;
}

body.top-tabs-ui .fa-trash::before,
.fa-trash::before {
    content: "\232b" !important;
}

body.top-tabs-ui .fa-download::before,
.fa-download::before {
    content: "\2193" !important;
}

body.top-tabs-ui .fa-upload::before,
.fa-upload::before {
    content: "\2191" !important;
}

body.top-tabs-ui .btn,
body.top-tabs-ui .workspace-tab,
body.top-tabs-ui .quick-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.58rem;
}

body.top-tabs-ui .btn-sm {
    gap: 0.44rem;
}

body.top-tabs-ui .help-tip {
    position: relative;
    overflow: visible;
}

body.top-tabs-ui .help-tip:hover::after,
body.top-tabs-ui .help-tip:focus::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 10px) !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    z-index: 50000 !important;
    width: min(280px, 82vw);
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid rgba(223, 247, 233, 0.22);
    border-radius: 12px;
    background: #0b2f24 !important;
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
    text-shadow: none !important;
    text-transform: none;
    transform: translateX(-50%);
    white-space: normal;
    box-shadow: 0 18px 44px rgba(8, 20, 16, 0.28);
    pointer-events: none;
}

.donation-config-card,
.donation-method-info {
    margin-bottom: 18px;
}

.donation-method-info {
    display: grid;
    gap: 12px;
}

.donation-public-note {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    border-radius: 14px;
    background: rgba(18, 60, 45, 0.055);
    color: var(--text-primary);
}

.donation-method-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.donation-method-row {
    display: grid;
    gap: 5px;
    min-height: 78px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.donation-method-row strong {
    color: var(--fintech-forest);
}

.donation-method-row span {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.goal-actions {
    flex-wrap: wrap;
}

body.top-tabs-ui .data-table td .btn[onclick*="delete"],
body.top-tabs-ui .data-table td .btn[onclick*="edit"] {
    min-width: 40px;
}

body.top-tabs-ui #transactionsTable .transaction-icon-btn,
body.top-tabs-ui .transaction-mobile-actions .transaction-icon-btn {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    flex: 0 0 34px;
    padding: 0 !important;
}

/* V1.0.7 global settings cleanup */
.settings-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.settings-overview-card {
    min-height: 132px;
    padding: 18px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(236, 248, 242, 0.76)),
        var(--honeycomb-pattern);
    box-shadow: 0 18px 48px rgba(20, 57, 43, 0.1);
}

.settings-overview-card strong {
    display: block;
    margin: 6px 0;
    color: var(--fintech-ink);
    font-size: 1.02rem;
}

.settings-overview-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.settings-nav-card {
    position: relative;
    z-index: 30;
}

.settings-tab-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    overflow-x: auto;
}

.settings-tab-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.settings-tab-row .btn-primary {
    margin-left: auto;
}

.wallet-settings-card {
    overflow: hidden;
}

.wallet-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    max-width: 980px;
}

.wallet-settings-grid .form-group {
    margin-bottom: 0;
}

.wallet-checkbox-card {
    display: flex;
    align-items: center;
    min-height: 74px;
    padding: 12px 14px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.wallet-checkbox-card label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    line-height: 1.35;
}

.wallet-checkbox-card input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.wallet-checkbox-card-wide {
    grid-column: 1 / -1;
    min-height: 52px;
}

.wallet-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px 0;
}

.wallet-setup-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    border-radius: 16px;
    background: rgba(18, 60, 45, 0.055);
}

.wallet-setup-note strong {
    color: var(--fintech-forest);
    white-space: nowrap;
}

.wallet-setup-note span {
    color: var(--text-muted);
}

@media (max-width: 980px) {
    .settings-overview-grid {
        grid-template-columns: 1fr;
    }

    .wallet-settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-tab-row .btn-primary {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .wallet-setup-note {
        display: grid;
    }
}

/* V1.0.8 dashboard simplification and investment cards */
.dashboard-section-title-tight {
    margin-top: 8px;
}

.dashboard-health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-health-grid .stat-card {
    min-width: 0;
    min-height: 188px;
    padding: 18px;
}

.dashboard-health-grid .stat-label {
    line-height: 1.25;
}

.dashboard-health-grid .stat-value {
    max-width: 100%;
    font-size: clamp(1.45rem, 1.5vw, 2rem);
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.dashboard-health-grid .stat-change {
    max-width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dashboard-tab-shell {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 8px 0 18px;
    padding: 8px;
    overflow-x: auto;
    border: 1px solid rgba(21, 66, 49, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 38px rgba(20, 57, 43, 0.08);
}

.dashboard-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--fintech-forest);
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}

.dashboard-tab.active {
    border-color: rgba(21, 66, 49, 0.2);
    background: #0b4f36;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(11, 79, 54, 0.2);
}

.dashboard-tab-panel {
    display: none;
    animation: fadeInUp 0.28s ease both;
}

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

.dashboard-tab-panel.active {
    display: grid;
    gap: 18px;
}

.dashboard-panel-grid,
.dashboard-investment-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 18px;
    align-items: stretch;
}

.portfolio-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.portfolio-summary-tile,
.dashboard-asset-card,
.asset-dashboard-card {
    border: 1px solid rgba(21, 66, 49, 0.13);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 30px rgba(20, 57, 43, 0.08);
}

.portfolio-summary-tile {
    display: grid;
    gap: 6px;
    min-height: 116px;
    padding: 14px;
}

.portfolio-summary-tile span,
.portfolio-summary-tile small,
.asset-dashboard-card p,
.asset-dashboard-card small,
.dashboard-asset-card small {
    color: var(--text-muted);
}

.portfolio-summary-tile strong {
    color: var(--fintech-ink);
    font-size: 1.2rem;
}

.portfolio-summary-tile.positive strong,
.asset-gain-row.text-success strong,
.asset-gain-row.text-success span {
    color: #047857;
}

.portfolio-summary-tile.negative strong,
.asset-gain-row.text-danger strong,
.asset-gain-row.text-danger span {
    color: #b42318;
}

.allocation-visual {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: center;
}

.allocation-donut {
    width: 170px;
    aspect-ratio: 1;
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(21, 66, 49, 0.08), 0 16px 36px rgba(20, 57, 43, 0.12);
}

.allocation-donut::after {
    content: "";
    position: absolute;
    inset: 42px;
    border-radius: 50%;
    background: #f8fcfa;
    box-shadow: inset 0 0 0 1px rgba(21, 66, 49, 0.08);
}

.allocation-legend {
    display: grid;
    gap: 10px;
}

.allocation-legend div {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.allocation-legend span {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.allocation-legend em {
    color: var(--text-muted);
    font-style: normal;
}

.dashboard-asset-list,
.asset-cards-grid {
    display: grid;
    gap: 12px;
}

.asset-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 16px;
}

.dashboard-asset-card,
.asset-dashboard-card {
    padding: 16px;
}

.dashboard-asset-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.dashboard-asset-card h4,
.asset-dashboard-card h3 {
    margin: 8px 0 4px;
    color: var(--fintech-ink);
}

.asset-card-values {
    display: grid;
    gap: 4px;
    text-align: right;
}

.asset-card-values strong,
.asset-current-value {
    color: var(--fintech-ink);
    font-size: 1.25rem;
    font-weight: 900;
}

.asset-type-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(11, 79, 54, 0.1);
    color: var(--fintech-forest);
    font-weight: 900;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.asset-dashboard-card {
    display: grid;
    gap: 10px;
    min-height: 248px;
}

.asset-dashboard-card-top,
.asset-metric-row,
.asset-gain-row,
.dashboard-action-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.asset-metric-row span {
    color: var(--text-muted);
}

.asset-current-value {
    font-size: 1.8rem;
}

.asset-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.asset-card-actions .btn {
    flex: 1 1 120px;
    justify-content: center;
    min-height: 38px;
}

.market-suggestion-panel {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(11, 79, 54, 0.18);
    border-radius: 8px;
    background: rgba(232, 247, 238, 0.82);
}

.market-suggestion-heading {
    color: var(--fintech-forest);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.market-suggestion-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.market-suggestion-row:hover {
    border-color: var(--fintech-forest);
    box-shadow: 0 8px 20px rgba(11, 79, 54, 0.12);
}

.market-suggestion-row span,
.market-suggestion-row small {
    min-width: 0;
}

.market-suggestion-row strong,
.market-suggestion-row small {
    display: block;
}

.market-suggestion-row small {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.market-suggestion-row em {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: normal;
}

.insight-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.insight-tile,
.asset-dashboard-card,
.asset-metric-row,
.asset-card-values {
    min-width: 0;
}

.insight-tile strong,
.asset-current-value,
.asset-card-values strong,
.asset-metric-row strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.1;
}

#portfolioInsights .insight-tile strong {
    font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.asset-metric-row {
    align-items: flex-start;
}

.asset-metric-row strong {
    text-align: right;
}

.dashboard-action-grid {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.dashboard-empty-small {
    padding: 20px;
    text-align: left;
}

.account-asset-valuation-grid {
    display: grid;
    grid-template-columns: minmax(190px, 0.9fr) repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.asset-valuation-current,
.account-asset-gain,
.asset-history-panel,
.dashboard-debt-tile,
.dashboard-debt-card {
    border: 1px solid rgba(21, 66, 49, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.asset-valuation-current {
    display: grid;
    gap: 6px;
    padding: 12px;
    min-height: 92px;
}

.asset-valuation-current span,
.asset-valuation-current small,
.asset-history-panel small,
.account-asset-gain small,
.dashboard-debt-tile span,
.dashboard-debt-tile small,
.dashboard-debt-card small,
.dashboard-debt-meta {
    color: var(--text-muted);
}

.asset-valuation-current strong {
    color: var(--fintech-ink);
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.asset-history-panel {
    padding: 14px;
}

.asset-history-modal-card {
    width: min(96vw, 860px);
    max-height: 90vh;
    overflow-y: auto;
}

.asset-history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.asset-history-stat {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid rgba(21, 66, 49, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
}

.asset-history-stat span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.asset-history-stat strong {
    color: var(--fintech-ink);
    overflow-wrap: anywhere;
}

.asset-history-stat.positive strong {
    color: #047857;
}

.asset-history-stat.negative strong {
    color: #b42318;
}

.asset-history-source {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(11, 79, 54, 0.1);
    color: var(--fintech-forest);
    font-size: 0.78rem;
    font-weight: 900;
}

.asset-history-table-wrap {
    max-height: 440px;
    overflow: auto;
}

.asset-history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.asset-history-actions .btn {
    min-height: 32px;
    gap: 5px;
    padding: 6px 8px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .currency-conversion-result {
        align-items: flex-start;
        flex-direction: column;
    }

    .currency-conversion-result strong {
        text-align: left;
    }
}

.account-asset-gain {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    margin-top: 10px;
}

.account-asset-gain strong {
    color: var(--fintech-ink);
}

.account-asset-gain.positive span,
.account-asset-gain.positive strong {
    color: #047857;
}

.account-asset-gain.negative span,
.account-asset-gain.negative strong {
    color: #b42318;
}

.account-asset-gain.neutral {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.dashboard-debt-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-debt-tile {
    display: grid;
    gap: 6px;
    min-height: 116px;
    padding: 14px;
}

.dashboard-debt-tile strong {
    color: var(--fintech-ink);
    font-size: 1.25rem;
    overflow-wrap: anywhere;
}

.dashboard-debt-list {
    display: grid;
    gap: 12px;
}

.dashboard-debt-card {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.dashboard-debt-card-top,
.dashboard-debt-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.dashboard-debt-card h4 {
    margin: 8px 0 4px;
    color: var(--fintech-ink);
    overflow-wrap: anywhere;
}

.dashboard-debt-card-top strong {
    color: var(--fintech-ink);
    font-size: 1.2rem;
    text-align: right;
    white-space: nowrap;
}

.dashboard-debt-meta {
    flex-wrap: wrap;
    font-size: 0.86rem;
}

.debt-progress-mini span {
    background: linear-gradient(90deg, #0f8f62, #d99b13);
}

@media (max-width: 1500px) {
    .dashboard-health-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .portfolio-summary-grid,
    .dashboard-panel-grid,
    .dashboard-investment-grid,
    .allocation-visual {
        grid-template-columns: 1fr;
    }

    .dashboard-health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-asset-card {
        grid-template-columns: 1fr;
    }

    .dashboard-debt-summary,
    .account-asset-valuation-grid {
        grid-template-columns: 1fr 1fr;
    }

    .asset-card-values {
        text-align: left;
    }
}

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

    .dashboard-debt-summary,
    .account-asset-valuation-grid,
    .dashboard-debt-card-top {
        grid-template-columns: 1fr;
    }

    .dashboard-debt-card-top {
        display: grid;
    }

    .dashboard-debt-card-top strong {
        text-align: left;
    }
}

/* Transaction form pages need natural document scrolling. The global top-tabs
   card polish clips overflow, so override it only for add/edit transaction. */
body.top-tabs-ui .transaction-page-shell {
    overflow: visible;
    min-height: auto;
    padding-bottom: clamp(44px, 7vh, 84px);
}

body.top-tabs-ui .transaction-page-form {
    max-height: none;
    overflow: visible;
}

body.top-tabs-ui .transaction-page-form > .card-header,
body.top-tabs-ui .transaction-page-actions {
    position: static;
}

body.top-tabs-ui .transaction-page-actions {
    bottom: auto;
    z-index: auto;
}

body.top-tabs-ui .transaction-page-form .form-textarea {
    min-height: 120px;
    resize: vertical;
    overflow: auto;
}

/* Canonical local icon fallback. Keep this last so older versioned icon
   patches cannot turn buttons back into letters such as r, e, d, D, or U. */
.fas,
.fa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    min-width: 1.1em;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.fa-coins::before { content: "\25CE" !important; }
.fa-chart-line::before { content: "\2197" !important; }
.fa-university::before { content: "\25A3" !important; }
.fa-exchange-alt::before { content: "\21C4" !important; }
.fa-chart-pie::before { content: "\25D4" !important; }
.fa-briefcase::before { content: "\25A3" !important; }
.fa-calculator::before { content: "\2211" !important; }
.fa-cog::before { content: "\2699" !important; }
.fa-user::before { content: "\25CF" !important; }
.fa-sign-out-alt::before,
.fa-sign-in-alt::before { content: "\2192" !important; }
.fa-check::before,
.fa-check-circle::before { content: "\2713" !important; }
.fa-exclamation-circle::before,
.fa-exclamation-triangle::before { content: "!" !important; }
.fa-info-circle::before { content: "i" !important; }
.fa-sync::before,
.fa-sync-alt::before { content: "\21BB" !important; }
.fa-spinner::before { content: "\25CC" !important; }
.fa-plus::before,
.fa-plus-circle::before,
.fa-user-plus::before { content: "+" !important; }
.fa-times::before { content: "\00D7" !important; }
.fa-sliders-h::before { content: "\2261" !important; }
.fa-edit::before { content: "\270E" !important; }
.fa-trash::before { content: "\232B" !important; }
.fa-arrow-left::before { content: "\2190" !important; }
.fa-arrow-up::before,
.fa-upload::before { content: "\2191" !important; }
.fa-arrow-down::before,
.fa-download::before { content: "\2193" !important; }
.fa-chevron-left::before { content: "\2039" !important; }
.fa-chevron-right::before { content: "\203A" !important; }
.fa-wallet::before { content: "\25A4" !important; }
.fa-calendar-alt::before,
.fa-history::before { content: "\25F7" !important; }
.fa-minus::before { content: "\2212" !important; }
.fa-filter::before { content: "\25A6" !important; }
.fa-home::before { content: "\2302" !important; }
.fa-bars::before { content: "\2630" !important; }
.fa-shield-alt::before { content: "\25C6" !important; }
.fa-heart::before,
.fa-donate::before { content: "$" !important; }
.fa-question-circle::before { content: "?" !important; }
.fa-ellipsis-h::before { content: "\2026" !important; }
.fa-paper-plane::before { content: "\27A4" !important; }

.ai-os-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ai-os-dashboard-tile {
    display: grid;
    gap: 6px;
    min-width: 0;
    min-height: 134px;
    padding: 14px;
    border: 1px solid rgba(21, 66, 49, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
}

.ai-os-dashboard-tile span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.ai-os-dashboard-tile strong {
    color: var(--fintech-ink);
    font-size: 1rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.ai-os-dashboard-tile small {
    color: var(--text-muted);
    line-height: 1.35;
}

.ai-os-dashboard-tile.risk-High {
    border-color: rgba(180, 35, 24, 0.28);
    background: rgba(255, 241, 240, 0.85);
}

.ai-os-dashboard-tile.risk-Medium {
    border-color: rgba(217, 155, 19, 0.3);
    background: rgba(255, 248, 233, 0.85);
}

.ai-os-dashboard-tile.risk-Low {
    border-color: rgba(15, 143, 98, 0.25);
    background: rgba(236, 248, 241, 0.85);
}

@media (max-width: 1100px) {
    .ai-os-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ai-os-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.btn i,
.shell-action i,
.workspace-tab i {
    flex: 0 0 1.1em;
    margin-right: 0;
}

.fa-spin {
    animation: localIconSpin 0.8s linear infinite;
}

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

/* Smartphone transaction flow and recurring-login prompt */
.main-account-transaction-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    margin: -10px 0 18px;
    padding: 14px 16px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 30px rgba(20, 57, 43, 0.08);
}

.main-account-transaction-summary span,
.transaction-balance-tile span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.main-account-transaction-summary strong,
.transaction-balance-tile strong {
    color: var(--fintech-ink);
    font-size: 1.18rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.main-account-transaction-summary small,
.transaction-balance-tile small {
    color: var(--text-muted);
    line-height: 1.35;
}

.transaction-account-snapshot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 22px;
}

.transaction-balance-tile {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(21, 66, 49, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
}

.transaction-balance-tile.main {
    background: rgba(236, 248, 241, 0.86);
}

.recurring-login-modal {
    z-index: 1200;
    align-items: center;
    justify-content: center;
}

.recurring-login-card {
    width: min(94vw, 580px);
    max-height: 88vh;
    overflow: auto;
    margin: 0;
}

.recurring-login-header {
    align-items: flex-start;
}

.recurring-login-close {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
}

.recurring-login-list {
    display: grid;
    gap: 10px;
}

.recurring-login-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(21, 66, 49, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
}

.recurring-login-row strong,
.recurring-login-row span {
    display: block;
    min-width: 0;
}

.recurring-login-row strong {
    color: var(--fintech-ink);
}

.recurring-login-row span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.recurring-login-row b {
    color: var(--fintech-ink);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.recurring-login-row.income b {
    color: var(--accent-green);
}

.recurring-login-row.expense b {
    color: #b42318;
}

.recurring-login-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

@media (max-width: 760px) {
    body.top-tabs-ui .main-content,
    body.top-tabs-ui.compact-mode .main-content {
        width: 100%;
        padding: 14px 10px 104px !important;
    }

    body.top-tabs-ui .page-header,
    body.top-tabs-ui .card {
        border-radius: 12px;
        padding: 16px;
    }

    .page-header-row,
    body.top-tabs-ui .dashboard-hero > div {
        display: grid !important;
        grid-template-columns: 1fr !important;
        align-items: start !important;
        gap: 12px !important;
    }

    .page-title {
        font-size: 1.6rem;
        line-height: 1.12;
    }

    .header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        min-height: 42px;
        padding: 0 10px;
    }

    .main-account-transaction-summary,
    .transaction-account-snapshot,
    .transaction-type-grid,
    .transaction-form-grid {
        grid-template-columns: 1fr;
    }

    .main-account-transaction-summary {
        align-items: start;
        margin-top: -4px;
    }

    .filter-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .filter-grid .form-group {
        min-width: 0 !important;
        margin-bottom: 0;
    }

    .filter-grid .btn {
        width: 100%;
    }

    .quick-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .quick-chips::-webkit-scrollbar {
        display: none;
    }

    .quick-chip {
        flex: 0 0 auto;
    }

    .transaction-mobile-top {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .transaction-mobile-top .amount {
        grid-column: 1 / -1;
        justify-self: start;
        font-size: 1.08rem;
    }

    .transaction-mobile-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
    }

    body.top-tabs-ui .transaction-mobile-actions .transaction-icon-btn {
        width: 100% !important;
        min-width: 0 !important;
    }

    .transaction-page-shell {
        display: block;
        min-height: auto;
        padding-bottom: 92px;
    }

    body.top-tabs-ui .transaction-page-form {
        padding: 16px;
    }

    .transaction-type-option {
        min-height: 86px;
    }

    .transaction-page-actions {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 950 !important;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 0 !important;
        padding: 10px;
        border-top: 1px solid rgba(21, 66, 49, 0.16);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -16px 36px rgba(20, 57, 43, 0.16);
    }

    .transaction-page-actions .btn {
        width: 100%;
        min-width: 0;
    }

    #saveTransactionButton {
        grid-column: 1 / -1;
        order: -1;
    }

    body.top-tabs-ui .workspace-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body.top-tabs-ui .workspace-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        width: 100%;
    }

    body.top-tabs-ui .workspace-actions .primary-action {
        width: 100%;
    }

    body.top-tabs-ui .workspace-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 70vh;
        overflow-y: auto !important;
    }

    body.top-tabs-ui .workspace-tab {
        min-width: 0;
    }

    .recurring-login-modal {
        padding: 10px;
    }

    .recurring-login-card {
        width: 100%;
        max-height: 90dvh;
        padding: 16px;
    }

    .recurring-login-row,
    .recurring-login-actions {
        grid-template-columns: 1fr;
    }

    .recurring-login-actions {
        display: grid;
    }

    .recurring-login-actions .btn {
        width: 100%;
    }

    #toast-container {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 16px;
    }
}

/* Smartphone auth fix: keep the login form visible before the brand panel. */
@media (max-width: 760px) {
    .auth-page,
    .auth-main {
        min-height: 100dvh;
        width: 100%;
        overflow-x: hidden;
    }

    .auth-main {
        display: block;
        padding: 0 !important;
    }

    .auth-stage {
        min-height: 100dvh;
        display: block;
        overflow-y: auto;
        padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    }

    .auth-stage::before,
    .particle-field {
        display: none;
    }

    .auth-shell {
        display: flex;
        flex-direction: column;
        width: min(100%, 430px);
        gap: 12px;
        margin: 0 auto;
    }

    .auth-card {
        order: 1;
        width: 100%;
        padding: 22px 18px;
        align-self: stretch;
        border-radius: 18px;
    }

    .auth-card-header {
        margin-bottom: 18px;
    }

    .auth-card-header h2 {
        font-size: 1.35rem;
    }

    .auth-card .form-group {
        margin-bottom: 14px;
    }

    .auth-card .form-input {
        min-height: 48px;
        font-size: 16px;
    }

    .auth-submit {
        min-height: 50px;
    }

    .auth-footer-note {
        margin-top: 16px;
    }

    .auth-brand-panel {
        order: 2;
        min-height: auto;
        padding: 16px;
        border-radius: 18px;
    }

    .auth-logo {
        width: 42px;
        height: 42px;
        margin-bottom: 10px;
        font-size: 20px;
    }

    .auth-kicker {
        margin-bottom: 6px;
        font-size: 0.72rem;
    }

    .auth-brand-panel h1 {
        font-size: 1.25rem;
        line-height: 1.12;
        margin-bottom: 8px;
    }

    .auth-copy {
        font-size: 0.86rem;
        margin-bottom: 0;
    }

    .auth-metrics {
        gap: 6px;
        margin-top: 12px;
    }

    .auth-metrics span {
        padding: 6px 9px;
        font-size: 0.74rem;
    }
}
