:root {
    --gb-lightest: #9bbc0f;
    --gb-light: #8bac0f;
    --gb-dark: #306230;
    --gb-darkest: #0f380f;
}

body {
    background-color: #202020;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'VT323', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--gb-lightest);
    border-left: 1px solid var(--gb-darkest);
}
::-webkit-scrollbar-thumb {
    background: var(--gb-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gb-darkest);
}

.gb-container {
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--gb-lightest);
    color: var(--gb-darkest);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 1);
    overflow: hidden;
    position: relative;
    /* Subtle cross-hatch shading like old monochrome LCDs */
    background-image:
        linear-gradient(0deg, transparent 24%, rgba(48, 98, 48, 0.05) 25%, rgba(48, 98, 48, 0.05) 26%, transparent 27%, transparent 74%, rgba(48, 98, 48, 0.05) 75%, rgba(48, 98, 48, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(48, 98, 48, 0.05) 25%, rgba(48, 98, 48, 0.05) 26%, transparent 27%, transparent 74%, rgba(48, 98, 48, 0.05) 75%, rgba(48, 98, 48, 0.05) 76%, transparent 77%, transparent);
    background-size: 4px 4px;
}

@media (max-width: 400px) {
    body {
        background-color: var(--gb-lightest);
    }

    .gb-container {
        box-shadow: none;
    }
}

.gb-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--gb-darkest);
    color: var(--gb-lightest);
    min-height: 40px;
}

.nav-links a {
    color: var(--gb-light);
    text-decoration: none;
    margin-right: 15px;
    font-size: 20px;
    text-transform: uppercase;
}

.nav-links a.active {
    color: var(--gb-lightest);
    border-bottom: 2px solid var(--gb-lightest);
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--gb-lightest);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-family: inherit;
    box-shadow: none !important;
}

.icon-btn:active {
    transform: none !important;
}

.logout-btn {
    text-decoration: none;
}

.gb-screen {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* KPIs */
.kpi-controls {
    margin-bottom: 15px;
    text-align: right;
}

.gb-btn {
    font-family: 'VT323', monospace;
    background-color: var(--gb-darkest);
    color: var(--gb-lightest);
    border: 2px solid var(--gb-darkest);
    padding: 5px 10px;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 2px 2px 0px var(--gb-dark);
}

.gb-btn:active {
    box-shadow: 0px 0px 0px var(--gb-dark);
    transform: translate(2px, 2px);
}

.cycle-btn {
    font-size: 18px;
}

.grid-2x3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 15px;
}

.kpi-card {
    border: 2px solid var(--gb-darkest);
    padding: 10px;
    background-color: var(--gb-light);
    box-shadow: 2px 2px 0px var(--gb-darkest);
    display: flex;
    flex-direction: column;
}

.kpi-bad {
    background-color: var(--gb-darkest);
    color: var(--gb-lightest);
    border-color: var(--gb-darkest);
}

.kpi-bad .kpi-header {
    border-bottom-color: var(--gb-lightest);
}

.kpi-header {
    font-size: 14px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--gb-darkest);
    margin-bottom: 5px;
    padding-bottom: 2px;
}

.kpi-value {
    display: none;
    text-align: center;
    min-height: 55px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.kpi-value.active {
    display: flex;
}

.kpi-value .val {
    font-size: 32px;
    font-weight: bold;
    line-height: 1.2;
}

.kpi-value .kpi-date {
    font-size: 14px;
}

.diff {
    font-size: 14px;
}

/* Progress */
.list-1x4 {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.page-title {
    text-align: center;
    margin-top: 0;
    border-bottom: 2px solid var(--gb-darkest);
    padding-bottom: 10px;
}

.progress-card {
    border: 2px solid var(--gb-darkest);
    padding: 10px;
    background-color: var(--gb-light);
    box-shadow: 2px 2px 0px var(--gb-darkest);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    margin-bottom: 8px;
}

.progress-bar-container {
    height: 20px;
    border: 2px solid var(--gb-darkest);
    background-color: var(--gb-lightest);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--gb-dark);
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.3s;
}

.progress-bar.over-complete {
    background: repeating-linear-gradient(45deg,
            var(--gb-darkest),
            var(--gb-darkest) 10px,
            var(--gb-dark) 10px,
            var(--gb-dark) 20px);
}

.progress-footer {
    font-size: 12px;
    margin-top: 5px;
    text-align: right;
}

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.login-container h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-container p {
    font-size: 20px;
    animation: blink 1.2s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.large-btn {
    font-size: 24px;
    padding: 15px 30px;
    margin-top: 40px;
    text-decoration: none;
}

/* Modal */
.modal {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 56, 15, 0.9);
    z-index: 1000;
}

.modal-content {
    background-color: var(--gb-light);
    border: 4px solid var(--gb-darkest);
    width: 90%;
    height: 80%;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background-color: var(--gb-darkest);
    color: var(--gb-lightest);
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.close {
    cursor: pointer;
    font-size: 20px;
}

.logs {
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
    flex: 1;
    color: var(--gb-darkest);
}

/* History Accordion */
.accordion {
    width: 100%;
}

.accordion-btn {
    text-align: left;
    display: flex;
    justify-content: space-between;
}

.subtle-btn {
    background: none;
    border: none;
    color: var(--gb-darkest);
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    padding: 5px 0;
    border-bottom: 1px dashed var(--gb-darkest);
}

.subtle-btn:active {
    background-color: transparent;
}

/* Thin Total Completion Bar */
.thin-total-container {
    height: 6px;
    background-color: var(--gb-light);
    border: 1px solid var(--gb-darkest);
    position: relative;
    overflow: hidden;
}

.thin-total-bar {
    height: 100%;
    background-color: var(--gb-dark);
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.3s;
}

.complete {
    background-color: var(--gb-darkest);
}

/* History Table Layout */
.history-table-header {
    display: flex;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 2px solid var(--gb-darkest);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.history-table-header .hist-col {
    justify-content: flex-start;
}

.history-row {
    display: flex;
    align-items: center;
    font-size: 16px;
    margin-bottom: 12px;
}

.hist-date-col {
    width: 75px;
    flex-shrink: 0;
}

.hist-col {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 4px;
}

.hist-bar-bg {
    width: 100%;
    height: 14px;
    background-color: var(--gb-lightest);
    border: 1px solid var(--gb-darkest);
    position: relative;
    overflow: hidden;
}

.hist-bar-light {
    background-color: var(--gb-light);
}

.hist-bar {
    height: 100%;
    background-color: var(--gb-dark);
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.3s;
}

.history-list-container {
    max-height: 250px;
    overflow-y: auto;
}