body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 20px;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Top navigation (tabs) */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f4f4f9;
    padding: 12px 20px;
    border-bottom: 1px solid #e6e6ee;
    margin: -20px -20px 20px -20px;
}

.top-nav-inner {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.top-nav-title {
    font-weight: 700;
    color: #333;
}

.top-nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.top-nav-tab {
    text-decoration: none;
    color: #6c63ff;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #d9d7ff;
    background: #ffffff;
}

.top-nav-tab:hover {
    background: #f0efff;
}

.top-nav-tab.active {
    background: #6c63ff;
    color: white;
    border-color: #6c63ff;
}

/* Generic page content */
.page-content h2 {
    margin-top: 10px;
}

/* Make cards match the tracker vibe (light gray panels, not bright white) */
.card {
    background: #f4f4f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
}

.muted {
    color: #666;
    font-size: 13px;
}

.file-input {
    margin-bottom: 20px;
}

.file-input label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.file-input .file-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    background: #f4f4f9;
}

.file-input input[type="file"] {
    display: none;
}

.file-input .file-label {
    background-color: #6c63ff;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.file-input .file-name {
    margin-left: 10px;
    font-size: 14px;
    color: #333;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-group, .toggle-container {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

input[type="number"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
}

/* Custom Checkbox Styling */
.toggle-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 50px;
    height: 25px;
    border-radius: 30px;
    background-color: #ccc;
    position: relative;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.toggle-container input[type="checkbox"]:checked {
    background-color: #6c63ff;
}

.toggle-container input[type="checkbox"]:before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    transition: transform 0.3s ease;
}

.toggle-container input[type="checkbox"]:checked:before {
    transform: translateX(25px);
}

.toggle-container label {
    margin-right: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

button {
    background-color: #6c63ff;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    width: 100%;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
}

th, td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

th {
    background-color: #6c63ff;
    color: white;
}

.positive-difference {
    color: green;
    font-weight: bold;
}

.negative-difference {
    color: red;
    font-weight: bold;
}

/* Layout and Spacing */
.report-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#report {
    margin-top: 30px;
}

#investmentSuggestions {
    padding-top: 20px;
}

/* Investment Suggestions */
#investmentSuggestions h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

#investmentSuggestions .total-investment {
    font-size: 18px;
    color: #6c63ff;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    background-color: #f4f4f9;
    border: 1px solid #ddd;
    text-align: center;
}

#investmentSuggestions ul {
    list-style-type: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

#investmentSuggestions li {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    font-size: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#investmentSuggestions li:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#investmentSuggestions li .investment-amount {
    font-size: 20px;
    color: #6c63ff;
    font-weight: bold;
}

#investmentSuggestions li .investment-symbol {
    font-size: 16px;
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    #investmentSuggestions ul {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    #investmentSuggestions ul {
        grid-template-columns: 1fr;
    }
}

/* Data Coverage page (GitHub-like calendar) */
.coverage-calendar {
    overflow-x: auto;
    padding-bottom: 6px;
}

.coverage-grid {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.coverage-row-labels {
    display: grid;
    grid-template-rows: repeat(7, 12px);
    gap: 4px;
    padding-top: 18px; /* align with month header */
    min-width: 38px;
}

.coverage-columns {
    display: flex;
    gap: 4px;
}

.coverage-week {
    display: grid;
    grid-template-rows: 18px repeat(7, 12px); /* month label + days */
    gap: 4px;
}

.coverage-month {
    font-size: 11px;
    color: #666;
    height: 18px;
    line-height: 18px;
    text-align: left;
    padding-left: 2px;
    white-space: nowrap;
}

.coverage-cell {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid #e0e0ea;
}

/* States */
.level-present { background: #2ea043; border-color: #2ea043; } /* GitHub-ish green */
.level-missing { background: #d73a49; border-color: #d73a49; } /* GitHub-ish red */
.level-future  { background: #d0d7de; border-color: #d0d7de; } /* GitHub-ish gray */

.coverage-legend {
    margin-top: 10px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

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

.coverage-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid #e0e0ea;
    display: inline-block;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.file-list a {
    color: #6c63ff;
    text-decoration: none;
}
.file-list a:hover {
    text-decoration: underline;
}

.coverage-ok {
    color: #1c7c3d;
    font-weight: 700;
}

/* -----------------------------
   Sortable tables (global)
   ----------------------------- */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 22px; /* room for arrow */
}

th.sortable:hover {
    filter: brightness(0.95);
}

th.sortable::after {
    content: "↕";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.75;
    font-size: 12px;
}

th.sortable.sort-asc::after {
    content: "↑";
    opacity: 1;
}

th.sortable.sort-desc::after {
    content: "↓";
    opacity: 1;
}