* {
    user-select: none;
    box-sizing: border-box;
}

body {
    font-family: system-ui, 'Segoe UI', 'Roboto', sans-serif;
    background: #1a1e2c;
    color: #eef2ff;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    overflow-x: visible;
}

.user-section {
    background: #0f1222;
    padding: 1rem 1.5rem;
    border-radius: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    position: relative;
}

.user-input-group {
    flex: 2;
    min-width: 180px;
}

.user-input-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9ca3ef;
}

.user-input-group input {
    width: 100%;
    padding: 10px 14px;
    background: #232744;
    border: 1px solid #3b3f6b;
    color: white;
    border-radius: 2rem;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}

.user-input-group input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px #8b5cf680;
}

.datalist-hint {
    font-size: 0.7rem;
    color: #b9c0ff;
    margin-top: 5px;
    margin-left: 12px;
}

button {
    background: #8b5cf6;
    border: none;
    padding: 10px 24px;
    border-radius: 2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

button:hover {
    background: #a78bfa;
    transform: scale(1.02);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reset-user-btn {
    background: #334155;
}

.reset-user-btn:hover {
    background: #475569;
}

.save-status {
    position: absolute;
    bottom: -30px;
    right: 20px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 4px 12px;
    border-radius: 20px;
    background: #0f1222;
}

.save-status.show {
    opacity: 1;
}

.save-status.success {
    color: #4ade80;
}

.save-status.error {
    color: #ef4444;
}

.workout-table {
    width: 100%;
    border-collapse: collapse;
    background: #0f1222;
    border-radius: 1.5rem;
    overflow: visible;  /* ← меняем */
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    position: relative;
}

.workout-table th, .workout-table td {
    border: 1px solid #2d3254;
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
    font-weight: 500;
}

.workout-table th {
   background: #1e243f;
    color: #facc15;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 31;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.workout-table thead {
    position: sticky;
    top: 0;
    z-index: 30;
}
#tableWrapper {
    overflow: auto;  /* ← x и y */
    position: relative;
    max-height: 80vh;
}

.workout-table td {
    background: #14182e;
    transition: 0.05s linear;
    font-size: 1.2rem;
    font-weight: bold;
}
/* Подсветка текущего дня */
.workout-table .current-day-row {
    background: #2a3a5c !important;
    box-shadow: 0 0 0 2px #facc15 inset;
}

.workout-table .current-day-row td {
    background: #2a3a5c !important;
    border-top: 2px solid #facc15;
    border-bottom: 2px solid #facc15;
}

.workout-table .current-day-row .day-cell {
    background: #2a3a5c !important;
    position: relative;
}

.workout-table .current-day-row .day-cell::before {
    content: "⭐";
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}


.day-cell {
    background: #1b1f3a !important;
    font-weight: 600;
    color: #b9c0ff;
    cursor: default;
    white-space: nowrap;
}

.counter-cell {
    min-width: 55px;
    cursor: pointer;
}

.counter-cell:active {
    background: #2d3360;
}

/* Прогресс-бар ячейка */
.progress-cell {
    background: #1b1f3a !important;
    padding: 8px !important;
    min-width: 180px;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.save-btn {
    background: #22c55e !important;
}

.save-btn:hover {
    background: #4ade80 !important;
}

.save-status.warning {
    color: #facc15;
}

.progress-bar-wrapper {
    width: 100%;
    background: #2d3254;
    border-radius: 20px;
    overflow: hidden;
    height: 24px;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}

.progress-stats {
    font-size: 0.75rem;
    color: #b9c0ff;
}

.progress-stats span {
    font-weight: bold;
    color: #facc15;
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: bold;
}

/* Цвета прогресс-бара */
.progress-red {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.progress-yellow {
    background: linear-gradient(90deg, #eab308, #facc15);
}

.progress-green {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.75rem;
    color: #6c6f9e;
}

.placeholder {
    background: #1e1f3a;
    padding: 40px;
    text-align: center;
    border-radius: 2rem;
}

@media (max-width: 700px) {
    .workout-table th, .workout-table td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    .counter-cell {
        min-width: 40px;
    }
    .progress-cell {
        min-width: 140px;
    }
    .progress-bar-wrapper {
        height: 18px;
    }
}