/* Shared responsive rules. Keep this file loaded after page-specific styles. */

@media (max-width: 900px) {
    .dashboard-main,
    .schedule-page,
    .projects-page,
    .categories-page {
        width: 100%;
        margin-inline-start: 0;
    }

    .sidebar {
        width: min(var(--sidebar-width), 86vw);
        z-index: 1000;
        transform: translateX(105%);
        box-shadow: -18px 0 45px rgba(8, 13, 25, 0.28);
    }

    .sidebar.is-mobile-open {
        transform: translateX(0);
    }

    .mobile-menu,
    .sidebar-mobile-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
        touch-action: manipulation;
    }

    .nav-item {
        min-height: 48px;
    }
}

@media (max-width: 680px) {
    .schedule-page {
        padding-inline: 12px;
    }

    .timeline-wrapper {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .timeline {
        min-width: 560px;
    }

    .schedule-modal {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 15px;
        border-radius: 14px;
    }

    .schedule-modal label,
    .schedule-modal .form-label {
        font-size: 12px;
    }

    .schedule-modal input,
    .schedule-modal select,
    .schedule-modal textarea,
    .schedule-modal button {
        font-size: 14px;
    }

    .date-picker-dropdown {
        width: min(290px, calc(100vw - 52px));
        max-width: calc(100vw - 52px);
    }
}

@media (max-width: 650px) {
    .categories-page {
        padding: 20px 14px;
    }

    .categories-header h1 {
        font-size: 22px;
    }

    .categories-header p,
    .category-card h2,
    .category-primary-button,
    .category-card__actions button,
    .categories-toolbar input,
    .categories-toolbar select,
    .category-field input,
    .category-form-actions button {
        font-size: 12px;
    }

    .category-modal {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 16px;
    }

    .category-form-actions button {
        min-height: 44px;
    }
}

@media (max-width: 620px) {
    .projects-page {
        padding: 20px 14px;
    }

    .projects-header h1 {
        font-size: 22px;
    }

    .projects-header p,
    .project-card > p,
    .project-primary-button,
    .project-card__actions button,
    .projects-search input,
    .projects-toolbar select,
    .project-field input,
    .project-field select,
    .project-field textarea,
    .project-form-actions button {
        font-size: 12px;
    }

    .project-card h2 {
        font-size: 15px;
    }

    .project-modal {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 16px;
    }

    .project-form-actions button {
        min-height: 44px;
    }
}

@media (max-width: 520px) {
    .auth-panel {
        min-height: 100dvh;
        padding: 12px;
    }

    .auth-card {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .auth-card h2 {
        font-size: 21px;
    }

    .auth-card > p,
    .auth-field label,
    .auth-switch {
        font-size: 12px;
    }

    .auth-card > p {
        line-height: 1.8;
    }

    .auth-field input,
    .auth-submit {
        height: 46px;
        font-size: 14px;
    }

    .auth-submit {
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .category-card {
        grid-template-columns: 1fr;
    }

    .category-card__identity,
    .category-card__actions {
        grid-column: 1;
    }

    .category-card__status {
        justify-self: stretch;
        text-align: center;
    }
}
