/* ====== Base (Dark Mode) ====== */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, sans-serif;
    background: #121212;
    color: #e5e5e5;
}

/* Centered container */
main {
    max-width: 900px;
    margin: 60px auto;
    padding: 30px;
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* Global link styling for dark mode */
a {
    color: #4a8cff;        /* bright blue, readable on dark */
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: #77aaff;        /* lighter blue on hover */
    text-decoration: underline;
}


/* Pixel Art Scaling (for icons) */
.icon {
    width: 60px;
    height: 60px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    margin: 0 auto;
}

/* Headings */
h1 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #ffffff;
}

/* Labels */
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #cccccc;
}

/* Inputs */
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #e5e5e5;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 20px;
}

input::placeholder {
    color: #888;
}

/* Buttons */
button,
.add-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: #2f5be3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.add-btn:hover {
    background: #2449b8;
}

/* Error box */
.error-box {
    background: #4a0000;
    border: 1px solid #aa0000;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #ffb3b3;
    font-weight: 600;
    text-align: center;
}

/* Top bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.logout {
    color: #ff6666;
}

.logout:hover {
    text-decoration: underline;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
}

th, td {
    padding: 6px 10px;
    border-bottom: 1px solid #333;
    text-align: left;
}

th {
    background: #2a2a2a;
    font-weight: 600;
    color: #cccccc;
}

.monthly-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.monthly-table th,
.monthly-table td {
    padding: 10px;
    border-bottom: 1px solid #333;
    text-align: left;
}

.monthly-table tr.positive td {
    color: #4ade80; /* green */
}

.monthly-table tr.negative td {
    color: #f87171; /* red */
}

.analysis-selector {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.analysis-selector button {
    background: #1f2937;
    color: #93c5fd;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.analysis-selector button:hover {
    background: #374151;
}

.chart-container {
    margin-top: 30px;
    padding: 20px;
    background: #111111;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

#donutChart {
    margin-top: 30px;
    padding: 20px;
    background: #111111;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}





/* Row coloring */
tr.negative {
    background-color: #3a0000; /* dark red */
}

tr.big_negative {
    background-color: #5a0000; /* slightly lighter dark red */
}

tr.positive {
    background-color: #003a00; /* dark green */
}

tr.big_positive {
    background-color: #005a00; /* slightly lighter dark green */
}

/* Action links */
.actions a {
    margin-right: 12px;
}

.actions a:hover {
    text-decoration: underline;
}

.nav-bar {
    background: #111827;              /* darker, bluish tint */
    padding: 14px 24px;
    border-bottom: 1px solid #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-bar nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-bar nav a {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
}

.nav-bar nav a:hover {
    background: rgba(37, 99, 235, 0.35);
    color: #bfdbfe;
}


/* Mobile tweaks */
@media (max-width: 480px) {
    main {
        margin: 20px;
        padding: 20px;
    }

    th, td {
        padding: 8px;
    }
}
