::-webkit-scrollbar {
width: 8px; 
height: 8px; 
}

::-webkit-scrollbar-track {
background: #121212;
}

::-webkit-scrollbar-thumb {
background: #2a2a2a; 
border-radius: 4px;  
}

::-webkit-scrollbar-thumb:hover {
background: #3e3e3e; 
}

/* Ensure the button is prominent but not intrusive on mobile */
#install-btn {
    width: 90%;
    margin: 15px auto;
    display: none; /* Keep hidden by default; JS will show it */
    background-color: var(--accent-blue, #2563eb);
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    border: none;
}

#install-btn:hover {
    background-color: var(--accent-blue-dark, #1d4ed8);
    transform: translateY(-1px);
}

#install-btn:active {
    transform: translateY(0);
}

:root {
    --bg-main: #121214;
    --bg-card: #1a1a1e;
    --border-color: #2c2c35;
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --accent-green: #4ade80;
    --accent-red: #f87171;
    --accent-blue: #60a5fa;
    --accent-amber: #fbbf24;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-secondary: #222227;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 12px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 850px) {
    body { padding: 20px; }
    h1 { font-size: 1.8rem; }
    .dashboard-grid {
        grid-template-columns: 390px 1fr;
        gap: 20px;
    }
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    height: fit-content;
    box-sizing: border-box;
}
@media (min-width: 850px) { .card { padding: 20px; } }

.form-group {
    margin-bottom: 14px;
}

.row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 12px 10px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    box-sizing: border-box;
    font-size: 16px; 
}

@media (min-width: 850px) {
    input, select { font-size: 0.95rem; padding: 10px; }
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message-box {
    display: none;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-weight: 500;
}

button {
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

button.submit-btn {
    width: 100%;
    padding: 14px 11px;
    background-color: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}
@media (min-width: 850px) {
    button.submit-btn { padding: 11px; font-size: 0.95rem; }
}

button.submit-btn:hover { background-color: var(--primary-hover); }

.backup-zone {
    margin-top: 20px;
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.backup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.utility-btn {
    background-color: #2e2e38;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}
@media (min-width: 850px) { .utility-btn { padding: 8px 12px; } }

.utility-btn:hover { background-color: #3b3b47; }

.status-msg {
    font-size: 0.8rem;
    margin-top: 8px;
    text-align: center;
    display: none;
}

.transaction-list {
    margin-top: 20px;
    max-height: 240px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.transaction-item span.amount { font-weight: 600; margin-right: auto; margin-left: 15px; text-align: right;}

.action-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    padding: 8px 10px;
    font-weight: 600;
}

.edit-btn { color: var(--accent-blue); }
.delete-btn { color: var(--accent-red); }

.milestones-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
@media (min-width: 480px) {
    .milestones-bar { grid-template-columns: 1fr 1fr; gap: 15px; }
}

.milestone-badge {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
}

.milestone-badge.alert-danger {
    border-color: rgba(248, 113, 113, 0.4);
    background-color: rgba(248, 113, 113, 0.05);
}

.milestone-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.milestone-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.milestone-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    height: 260px;
}
@media (min-width: 850px) { .chart-container { height: 320px; } }

.table-container {
    overflow-x: auto;
    max-height: 380px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}
@media (min-width: 850px) { table { font-size: 0.9rem; } }

th, td { padding: 10px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
@media (min-width: 850px) { th, td { padding: 12px; } }

th {
    color: var(--text-muted);
    font-weight: 500;
    position: sticky;
    top: 0;
    background-color: #202024;
    z-index: 2;
}

.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }

.info-card {
    background-color: #1c1c21;
    border: 1px solid #33333f;
    border-left: 4px solid var(--accent-amber);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 20px;
}

.info-card h4 {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

::-webkit-scrollbar {
width: 8px; 
height: 8px; 
}

::-webkit-scrollbar-track {
background: #121212;
}

::-webkit-scrollbar-thumb {
background: #2a2a2a; 
border-radius: 4px;  
}

::-webkit-scrollbar-thumb:hover {
background: #3e3e3e; 
}

/* Ensure the button is prominent but not intrusive on mobile */
#install-btn {
    width: 90%;
    margin: 15px auto;
    display: none; /* Keep hidden by default; JS will show it */
    background-color: var(--accent-blue, #2563eb);
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    border: none;
}

#install-btn:hover {
    background-color: var(--accent-blue-dark, #1d4ed8);
    transform: translateY(-1px);
}

#install-btn:active {
    transform: translateY(0);
}

:root {
    --bg-main: #121214;
    --bg-card: #1a1a1e;
    --border-color: #2c2c35;
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --accent-green: #4ade80;
    --accent-red: #f87171;
    --accent-blue: #60a5fa;
    --accent-amber: #fbbf24;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-secondary: #222227;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 12px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 850px) {
    body { padding: 20px; }
    h1 { font-size: 1.8rem; }
    .dashboard-grid {
        grid-template-columns: 390px 1fr;
        gap: 20px;
    }
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    height: fit-content;
    box-sizing: border-box;
}
@media (min-width: 850px) { .card { padding: 20px; } }

.form-group {
    margin-bottom: 14px;
}

.row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 12px 10px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    box-sizing: border-box;
    font-size: 16px; 
}

@media (min-width: 850px) {
    input, select { font-size: 0.95rem; padding: 10px; }
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message-box {
    display: none;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-weight: 500;
}

button {
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

button.submit-btn {
    width: 100%;
    padding: 14px 11px;
    background-color: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}
@media (min-width: 850px) {
    button.submit-btn { padding: 11px; font-size: 0.95rem; }
}

button.submit-btn:hover { background-color: var(--primary-hover); }

.backup-zone {
    margin-top: 20px;
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.backup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.utility-btn {
    background-color: #2e2e38;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}
@media (min-width: 850px) { .utility-btn { padding: 8px 12px; } }

.utility-btn:hover { background-color: #3b3b47; }

.status-msg {
    font-size: 0.8rem;
    margin-top: 8px;
    text-align: center;
    display: none;
}

.transaction-list {
    margin-top: 20px;
    max-height: 240px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.transaction-item span.amount { font-weight: 600; margin-right: auto; margin-left: 15px; text-align: right;}

.action-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    padding: 8px 10px;
    font-weight: 600;
}

.edit-btn { color: var(--accent-blue); }
.delete-btn { color: var(--accent-red); }

.milestones-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
@media (min-width: 480px) {
    .milestones-bar { grid-template-columns: 1fr 1fr; gap: 15px; }
}

.milestone-badge {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
}

.milestone-badge.alert-danger {
    border-color: rgba(248, 113, 113, 0.4);
    background-color: rgba(248, 113, 113, 0.05);
}

.milestone-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.milestone-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.milestone-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    height: 260px;
}
@media (min-width: 850px) { .chart-container { height: 320px; } }

.table-container {
    overflow-x: auto;
    max-height: 380px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}
@media (min-width: 850px) { table { font-size: 0.9rem; } }

th, td { padding: 10px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
@media (min-width: 850px) { th, td { padding: 12px; } }

th {
    color: var(--text-muted);
    font-weight: 500;
    position: sticky;
    top: 0;
    background-color: #202024;
    z-index: 2;
}

.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }

.info-card {
    background-color: #1c1c21;
    border: 1px solid #33333f;
    border-left: 4px solid var(--accent-amber);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 20px;
}

.info-card h4 {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Update the existing modal style */
.modal { 
    display: none; 
    position: absolute; /* Changed from fixed */
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 15px;
    width: 250px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Add a little arrow pointer */
.modal::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--primary) transparent;
}