.calendar-container {
    display: flex;
    flex-direction: column;
    height: calc(330px - 32px);
    width: calc(100% - 32px);
    background: var(--on-backgroud-color);
    border-radius: var(--primary-border-radius);
    padding: 16px;
    gap: 16px;
}

.calendar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #FFFFFF;
    padding: 8px;
    transition: all 0.5s;
    border-radius: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: 24px repeat(3, 32px);

    gap: 10px;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    padding: 6px 0;
    color: var(--secondary-text-color);
    font-size: 16px;
    cursor: pointer;
    border-radius: 12px;
}

.future-day {
    color: var(--primary-text-color);
}

.current-day {
    background: var(--on-accent-light-background-color);
    color: var(--on-accent-light-text-color);
}

.calendar-button img {
}


.calendar-button:hover {
    background: var(--accent-light-background-color);
}

.calendar-button:hover img {
    filter: var(--on-accent-light-background-filter);
}

.calendar-date-text {
    width: 100%;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    cursor: default;
}

.courses-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.courses-container h3 {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

.more-link {
    font-size: 16px;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.5s;
}

.more-link:hover {
    color: var(--accent-color);
}

.course-container {
    display: flex;
    flex-direction: column;

    padding: 24px;
    width: calc(100% - 48px);

    height: calc(190px - 48px);

    gap: 12px;

    background: var(--on-backgroud-color);
    border-radius: 16px;

    transition: all 0.5s;
    border: 1px solid var(--on-backgroud-color);
    cursor: pointer;
}

.course-container p {
    margin: 0;
}

.description-text {
    font-size: 18px;
    font-weight: 500;
}

.course-progress-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.progress-text {
    width: 100%;
    text-align: start;
    color: var(--black-500);
}

.progress-text strong {
    color: var(--primary-text-color);
}

.course-container h4 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    margin-right: auto;
}

.course-progress-horizontal {
    display: flex;
    flex-direction: column;
    justify-content: start;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: #B0C3E0;
}

.course-progress-horizontal-fill {
    width: 66%;
    height: 100%;
    border-radius: 3px 0 0 3px;
    background: var(--on-accent-light-background-color);
}

.course-3d-icon {
    height: 32px;
    width: 32px;
}

.course-container:hover {
    border: 1px solid var(--accent-color);
}

.add-course {
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    background: var(--on-accent-light-background-color);
    border: 1px solid var(--on-accent-light-background-color);
    color: var(--on-accent-light-text-color);
    transition: all 0.3s;
}

.add-course img {
    height: 48px;
    filter: var(--on-accent-light-text-filter);
    transition: all 0.1s;
}

.add-course:hover {
    background: var(--blue-400);
    border: 1px solid var(--blue-400);
    color: var(--on-accent-text-color);
}

.add-course:hover img {
    filter: var(--on-accent-filter);
}

.tasks-container{
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
}

.task-container{
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 16px;
    align-items: center;
    width: calc(100% - 32px);
    height: calc(96px - 32px);
    background: var(--on-backgroud-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.5s;
    border: 1px solid var(--on-backgroud-color);
}

.task-container:hover {
    border: 1px solid var(--accent-color);
}

.add-task {
    color: var(--on-accent-light-text-color);
    font-size: 18px;
    font-weight: 600;
    background: var(--on-accent-light-background-color);
    justify-content: center;
    border: 1px solid var(--on-accent-light-background-color);
}

.add-task:hover{
    background: var(--blue-400);
    border: 1px solid var(--blue-400);
}

.add-task img {
    height: 32px;
    filter: var(--on-accent-light-text-filter);
    transition: all 0.1s;
}

.task-logo-container{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    width: 52px;
    background: var(--accent-light-background-color);
    border-radius: 50%;
}

.task-logo-container img {
    height: 24px;
    width: 24px;
    filter: var(--on-accent-light-background-filter);
}

.task-container h4{
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.task-description-container{
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}


.task-container p{
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--black-500)
}

.task-container .dot-divider {
    height: 8px;
    width: 8px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--black-500);
}

/* === DASHBOARD STATS === */

.dashboard-stats {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    width: calc(100% - 48px);
    background: var(--on-backgroud-color);
    border-radius: 16px;
    border: 1px solid var(--on-backgroud-color);
    transition: all 0.4s;
}

.dashboard-stats:hover {
    border: 1px solid var(--accent-light-background-color);
}

/* Заголовок блока */
.chart-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: start;
}

.chart-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--primary-text-color);
}

.chart-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-text-color);
    margin: 0;
    line-height: 1.2;
}

.chart-subtitle {
    font-size: 16px;
    font-weight: 500;
    color: var(--secondary-text-color);
    margin: 0;
}

.chart-header-right {
    display: flex;
    align-items: start;
}

.chart-period {
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: var(--primary-text-color);
    background: var(--background-color);
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s;
}

.chart-period:hover {
    background: var(--accent-light-background-color);
}

/* === CHART AREA === */

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.dashboard-chart {
    width: 100%;
    height: 100%;
}

/* Легенда Chart.js */
.dashboard-stats .chartjs-legend {
    display: flex !important;
    justify-content: center;
    gap: 16px;
    padding-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-text-color);
}

.dashboard-stats .chartjs-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Цветные точки в легенде */
.dashboard-stats .chartjs-legend-box {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}


.dashboard-stats {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    background: var(--on-backgroud-color);
    border-radius: 16px;
    border: 1px solid var(--on-backgroud-color);
    transition: all 0.4s;
    width: 100%;
    max-width: 100%; /* 🔧 предотвращает растяжение */
    box-sizing: border-box;
    overflow: hidden; /* 🔧 если canvas вылезает */
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%; /* 🔧 не растягиваем больше родителя */
    height: 300px;
    display: block;
}

.dashboard-chart {
    display: block;
    width: 100% !important;  /* 🔧 ключевая фиксация */
    height: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

.dashboard-chart.hidden {
    display: none !important;
}

/* === ПЕРЕКЛЮЧАТЕЛИ ГРАФИКОВ === */

.chart-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 8px;
    width: fit-content;
    margin-right: auto;
}

.chart-mode-button {
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-text-color);
    background: var(--on-backgroud-color);
    border: 1px solid var(--input-border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    width: fit-content;
    max-width: 200px;
}

.chart-mode-button:hover {
    border: 1px solid var(--accent-color);
    color: var(--primary-text-color);
}

.chart-mode-button.active {
    background: var(--on-accent-light-background-color);
    border: 1px solid var(--on-accent-light-background-color);
    color: var(--on-accent-light-text-color);
}

/* === СЕЛЕКТОР ПЕРИОДА (Daily / Weekly / Monthly) === */

.chart-header-right select.chart-period-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    font-weight: 600;
    font-size: 15px;
    color: var(--primary-text-color);
    background: var(--background-color);
    border: 1px solid var(--input-border-color);
    border-radius: 12px;
    padding: 8px 32px 8px 12px;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;

    /* стрелочка вниз */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23333' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.chart-header-right select.chart-period-select:hover {
    border: 1px solid var(--accent-color);
}

.chart-header-right select.chart-period-select:focus {
    border: 1px solid var(--accent-color);
}

/* ---------- Выбор предметов ---------- */

.subjects-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.subjects-section h2 {
    margin: 0;
}

.subjects-section p.muted {
    margin: 0;
    color: var(--secondary-text-color);
    font-size: 15px;
    max-width: 600px;
}

/* --- Список предметов (в строку) --- */

.subjects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.subject-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: calc(100% - 36px);
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--on-backgroud-color);
    border: 1px solid var(--on-backgroud-color);
    transition: all 0.3s ease;

    cursor: pointer;
}

.subject-list-item:hover {
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* --- Левая иконка --- */

.subject-list-item .icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    width: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.subject-list-item .icon-container img {
    width: 32px;
    height: 32px;
}

/* --- Текстовое содержимое --- */

.subject-list-content {
    flex-grow: 1;
    padding-left: 16px;
}

.subject-list-content h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-text-color);
}

.subject-description {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: var(--secondary-text-color);
    line-height: 1.3;
}

/* --- Чекбокс справа --- */

.subject-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-checkbox input[type='checkbox'] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* --- Кнопки --- */

.subjects-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.save-subjects-btn,
.reset-subjects-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.save-subjects-btn {
    background: var(--accent-color);
    color: var(--on-accent-text-color);
}

.save-subjects-btn:hover {
    opacity: 0.9;
}

.reset-subjects-btn {
    border: 1px solid var(--input-border-color);
    background: var(--on-backgroud-color);
    color: var(--secondary-text-color);
}

.reset-subjects-btn:hover {
    background: var(--background-color);
}

.study-section {
    width: 100%;
}

.study-grid {
    width: 100%;
    grid-template-columns: 1fr !important;
}
