body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f8;
    color: #222;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    background: #111827;
    color: #f9fafb;
}

.top-nav .logo {
    font-weight: 600;
}

.top-nav .menu a {
    color: #e5e7eb;
    text-decoration: none;
    margin-left: 16px;
}

.top-nav .menu a:hover {
    text-decoration: underline;
}

.main-layout {
    padding: 16px 24px;
}

.dashboard {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

/* Календарь */

.calendar-panel {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 16px 20px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* строка с названиями дней недели */
.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}

.weekday-cell {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    padding: 4px 0;
}

.weekday-cell.weekend {
    color: #9b1c1c;
}

/* сетка дней */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

/* плитки дней */
.calendar-cell {
    border-radius: 10px;
    padding: 8px 0;
    min-height: 48px;
    text-align: center;
    font-size: 15px;
    user-select: none;
    background: #f9fafb;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;      /* сверху число, снизу индикаторы */
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

/* число дня */
.day-number {
    font-size: 15px;
    margin-bottom: 4px;
}

/* контейнер для точек */
.day-indicators {
    display: flex;
    gap: 4px;
    min-height: 6px;
}

/* базовый индикатор */
.indicator {
    width: 6px;
    height: 6px;
    border-radius: 999px;
}

/* задачи — зелёный */
.indicator-task {
    background: #10b981;
}

/* встречи — фиолетовый */
.indicator-meeting {
    background: #7c3aed;
}

.calendar-cell span {
    pointer-events: none;
}

.calendar-cell.other-month {
    opacity: 0.3;
    background: #f3f4f6;
}

.calendar-cell.weekend {
    background: #fef2f2;           /* мягкий красноватый */
}

.calendar-cell.other-month.weekend {
    background: #fee2e2;
}

/* сегодня — контур */
.calendar-cell.today {
    border: 1px solid #2563eb;
}

/* выбранный день — заливка */
.calendar-cell.selected {
    background: #2563eb;
    color: #ffffff;
}

.calendar-cell:hover {
    background: #e5e7eb;
}

.calendar-cell.selected:hover {
    background: #1d4ed8;
}

.calendar-cell[href] {
    color: inherit;
}

/* Панель дня */

.day-panel {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.day-header h2 {
    margin-top: 0;
    margin-bottom: 16px;
}

/* две колонки: слева встречи, справа задачи */
.day-layout {
    display: grid;
    grid-template-columns: 260px 1.2fr 260px;
    gap: 20px;
}

.day-section {
    margin-bottom: 16px;
}

.day-section h3 {
    margin-bottom: 8px;
}

.day-section ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.task-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 14px;
}

.task-item input[type="checkbox"] {
    margin-top: 3px;
}

.save-button {
    margin-top: 16px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #10b981;
    color: #ffffff;
    cursor: pointer;
    font-weight: 500;
}

.save-button:hover {
    background: #059669;
}

/* Логин */

.login-container {
    max-width: 360px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.login-form label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.login-form button {
    width: 100%;
    margin-top: 12px;
    padding: 8px 0;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-weight: 500;
}

.login-form button:hover {
    background: #1d4ed8;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.meetings-panel {
    border-radius: 10px;
    background: #f9fafb;
    padding: 12px 14px 16px;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
}

.meetings-panel h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

/* форма */
.meeting-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.meeting-form label {
    display: block;
    font-size: 13px;
}

.meeting-form input[type="text"],
.meeting-form input[type="time"],
.meeting-form textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    resize: vertical;
}

.meeting-row {
    display: flex;
    gap: 8px;
}

.meeting-add-button {
    align-self: flex-start;
    margin-top: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
}

.meeting-add-button:hover {
    background: #1d4ed8;
}

.empty-text {
    font-size: 13px;
    color: #6b7280;
}

/* список встреч */
.meeting-list {
    list-style: none;
    padding-left: 0;
    margin: 8px 0 0;
    max-height: 260px;
    overflow-y: auto;
}

.meeting-item {
    padding: 6px 8px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    margin-bottom: 6px;
    font-size: 13px;
}

.meeting-time-title {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 2px;
}

.meeting-time {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: #374151;
}

.meeting-title {
    font-weight: 500;
}

.meeting-notes {
    font-size: 12px;
    color: #4b5563;
    margin-top: 2px;
}

.meeting-notify {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-top: 4px;
}

.meeting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.meeting-time-title {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 2px;
}

.meeting-delete-form {
    margin: 0;
}

.meeting-delete-form button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    color: #9ca3af;
}

.meeting-delete-form button:hover {
    color: #ef4444;
}

.mytasks-panel {
    border-radius: 10px;
    background: #f9fafb;
    padding: 12px 14px 16px;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
}

.mytasks-panel h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

/* форма добавления задачи */
.mytask-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.mytask-form label {
    font-size: 13px;
}

.mytask-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}

.mytask-add-button {
    align-self: flex-start;
    margin-top: 2px;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
}

.mytask-add-button:hover {
    background: #1d4ed8;
}

/* форма статусов задач */
.mytask-status-form {
    margin-top: 8px;
}

.mytask-section {
    margin-bottom: 10px;
}

.mytask-section h4 {
    margin: 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

/* переиспользуем .task-item, добавим стиль для выполненных */
.task-item.done span {
    text-decoration: line-through;
    color: #6b7280;
}

.mytask-save-button {
    margin-top: 4px;
    padding: 6px 12px;
    font-size: 13px;
}

.stats-page h1 {
    margin-bottom: 20px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-card {
    background: #0f172a;
    color: #f9fafb;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.stats-card-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.stats-card-value {
    font-size: 24px;
    font-weight: 600;
}

.stats-table-section h2 {
    margin-bottom: 12px;
}

.stats-table-wrapper {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stats-table th,
.stats-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.stats-table th {
    background: #f3f4f6;
    font-weight: 600;
}

.stats-page h1 {
    margin-bottom: 20px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-card {
    background: #0f172a;
    color: #f9fafb;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.stats-card-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.stats-card-value {
    font-size: 24px;
    font-weight: 600;
}

/* Блок с графиками */
.stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.chart-card h2 {
    font-size: 16px;
    margin-bottom: 12px;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card canvas {
    width: 100%;
    max-height: 260px;
}

/* Таблица */
.stats-table-section h2 {
    margin-bottom: 12px;
}

.stats-table-wrapper {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

.stats-table th,
.stats-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.stats-table th {
    background: #f3f4f6;
    font-weight: 600;
}

.stats-table tr:nth-child(even) td {
    background: #f9fafb;
}

@media (max-width: 768px) {
    .chart-card canvas {
        max-height: 220px;
    }
}

.mytasks-panel h4 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.task-add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.key-task-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-top: 6px;
    opacity: 0.9;
}

.mytask-row-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.key-task-toggle {
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    color: #f59e0b; /* можно убрать, если не хочешь задавать цвет */
}

.mytask-row.key-task {
    background: #fffbeb;
    border-radius: 8px;
}

.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 6px;
    background: #ffffff;
}

.task-row.done {
    opacity: 0.7;
}

.task-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-title {
    font-size: 14px;
}

.task-meta {
    font-size: 11px;
    color: #6b7280;
    margin-left: 8px;
}

.key-task-form {
    margin-left: 8px;
}

.key-task-button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
}

/* Визуальное выделение ключевых задач */
.task-row.key-task {
    border-color: #fbbf24;
    background: #fffbeb;
}

.task-row.key-task .task-title {
    font-weight: 600;
}

/* ===== Адаптив под планшеты и телефоны ===== */

/* Планшеты и уже */
@media (max-width: 1024px) {
    .dashboard {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .calendar-panel,
    .day-panel {
        width: 100%;
    }

    .day-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Телефоны */
@media (max-width: 768px) {
    body {
        margin: 0;
    }

    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 12px;
    }

    .top-nav .menu a {
        font-size: 14px;
        padding: 4px 8px;
    }

    .main-layout {
        padding: 8px 10px;
    }

    .day-header h2 {
        font-size: 16px;
        line-height: 1.3;
    }

    /* Календарь на всю ширину, чуть компактнее ячейки */
    .calendar-panel {
        padding: 8px 10px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-cell {
        padding: 4px;
        min-height: 44px;
    }

    .day-number {
        font-size: 12px;
    }

    /* Блок дня: всё в одну колонку */
    .day-layout {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .meetings-panel,
    .tasks-panel,
    .mytasks-panel {
        width: 100%;
        padding: 8px 10px;
    }

    .meeting-form label,
    .mytask-form label {
        font-size: 13px;
    }

    .meeting-item,
    .task-item {
        font-size: 13px;
    }

    .mytask-row-inner {
        gap: 6px;
    }

    .key-task-toggle {
        font-size: 16px;
        padding: 0 2px;
    }

    /* Карточки/блоки без чрезмерных теней и отступов на телефоне */
    .meetings-panel,
    .tasks-panel,
    .mytasks-panel {
        border-radius: 10px;
    }
}