@media (max-width: 1200px) {
    .important-notes-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .topbar {
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        min-height: 60px;
        padding: 10px 16px;
    }

    .menu-toggle { display: inline-flex; margin-left: auto; }

    .topnav {
        align-items: stretch;
        display: none;
        flex-direction: column;
        gap: 0;
        order: 3;
        width: 100%;
    }

    .topnav.is-open { display: flex; }

    .topnav a,
    .topnav .link-button {
        font-size: 0.92rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        padding: 10px 0;
        text-align: left;
    }

    .content {
        padding: 24px 16px;
    }

    .auth-panel {
        min-height: auto;
    }

    .auth-card,
    .welcome-panel,
    .quick-card {
        box-shadow: none;
    }

    .auth-card {
        padding: 24px;
    }

    .section-heading h1 {
        font-size: 1.65rem;
    }

    .quick-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }

    .data-table {
        min-width: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: none;
        margin-bottom: 12px;
        padding: 12px;
    }

    .data-table td {
        border-bottom: 0;
        padding: 8px 0;
    }

    .data-table td::before {
        color: var(--muted);
        content: attr(data-label);
        display: block;
        font-size: 0.78rem;
        font-weight: 700;
        margin-bottom: 3px;
    }

    .form-card {
        box-shadow: none;
        padding: 22px;
    }

    .form-grid,
    .form-grid.two,
    .checkbox-grid,
    .dictionary-tools {
        grid-template-columns: 1fr;
    }

    .important-notes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .import-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-upload-form,
    .inline-upload-form input[type="file"] {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .ean-cell {
        align-items: stretch;
        flex-direction: column;
    }

    .model-edit-form {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .attachment-item {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .brand {
        align-items: flex-start;
    }

    .brand span:last-child {
        overflow-wrap: anywhere;
    }

    .auth-card {
        padding: 20px;
    }

    .password-field {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .action-row,
    .form-actions,
    .table-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-link,
    .secondary-link,
    .secondary-button,
    .primary-button,
    .danger-button {
        width: 100%;
    }

    .important-notes-grid {
        grid-template-columns: 1fr;
    }

    .attachment-item {
        flex-direction: column;
    }

    .attachment-thumb {
        flex-basis: auto;
        width: 100%;
    }
}
