:root {
    --bg-dark: #000000;
    --card-bg: #111111;
    --card-border: #333333;
    --primary-neon: #ffffff;
    --secondary-neon: #666666;
    --success: #ffffff;
    --text-main: #ffffff;
    --text-muted: #888888;
    --font-main: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Ambient Background Glow - REMOVED */
.background-glow {
    display: none;
}

header {
    width: 100%;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    border-bottom: 2px solid var(--card-border);
    background: var(--bg-dark);
}

header h1 {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin: 0;
    color: var(--text-main);
}

.user-select-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    padding: 10px 20px;
    border: 2px solid var(--card-border);
}

select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-main);
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    text-transform: uppercase;
}

option {
    background: var(--bg-dark);
    color: var(--text-main);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    width: 90%;
    max-width: 1200px;
    padding: 2rem 0;
}

/* User Card */
.user-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-main);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.user-name {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-role {
    font-size: 0.8rem;
    background: var(--card-border);
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.user-role.admin {
    background: var(--text-main);
    color: var(--bg-dark);
    border: none;
}

/* Stats */
.stats-row {
    display: flex;
    justify-content: space-between;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Week Grid (New) */
.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 10px;
}

.week-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px 10px;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: var(--text-main);
    color: var(--bg-dark);
}

.week-grid {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.day-btn {
    width: 35px;
    height: 35px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.day-btn:hover:not(:disabled) {
    border-color: var(--text-main);
    color: var(--text-main);
}

.day-btn.active {
    background: var(--text-main);
    color: var(--bg-dark);
    border-color: var(--text-main);
}

.day-btn.today {
    border: 2px solid var(--text-main);
}

.day-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* History Cards */
.history-week-card {
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    padding: 10px;
    margin-bottom: 8px;
}

.week-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.week-delta {
    font-weight: bold;
}

.week-delta.positive {
    color: var(--text-main);
}

.week-delta.negative {
    color: var(--text-muted);
}

.mini-grid {
    display: flex;
    justify-content: space-between;
    gap: 2px;
}

.mini-day {
    width: 25px;
    height: 25px;
    border: 1px solid var(--card-border);
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
}

.mini-day.done {
    background: var(--text-main);
    color: var(--bg-dark);
}

.mini-day.missed {
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 2px,
            #222 2px,
            #222 4px);
}

.mini-day:hover .trash-overlay {
    display: flex;
}

.trash-overlay {
    background: rgba(0, 0, 0, 0.9);
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 0.8rem;
    cursor: pointer;
}

/* History Section */
.history-section {
    margin-top: 15px;
    border-top: 2px solid var(--card-border);
    padding-top: 10px;
}

.toggle-history-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 0.7rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.history-content.hidden {
    display: none;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    max-height: 150px;
    overflow-y: auto;
}

.history-list li {
    font-size: 0.85rem;
    padding: 5px 0;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    gap: 10px;
    color: var(--text-muted);
}

.history-list li i {
    color: var(--text-main);
}

/* Alerts */
.alert-box {
    background: var(--bg-dark);
    border: 2px solid var(--text-main);
    color: var(--text-main);
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.user-card.debt {
    border-color: var(--text-muted);
}

/* Action Button */
.action-btn {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--text-main);
    background: var(--text-main);
    color: var(--bg-dark);
    font-weight: 900;
    font-family: var(--font-main);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    margin-top: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover {
    background: transparent;
    color: var(--text-main);
}

.action-btn:disabled {
    background: var(--card-border);
    border-color: var(--card-border);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    border: 2px solid var(--bg-dark);
    color: var(--bg-dark);
    padding: 15px 30px;
    font-weight: 900;
    text-transform: uppercase;
    z-index: 100;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

/* Activity Log */
.activity-log-container {
    width: 90%;
    max-width: 800px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.activity-log-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1.2rem;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#activityLogList {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

#activityLogList li {
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.log-time {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.8rem;
}

.log-actor {
    color: var(--text-main);
    font-weight: bold;
    text-transform: uppercase;
}

/* Mobile Responsiveness */
/* Mobile Responsiveness */

@media (max-width: 1280px) {
    header {
        justify-content: space-around;
    }
}

@media (max-width: 740px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    header > h1 {
	font-size: 1.5rem;
    }
    .user-select-container {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        width: 95%;
        padding: 1rem 0;
    }

    .day-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .nav-btn {
        padding: 10px 15px;
        font-size: 1.2rem;
    }

    .week-grid {
        gap: 2px;
        justify-content: space-between;
    }

    /* Stack stats for better visibility */
    .stats-row {
        gap: 10px;
    }
}

/* Cleanup: Removed History & Role Styles */
/* .user-role, .history-section style blocks removed */

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border: 2px solid var(--text-main);
    padding: 2rem;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-top: 0;
    text-transform: uppercase;
    color: var(--text-main);
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 1.2rem;
    text-align: center;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--font-main);
}

.modal-btn.confirm {
    background: var(--text-main);
    color: var(--bg-dark);
}


/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.login-overlay.hidden {
    display: none;
}

.login-box {
    background: var(--card-bg);
    border: 2px solid var(--text-main);
    padding: 3rem;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
}

.login-box h2 {
    margin: 0 0 1rem;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: var(--text-main);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-field label {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.login-field select,
.login-field input {
    width: 100%;
    padding: 15px;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 1.2rem;
    text-align: center;
    font-family: var(--font-main);
    outline: none;
    box-sizing: border-box;
    box-sizing: border-box;
    appearance: none;
    /* Normalize */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Mobile Option Fix */
@media (max-width: 768px) {
    select option {
        background-color: #000;
        color: #fff;
    }
}

.login-field input:focus,
.login-field select:focus {
    border-color: var(--text-main);
}

.login-error {
    color: red;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.9rem;
    min-height: 1.2em;
    /* Reserve space */
}
